Printing RAL MODEL

In reply to shreebamnikar:

Yes, provided you use field macros, see an example below:


   class vl_data extends uvm_reg;
      `uvm_object_utils(vl_data)

      rand uvm_reg_field data;
      // More code below
   endclass : vl_data
   //--------------------------------------------------------------------
   // vl_ctrl
   //--------------------------------------------------------------------
   class vl_ctrl extends uvm_reg;
      `uvm_object_utils(vl_ctrl)

      rand uvm_reg_field ctrl;
      // More code below
   endclass : vl_ctrl
   

task vlb_reg_model_test::main_phase(uvm_phase phase);
  int res;
  phase.raise_objection(this);
  `uvm_info(get_name(),
    $sformatf("Printing REG model "),UVM_LOW)
  this.vlb_reg_block_1 = vlb_reg_block::type_id::create("vlb_reg_block_1");
  this.vlb_reg_block_1.build();
  this.vlb_reg_block_1.print();


Output:


# : ------------------------------------------------------------------------
# : Name             Type           Size  Value                             
# : ------------------------------------------------------------------------
# : vlb_reg_block_1  vlb_reg_block  -     @818                              
# :   vl_data        vl_data        -     @820                              
# :     data         uvm_reg_field  ...    RW vl_data[31:0]=32'h00000000    
# :   vl_ctrl        vl_ctrl        -     @824                              
# :     ctrl         uvm_reg_field  ...    RW vl_ctrl[31:0]=32'h00000000    
# :   vl_volatile    vl_volatile    -     @828                              
# :     cntr         uvm_reg_field  ...    RO vl_volatile[31:0]=32'h00000000
# :   vlb_map        uvm_reg_map    -     @832                              
# :     endian                      ...   UVM_LITTLE_ENDIAN                 
# :     vl_data      vl_data        ...   @820 +'h8                         
# :     vl_ctrl      vl_ctrl        ...   @824 +'hc                         
# :     vl_volatile  vl_volatile    ...   @828 +'h4                         
# : ------------------------------------------------------------------------

HTH
Srini
www.go2uvm.org