How do I control the verbosity of certain components so that I can set a verbosity to only few of the components?
Lets say, for example in the verification of a particular feature, the test, few set of components/sequences/objects/interfaces etc are involved. I would like to set the verbosity of only these to be UVM_HIGH
. I do not want to set the global severity to be set UVM_HIGH
since lot of unrelated debug messages could come in which might increase the log size.
What would be a cleaner way of doing this? Its okay to use an additional commandline-plusarg for triggering this. Basically, the requirement would be that the test/components/sequences/objects/interfaces involved for a particular feature verification should take the global severity or the feature specific severity depending on which is higher.
Please note that one cannot use the built in report methods of uvm_component
since, the uvm_info
statements can be inside uvm_object
extended classes as well as interfaces.
3 Answers
You can control the verbosity of a component from command line as a simulation argument. There are two choices:
+uvm_set_verbosity=<comp>,<id>,<verbosity>,<phase>
+uvm_set_verbosity=<comp>,<id>,<verbosity>,time,<phase>
This one lets you specify the simulation time you want the applied verbosity to start
comp
is the path of the component and wildcard *
is supported. Example: uvm_test_top.env.agnt.*
id
is the message identifier. you can apply to all messages within the component scope with by setting the id to _ALL_
verbosity
is verbosity e.g. UVM_LOW
, UVM_MEDIUM
, UVM_HIGH
, etc. phase
is phase you want the verbosity to be applied to.
For more detail i suggest reading:
- The UVM reference manual section on Command Line Processor
- UVM Message Display Commands Capabilities, Proper Usage and Guidelines by Clifford E. Cummings
You can use uvm_report_catcher
for this. It works with uvm_object
and interface. You can also use get_id()
, get_message()
etc. API for matching particular component/object and can only set verbosity of that component/object.
check my simple example on here on edaplaygroud
I tried different ways and also came up with this way.
Not sure how much it would be helpful for people.
simulate this with run time commands +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
A working example can be found at edaplayground here
ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJoam9pZWeFdYWOrJytrJmjtG7Ax55kr52il7y0tdOyZKimnK56p7vRZp2er12osrLBxKeanqtdpK%2BrscKtqmahnqmys7LAnJysZZmjerbCzA%3D%3D