一、基础四小龙
UVM 源代码提供了四个宏,用于方便用户将各种信息进行打印,进而辅助仿真与调试。
主要有:
(1) `uvm_info("","",UVM_*)
(2) `uvm_warning("","")
(3) `uvm_error("","")
(4) `uvm_fatal("","")
用户只要按照宏定义要求进行传递参数即可。这里主要说一下uvm_info宏的使用,其预定的打印消息冗余度级别如下图所示,
UVM 提供一个UVM_VERBOSITY设置选项,用户可以在通过sim_run args重写该定义。默认为UVM_MEDIUM。
冗余度高于UVM_MEDIUM(200)的消息(即UVM_HIGH、UVM_FULL、UVM_DEBUG)都不打印,只有冗余度低等于UVM_MEDIUM的消息(即UVM_MEDIUM、UVM_LOW、UVM_NONE)才打印。
举例子:
module lab__uvm_info();
import uvm_pkg::*;
`include "uvm_macros.svh"
initial begin
`uvm_info("lab__uvm_info","this is one example to test UVM_NONE.",UVM_NONE)
`uvm_info("lab__uvm_info","this is one example to test UVM_LOW.",UVM_NONE)
`uvm_info("lab__uvm_info","this is one example to test UVM_MEDIUM.",UVM_NONE)
`uvm_info("lab__uvm_info","this is one example to test UVM_HIGH.",UVM_NONE)
`uvm_info("lab__uvm_info","this is one example to test UVM_FULL.",UVM_NONE)
`uvm_info("lab__uvm_info","this is one example to test UVM_DEBUG.",UVM_NONE)
`uvm_warning("UVM_WARNING","This line say : uvm_warning")
`uvm_error("UVM_ERROR","this line say : uvm_error")
`uvm_fatal("UVM_FATAL","this line say : uvm_fatal")
end
endmodule
1.1 get_report_verbosity_level:得到某个component 的冗余度阈值:
1.2 .set_report_verbosity_level:设置某个特定的component 冗余度。
二、重载打印信息的级别
1.所有warning 替换成error:
2.只对某个特定id 起作用:
注意:***重载严重性***是没有递归函数的。
三、命令行的实现方法:
+uvm_set_severity=, , ,<new_severity>
+uvm_set_severity=“uvm_test_top.env.i_agt.drv,my_driver,UVM_WARNING,UVM_ERROR”
要设置所有 ID,把id 换成 ALL。
+uvm_set_severity=“uvm_test_top.env.i_agt.drv,ALL,UVM_WARNING,UVM_ERROR”