0
votes

I am trying to change the UVM verbosity of the simulation after satisfying certain conditions. Verbosity options of different components are passing through the command line as +uvm_set_verbosity. Once the conditions are satisfied, then the simulations should run with the the command line +uvm_set_verbosity option. Till then simulation runs with low verbosity for all components.

Looking through the UVM library code, it appears that there is a function called m_set_cl_msg_args(). This function calls three other functions that appear to consume the command line arguments like: +uvm_set_verbosity, +uvm_set_action, +uvm_set_severity.

So what I did was get the uvm_root instance from the uvm_coreservice singleton, and then use the get_children() function from uvm_component class to recursively get a queue of all of the uvm_components in the simulation. Then call the m_set_cl_msg_args() function on all of the components.

My code looks like:

    begin
     uvm_root r;
     uvm_coreservice_t cs_t;
     uvm_component array_uvm[$];
     cs_t = uvm_coreservice_t::get();
     r = cs_t.get_root();

     r.get_children(array_uvm);
     foreach(array_uvm[i])
       array_uvm[i].m_set_cl_msg_args();
    end

Even though this code compiles properly, But this is not changing verbosity. Any idea ? Moreover I am able to print all the components in array_uvm. So I am guessing array_uvm[i].m_set_cl_msg_args(); this as a wrong call.

Anyone have any other suggestion to change verbosity during run time.

1

1 Answers

1
votes

You should never use functions in the UVM that are not documented in the language reference manual. They can (and do) change in any revision. I'm guessing +uvm_set_verbosity only works at time 0 by default.

There is already a function to do what you want

umm_top.set_report_verbosity_level_hier()

I suggest using +UVM_VERBOSITY=UVM_LOW to start your test, and then define your own switch for activating the conditional setting.

If you want a specific component, use component_h.set_report_verbosity_level() (add the _hier to set all its children)

You can use the UVM's command line processor get_arg_values() method to specify the name of the component(s) you want to set, and then use umm_top.find() to get a handle to the component.