我有一个 UVM 记分牌,它有多个导致`uvm_error
. 我想自动拦截 uvm_error 并转储我的记分牌的内容。其他工程师将向记分板(及其子级)添加检查,因此回调应尽可能透明。
我正在尝试做的简单示例:
task run_phase(uvm_phase phase);
phase.raise_objection(this);
// How to do an automatic sb.dump_contents() callback?
`uvm_error("ERROR", "scoreboard caught an error");
phase.drop_objection(this);
endtask
function void dump_contents();
$display("The queue contents of my scoreboard.");
endfunction
您可以在 EDA Playground 上模拟和修改上述示例:http ://www.edaplayground.com/s/4/549
什么是 UVM 推荐的方法来做到这一点?有人可以分享工作代码吗?