我在 UVM SV 测试台中使用邮箱,在尝试写入邮箱时遇到了一些问题。我的代码如下所示:
class my_seqyuence extends uvm_sequence;
mailbox data;
some_user_defined_type mydata;
function new(string name = "my_sequence");
super.new(name);
data=new();
endfunction
task body();
forever begin
// blocking-get. program is blocked here... not why get is not returning...!
data.get(mydata);
decode_mydata_and_do_something_here;
end
endtask
function void writetrans(some_user_defined_type trans);
// I used print statements with mailbox size and i can see that valid trans is arriving here and successfully writing to mailbox.
data.try_put(trans)
endfunction
endclass
我不太确定出了什么问题...数据一直到达 writetrans(*) 函数,最终即使邮箱中有空间也无法写入。