我试图在uvm序列中强制一个信号。我使用的是uvm_hdl_force方法。
我的语法,从我的uvm序列中的任务中运行是:
if( !uvm_hdl_force ("ex_top.ent_lvl1.ent_lvl2.signalname",1'b1);
`uvm_fatal("CM_BUSY_SEQ","uvm_hdl_force failure of signalname")
我发现这总是失败的。
我已经验证了路径,如果我运行uvm_hdl_check_path("ex_top.ent_lvl1.ent_lvl2.signalname"(,它会返回1,表示路径存在。既然我不确定为什么部队失败了,或者我还应该检查什么?
如果有比我尝试的更好的方法,我也对其他迫使信号变高的方法持开放态度。
这是一个混合代码设计。最高级别是verilog,较低级别的模块(包括我试图强制执行的特定信号所在的模块(是VHDL。
谢谢
从提供的片段中,解决方案如下,将致命的封装到begin-end
。因为;
将意味着行的结束,从而终止if子句。或者,如果不想使用begin-end
,请不要将;
放在if子句之后。
// this ; invokes end of condition, to be safe wrap the fatal to begin end
// |
// V
if( !uvm_hdl_force ("tb_top.test",1'b1));
`uvm_fatal("CM_BUSY_SEQ","uvm_hdl_force failure of signalname")
// |
// |
// V
if( !uvm_hdl_force ("tb_top.test",1'b1)) begin
`uvm_fatal("CM_BUSY_SEQ","uvm_hdl_force failure of signalname")
end
// Or without ;
if( !uvm_hdl_force ("tb_top.test",1'b1))
`uvm_fatal("CM_BUSY_SEQ","uvm_hdl_force failure of signalname")
此外,大多数工具都支持自己的系统任务来强制值:
- Xcelium
$xm_force(string path,string value)
- Questa
$signal_force(string path,string value)
这些任务可能有更多的参数,但我建议在工具的参考手册中查找它们。
目前我已经解决了这个问题,从uvm_hdl_force转移到传统的force语句