Skip to content

UVM Model Output

Scott Nellenbach edited this page Nov 8, 2018 · 14 revisions

Ordt will generate a UVM register abstraction layer model (uvm_reg) from a register definition input if the -uvmregs parameter is included in the ordt command. An output file containing design-specific block, and register class definitions will be created and will reference a systemverilog package of design-independent classes derived from uvm_reg base classes. The design-independent package can be optionally generated using the –uvmregspkg parameter.

UVM model derived classes

Ordt creates a number of uvm_reg derived classes. By default (uvm_model_mode=heavy), the following design-independent uvm classes are generated and included in the ordt package:

In addition, design dependent classes are generated for registers and register sets:

  • Design specific register classes extend uvm_reg_rdl or uvm_vreg_rdl
  • Design specific block (register set/regfile/addrmap) classes extend uvm_reg_block_rdl

Field methods in the UVM model

Ordt generates several field classes derived from uvm_reg_field that contain properties specified in the rdl input. This allows verification benches to access the model info for automated testing of these field types. If ordt generates the register rtl in addition to the uvm model, backdoor paths to registers and register I/O nets (eg counter increment signals) will be accessible in the model. Note that the hw paths in the uvm model assume the auto-generated RTL IO names are not overridden by the rdl (eg, through use of user-defined signals).

Test control properties in the UVM model

Ordt adds a number of rdl/jspec properties to the uvm model for test control. At the uvm_reg_rdl level, these include:

  • don't test property – intent to disable all tests of this register
  • don't compare property – intent to disable checking of read data for this register
  • jspec category – register classification

At the uvm_reg_field_rdl level, the following test control properties are accessible:

  • don't compare property -> intent to disable checking of read data for this register
  • jspec sub_category – field/interrupt classification

The volatile bit will be set at uvm_reg_field level under the following conditions:

  • A field is determined to be hw writeable or modified by hw
  • The don't compare property is set foe this field

Memories in the UVM model

The uvmreg_is_mem property can be used to designate a replicated register as a uvm_mem to save memory space required to model large memories. If so designated, the register will be modeled as a uvm_mem with replicated virtual registers (uvm_vreg_rdl) rather than multiple uvm_regs. Note that use of virtual registers is a modeling construct, but has no direct correlation to physical implementation of on-chip memory.

To assist verification of virtual registers, an associative array of data values is added to uvm_vreg_rdl. This staged data array allows a very lightweight version of the mirroring supported in uvm_reg. Methods also handle bit shifting involved in setting or retrieving field values from a virtual register.

Modeling of register arrays in the model will vary depending on various parameter settings as follows (R=number of registers in array, F=number of fields in register):

uvm_model_mode uvm_mem? uvm_mem_strategy reg read form reg api reg array size
lite1 no n/a path.regname[idx].read(..) uvm_reg R*uvm_reg + R*uvm_field
lite1 yes basic path.regname.read(idx,..) uvm_vreg 1*uvm_vreg + 1*uvm_mem
lite1 yes block_wrapped path.regname.vregs.read(idx,..) uvm_vreg 1*uvm_vreg + 1*uvm_mem
native no n/a path.regname[idx].read(..) uvm_reg R*uvm_reg + R*F*uvm_field
native yes basic path.regname.read(idx,..) uvm_vreg 1*uvm_vreg + 1*uvm_mem
native yes block_wrapped path.regname.vregs.read(idx,..) uvm_vreg 1*uvm_vreg + 1*uvm_mem
heavy no n/a path.regname[idx].read(..) uvm_reg_rdl R*uvm_reg_rdl + R*F*uvm_field_rdl
heavy yes basic path.regname.read(idx,..) uvm_vreg_rdl 1*uvm_vreg_rdl + 1*uvm_mem
heavy yes block_wrapped path.regname.vregs.read(idx,..) uvm_vreg_rdl 1*uvm_vreg_rdl + 1*uvm_mem
heavy yes mimic_reg_api path.regname[idx].read(..) uvm_reg_mimic R*uvm_reg_mimic + 1*uvm_vreg_rdl + 1*uvm_mem

UVM address coverpoints

UVM_CVR_ADDR_MAP coverpoints are added to the model if the include_address_coverage ordt control parameter is specified.

Interrupts in the UVM model

Simple interrupt trees can be modeled in uvm output. Typically, this is specified in rdl by assigning the intr or halt output of an interrupt register to the next value of a field in an interrupt merge register. In the generated uvm model, interrupt fields representing the interrupt merge value will contain a reference to the driving child interrupt register. This allows interrupt (and halt) trees to be walked in the model for creation of interrupt handling routines, etc. SystemRDL interrupt mask/enable structure is also supported in the model for cases where the mask/enable is defined to be a field. Methods are provided to return the enabled/masked value of an interrupt field.

Callbacks in the UVM model

In addition to the basic register functions modeled in the uvm ral, the uvm model generated by ordt includes callback support for modeling a subset of rdl-specified features:

  • alias registers (multiple external addresses accessing the same physical register with different sw access policies)
  • Interrupt fields affected by values of enable/mask fields via the maskintrbits property

Native UVM model

If the uvmregs output parameter uvm_model_mode is set to native, a UVM model (including package) will be generated that omits all rdl property extensions, interrupt/counter info, and callbacks. Intent of this model is to reduce the model memory footprint where only a basic api is required. The native model uses vanilla UVM register abstraction layer classes rather than the derived *_rdl classes used in the default heavy model.

The following design-independent uvm classes are generated and included in the lightweight ordt package:

  • Blocks/register sets: uses native uvm_reg_block
  • Registers: uses native uvm_reg
  • Virtual registers: uses native uvm_vreg
  • Fields: uses native uvm_reg_field

In addition, design dependent classes are generated for registers and register sets:

  • Design specific register classes extend uvm_reg or uvm_vreg
  • Design specific block (register set/regfile/addrmap) classes extend uvm_reg_block

Lightweight UVM model

If the uvmregs output parameter uvm_model_mode is set to lite1, an alternate UVM model (including package) will be generated that omits all rdl extensions similar to the native model, but further reduces the per-register data stored. Intent of this model is to reduce the model memory footprint where only a basic api is required (primarily register level read/write, though field get/set are possible with restrictions). A single hidden uvm_reg_field is provided per register, and the uvm_reg_field get/set api is accessible through a uvm_field_lite class.

The following design-independent uvm classes are generated and included in the lightweight ordt package:

  • Blocks/register sets: N/A (uses native uvm_reg_block)
  • Registers: uvm_reg_lite (no user-visible methods) extends uvm_reg
  • Virtual registers: N/A (uses native uvm_vreg)
  • Fields: uvm_field_lite (non uvm_reg class containing only field bit location/size info)

In addition, design dependent classes are generated for registers and register sets:

  • Design specific register classes extend uvm_reg_lite or uvm_vreg
  • Design specific block (register set/regfile/addrmap) classes extend uvm_reg_block
Clone this wiki locally