|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
发送reg seq的时候, 使用正常的发送reg seq仿真是正常的。但是, 使用reg model发送seq仿真一直不停止(rgm当作seq发激励就只发了第一个, 然后就卡住了, 仿真时间一直跑的)。
reg driver:
task tdm_encoder_reg_driver::do_drive();
reg_trans req,rsp;
while(1)begin
seq_item_port.get_next_item(req);
drive_one_config(req);
void'($cast(rsp,req.clone()));
rsp.rsp = 1;
rsp.set_sequence_id(req.get_sequence_id);
seq_item_port.item_done(rsp);
end
endtask
rgm adapter:
class rgm_adapter extends uvm_reg_adapter;
`uvm_object_utils(rgm_adapter)
function new(string name = "rgm_adapter");
super.new(name);
provides_responses = 1;
endfunction
function uvm_sequence_item reg2bus(const ref uvm_reg_bus_op rw);
reg_trans tr = reg_trans::type_id::create("tr");
tr.cmd = (rw.kind == UVM_WRITE)? `WRITE:`READ;
tr.addr = rw.addr;
tr.data = rw.data;
return tr;
endfunction
function void bus2reg(uvm_sequence_item bus_item, ref uvm_reg_bus_op rw);
reg_trans tr;
if(!$cast(tr, bus_item))begin
`uvm_fatal("CASTFAIL", "Provided bus_item is not the correct type")
return;
end
rw.kind = (tr.cmd == `WRITE)? UVM_WRITE:UVM_READ;
rw.addr = tr.addr;
rw.data = tr.data;
rw.status = UVM_IS_OK;
endfunction
endclass
我怀疑是 bus2reg 的时候哪里出问题了导致没有握手成功, 可能我写的不全。有知道怎么解决的吗?感谢
|
|