如何控制某些组件的详细性,以便只将详细内容设置为少数组件?
例如,在特定特性的验证中,测试很少涉及组件/序列/对象/接口等。我想把这些细节设置为UVM_HIGH。我不想将全局严重性设置为UVM_HIGH,因为可能会出现大量不相关的调试消息,这可能会增加日志大小。
有什么更干净的方法可以做到这一点?使用额外的命令行-plusarg触发这一点是可以的。基本上,需求是,用于特定特性验证的测试/组件/序列/对象/接口应该具有全局严重性或特定于特性的严重性,这取决于哪个级别更高。
请注意,不能使用uvm_component的内置报表方法,因为uvm_info语句可以在uvm_object扩展类中,也可以在接口中。
发布于 2016-03-23 05:44:34
为此您可以使用uvm_report_catcher。它与uvm_object和接口一起工作。您还可以使用get_id()、get_message()等API来匹配特定的组件/对象,并且只能设置该组件/对象的详细性。
查看我在就在这里上的简单示例
发布于 2016-05-11 16:32:29
我尝试了不同的方法,也想出了这样的方法。
不知道它对人们有多大的帮助。
使用运行时命令+user_verb=UVM_LOW +UVM_VERBOSITY=UVM_MEDIUM进行模拟
class user_class extends uvm_object;
string report_id = "user_class";
string user_verb;
typedef uvm_enum_wrapper#(uvm_verbosity) uvm_verbosity_wrapper_e;
uvm_verbosity current_verb;
uvm_verbosity USER_VERBOSITY=UVM_HIGH;
function new (string name="my_class");
super.new(name);
report_id = name;
//void'($value$plusargs("user_verb=%s",user_verb));
//void'(uvm_verbosity_wrapper_e::from_name (user_verb,USER_VERBOSITY));
if ($test$plusargs("user_verb")) begin
current_verb=uvm_top.get_report_verbosity_level(UVM_INFO,"current_verb"); USER_VERBOSITY=uvm_top.get_report_verbosity_level(UVM_INFO,"user_verb");
end
$display("user_verb = %s",user_verb);
$display("current_verb = %s",current_verb);
endfunction : new
task display;
`uvm_info(report_id,"This is my message",USER_VERBOSITY)
endtask
endclass: user_class
module top;
string id;
string report_id = "top";
user_class m_user_class;
initial begin
m_user_class = new("m_user_class");
m_user_class.display;
`uvm_info(report_id,"This is my message",UVM_LOW)
end
endmodule: top可以在eda游乐场这里上找到一个工作示例。
https://stackoverflow.com/questions/36152849
复制相似问题