Suggestions for +uvm_set_verbosity

Hello All,
In my existing UVM Tb I am trying to set verbosity to UVM_DEBUG for specific components ( and ignore the UVM_DEBUG msgs from UVM library and other components )

The two components of interest are scbd and reg_mon which are created in Env’s build_phase()

  tc_scbd     = tc_mapr_sb::type_id::create("tc_mapr_scbd", this); 
  tc_reg_mon  = tc_mapr_reg_mon::type_id::create("tc_mapr_reg_mon", this); 

Pls note that string arg. ‘name’ to create is different than their respective handle names

I have a few questions on using +uvm_set_verbosity as command line argument for these 2 components

(1) Are multiple +uvm_set_verbosity arguments legal in UVM ?
Eg: For multiple +UVM_VERBOSITY= only the 1st occurrence is used internally as per LRM

(2) Does (1) depend on UVM version ? i.e whether I am using UVM 1.1d or UVM 1.2

(3) Assuming that (1) is legal, how does user provide the hierarchy for the 2 components ?
i.e does UVM library consider the full hierarchical name ( i.e string ‘name’ argument “tc_mapr_scbd” & “tc_mapr_reg_mon” )
[ OR ] is it based on handle name ( tc_scbd & tc_reg_mon ) ?

i.e Should I pass

+uvm_set_verbosity=uvm_test_top.env.tc_mapr_scbd,_ALL_,UVM_DEBUG,run
       [ OR ] 
+uvm_set_verbosity=uvm_test_top.env.tc_scbd,_ALL_,UVM_DEBUG,run

(4) Can +uvm_set_verbosity be used for object types (associated with components) like ::

   (a)  Sequences started on particular sequencer
        i.e to set verbosity for msgs fom sequence body() with starting signature ::
        uvm_test_top.env.vseqr@@tc_mapr_init_seq

   (b)  Adapter passed as argument to 'set_sequencer' to register map of register block
           // Within Env's build_phase() ::
            tc_mapr_reg2axi = axi_ral_adapter::type_id::create("tc_mapr_reg2axi",this); // 2nd arg. is this
           //  Within Env's connect_phase() ::
            tc_mapr_ral.default_map.set_sequencer( tc_mapr_vseqr , tc_mapr_reg2axi );

(5) My intention is to pass the command line argument using Makefile switches.

The expectation is when I don’t pass +uvm_set_verbosity1 & +uvm_set_verbosity2, the global verbosity should be used. Would the following work ?

##// Within the Makefile, what should be the default switches for uvm_set_verbosity1 & uvm_set_verbosity2
       UVM_VERBOSITY          ?= UVM_LOW 
       uvm_set_verbosity1     ?= *,_ALL_,$(UVM_VERBOSITY),run
       uvm_set_verbosity2     ?= *,_ALL_,$(UVM_VERBOSITY),run

where the above switches are passed as run-time arguments to the tool ::

+UVM_VERBOSITY=$(UVM_VERBOSITY) +uvm_set_verbosity=$(uvm_set_verbosity1) +uvm_set_verbosity=$(uvm_set_verbosity2)

Is +UVM_VERBOSITY=UVM_LOW equivalent to +uvm_set_verbosity=*,_ALL_,UVM_LOW,run ?

There is a bug in UVM 1.2 and earlier versions preventing multiple +uvm_set_verbosity switches on the command line.

https://accellera.mantishub.io/view.php?id=4832

Do not use UVM_DEBUG as a verbosity level in your code, that is reserved for debugging UVM base class library code. Use UVM_HIGH or UVM_FULL`. You can also use a numerical value if you need finer control. You can look up the definition of these labels.

The < comp > argument for the switch is the string path name. If you are do this from inside your test, you would use the class variable names.

Thanks Dave. The reason I am using UVM_DEBUG is to observe the `uvm_info msgs in our Tb added by colleagues

Would like to hear your thoughts on (4) and (5)

Note that UVM_DEBUG is not documented in the IEEE 1800.2 UVM Reference manual.

(4)

