Printing RAL MODEL

How to print RAL model with details?

In reply to shreebamnikar:

What kind of details do you mean?
Normally you have all the details in your register spec. And you use the spec for generating the RAL model.

In reply to shreebamnikar:

First try would be ral_model.print();

This would print all details that have been provided via field utils

You need to explain more on what details you are looking for to seek more help.

Srini
www.go2uvm.org

In reply to chr_sue:

like a tb topology printing can we print register names , its fields ,size,base address,offset address, reg map of a register map in detailed hierarchical way ?

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

In reply to shreebamnikar:

Thanks srini

Here what is value field and based on what it comes/prints like @820, @820 + 'h8,etc what does it means ?