仅在 uvm 中为少数 /sequences/objects/interfaces 设置 Verbosity?
setting the Verbosity only for few /sequences/objects/interfaces in uvm?
如何控制某些组件的详细程度,以便我可以只为少数组件设置详细程度?
可以说,例如在验证特定功能时,涉及测试、几组 components/sequences/objects/interfaces 等。我想将只有这些的冗长设置为 UVM_HIGH
。我不想将全局严重性设置为 UVM_HIGH
,因为可能会出现许多不相关的调试消息,这可能会增加日志大小。
执行此操作的更简洁方法是什么?可以使用额外的命令行加参数来触发它。基本上,要求是特定功能验证所涉及的测试/components/sequences/objects/interfaces 应采用全局严重性或特定于功能的严重性,具体取决于哪个更高。
请注意,不能使用 uvm_component
的内置报告方法,因为 uvm_info
语句可以在 uvm_object
扩展 类 以及接口中。
您可以从命令行控制组件的详细程度作为模拟参数。有两种选择:
<b>+uvm_set_verbosity=</b><comp>,<id>,<verbosity>,<phase>
<b>+uvm_set_verbosity=</b><comp>,<id>,<verbosity>,<b>time</b> ,<phase>
这个可以让你指定你希望应用的详细程度开始的模拟时间
comp
为组件路径,支持通配符*
。示例:uvm_test_top.env.agnt.*
id
是消息标识符。您可以通过将 id 设置为 _ALL_
来应用于组件范围内的所有消息
verbosity
是冗长的,例如UVM_LOW
、UVM_MEDIUM
、UVM_HIGH
等。
phase
是您希望应用详细信息的阶段。
有关更多详细信息,我建议阅读:
- UVM reference manual section on Command Line Processor
- UVM Message Display Commands Capabilities, Proper Usage and Guidelines 作者:Clifford E. Cummings
您可以为此使用 uvm_report_catcher
。它适用于 uvm_object
和界面。您还可以使用 get_id()
、get_message()
等 API 来匹配特定的 component/object 并且只能设置 component/object.
的详细程度
查看我在 here on edaplaygroud
上的简单示例
我尝试了不同的方法,也想出了这个方法。
不确定它对人们有多大帮助。
用 运行 时间命令模拟这个 +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
可以在 edaplayground here
找到一个工作示例
如何控制某些组件的详细程度,以便我可以只为少数组件设置详细程度?
可以说,例如在验证特定功能时,涉及测试、几组 components/sequences/objects/interfaces 等。我想将只有这些的冗长设置为 UVM_HIGH
。我不想将全局严重性设置为 UVM_HIGH
,因为可能会出现许多不相关的调试消息,这可能会增加日志大小。
执行此操作的更简洁方法是什么?可以使用额外的命令行加参数来触发它。基本上,要求是特定功能验证所涉及的测试/components/sequences/objects/interfaces 应采用全局严重性或特定于功能的严重性,具体取决于哪个更高。
请注意,不能使用 uvm_component
的内置报告方法,因为 uvm_info
语句可以在 uvm_object
扩展 类 以及接口中。
您可以从命令行控制组件的详细程度作为模拟参数。有两种选择:
<b>+uvm_set_verbosity=</b><comp>,<id>,<verbosity>,<phase>
<b>+uvm_set_verbosity=</b><comp>,<id>,<verbosity>,<b>time</b> ,<phase>
这个可以让你指定你希望应用的详细程度开始的模拟时间
comp
为组件路径,支持通配符*
。示例:uvm_test_top.env.agnt.*
id
是消息标识符。您可以通过将 id 设置为 _ALL_
来应用于组件范围内的所有消息
verbosity
是冗长的,例如UVM_LOW
、UVM_MEDIUM
、UVM_HIGH
等。
phase
是您希望应用详细信息的阶段。
有关更多详细信息,我建议阅读:
- UVM reference manual section on Command Line Processor
- UVM Message Display Commands Capabilities, Proper Usage and Guidelines 作者:Clifford E. Cummings
您可以为此使用 uvm_report_catcher
。它适用于 uvm_object
和界面。您还可以使用 get_id()
、get_message()
等 API 来匹配特定的 component/object 并且只能设置 component/object.
查看我在 here on edaplaygroud
上的简单示例我尝试了不同的方法,也想出了这个方法。
不确定它对人们有多大帮助。
用 运行 时间命令模拟这个 +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
可以在 edaplayground here
找到一个工作示例