Sequence items and sequences will use the sequencer which they are associated with for reporting messages. If no sequencer has been set for the item/sequence using set_sequencer or indirectly via uvm_sequence_base::start_item or uvm_sequence_base::start), then the global reporter will be used.

(5)
I would expect +UVM_VERBOSITY to apply to all messages not affected by +uvm_set_verbosity. You should try a small testcase and correct me if that is not the case. +UVM_VERBOSITY applies to all phases.

Thanks Dave. Will try some examples over the weekend and share my observation on this thread.

Related to (4). Within class uvm_sequence_item ::

  //---------------------------
  // Group: Reporting Interface
  //---------------------------
  //
  // Sequence items and sequences will use the sequencer which they are
  // associated with for reporting messages. If no sequencer has been set
  // for the item/sequence using <set_sequencer> or indirectly via 
  // <uvm_sequence_base::start_item> or <uvm_sequence_base::start>),
  // then the global reporter will be used.

  virtual function uvm_report_object uvm_get_report_object();
    if(m_sequencer == null) begin
      uvm_coreservice_t cs = uvm_coreservice_t::get();
       return cs.get_root();
    end else 
      return m_sequencer;
  endfunction

  function int uvm_report_enabled(int verbosity, 
    				  uvm_severity severity=UVM_INFO, string id="");
    uvm_report_object l_report_object = uvm_get_report_object();
    if (l_report_object.get_report_verbosity_level(severity, id) < verbosity)
      return 0;
    return 1;
  endfunction

Whereas when user calls `uvm_info in an object like adapter ( even with parent component i.e object is created within a component with 2nd arg. to create as 'this ) , function uvm_report_enabled defined in class uvm_globals gets called ::

function int uvm_report_enabled (int verbosity,
                                 uvm_severity severity=UVM_INFO, string id="");
  uvm_root top;
  uvm_coreservice_t cs;
  cs = uvm_coreservice_t::get();
  top = cs.get_root();
  return top.uvm_report_enabled(verbosity,severity,id);
endfunction

I tried an example edaplayground where I observed the following ::

(1) Using +UVM_VERBOSITY=UVM_LOW
Only the `uvm_info msgs with verbosity of UVM_NONE & UVM_LOW are observed from ALL phases

( uvm_warning & uvm_error have default verbosity of UVM_NONE by default, hence they are always observed )

(2) Using +uvm_set_verbosity=*,_ALL_,UVM_LOW,build ::
Only the `uvm_info msgs with verbosity of UVM_NONE & UVM_LOW are observed from ALL phases

( uvm_warning & uvm_error have default verbosity of UVM_NONE by default, hence they are always observed )
Thus (2) is equivalent to (1)

i.e +uvm_set_verbosity=*,_ALL_,UVM_LOW,build is Same as +UVM_VERBOSITY=UVM_LOW

(3) Using both :: +UVM_VERBOSITY=UVM_NONE +uvm_set_verbosity=*,_ALL_,UVM_LOW,build

Since +uvm_set_verbosity has higher priority than +UVM_VERBOSITY , output is same as (2)

(4) Using both :: +UVM_VERBOSITY=UVM_NONE +uvm_set_verbosity=*,_ALL_,UVM_LOW,run

 For pre-run phases i.e build , connect , end_of_elaboration +UVM_VERBOSITY is used
 
 For run & post-run phases ( i.e reset , configure , main , shutdown , check , final ), Verbosity of UVM_LOW is used for uvm_info msgs

(4) Using both :: +UVM_VERBOSITY=UVM_NONE +uvm_set_verbosity=*,_ALL_,UVM_LOW,main

 For pre-main phases i.e build , connect , end_of_elaboration , reset , configure +UVM_VERBOSITY is used
 
 For main & post-main phases ( i.e main , shutdown , check , final ), Verbosity of UVM_LOW is used for uvm_info msgs

So to answer my question from the top

+UVM_VERBOSITY=UVM_LOW is equivalent to +uvm_set_verbosity=*,_ALL_,UVM_LOW,build