Class uvm_reg_map
- uvm_pkg :: uvm_void
Address map abstraction class
Constructors
Functions
- static function uvm_reg_map backdoor ( ) [source]
Return the backdoor pseudo-map singleton
This pseudo-map is used to specify or configure the backdoor instead of a real address map.
- function void configure ( uvm_reg_block parent, uvm_reg_addr_t base_addr, int unsigned n_bytes, uvm_endianness_e endian, bit byte_addressing ) [source]
Instance-specific configuration
Configures this map with the following properties.
parent
the block in which this map is created and applied
base_addr
the base address for this map. All registers, memories, and sub-blocks will be at offsets to this address
n_bytes
the byte-width of the bus on which this map is used
endian
the endian format. See uvm_endianness_e for possible values
byte_addressing
specifies whether the address increment is on a per-byte basis. For example, consecutive memory locations with n_bytes =4 (32-bit bus) are 4 apart: 0, 4, 8, and so on. Default is TRUE. Configure
- virtual function void add_reg ( uvm_reg rg, uvm_reg_addr_t offset, string rights, bit unmapped, uvm_reg_frontdoor frontdoor ) [source]
Add a register
Add the specified register instance rg to this address map.
The register is located at the specified address offset from this maps configured base address.
The rights specify the register's accessibility via this map. Valid values are "RW", "RO", and "WO". Whether a register field can be read or written depends on both the field's configured access policy (see uvm_reg_field::configure and the register's rights in the map being used to access the field.
The number of consecutive physical addresses occupied by the register depends on the width of the register and the number of bytes in the physical interface corresponding to this address map.
If unmapped is TRUE, the register does not occupy any physical addresses and the base address is ignored. Unmapped registers require a user-defined frontdoor to be specified.
A register may be added to multiple address maps if it is accessible from multiple physical interfaces. A register may only be added to an address map whose parent block is the same as the register's parent block. Add_reg
- virtual function void add_mem ( uvm_mem mem, uvm_reg_addr_t offset, string rights, bit unmapped, uvm_reg_frontdoor frontdoor ) [source]
Add a memory
Add the specified memory instance to this address map. The memory is located at the specified base address and has the specified access rights ("RW", "RO" or "WO"). The number of consecutive physical addresses occupied by the memory depends on the width and size of the memory and the number of bytes in the physical interface corresponding to this address map.
If unmapped is TRUE, the memory does not occupy any physical addresses and the base address is ignored. Unmapped memories require a user-defined frontdoor to be specified.
A memory may be added to multiple address maps if it is accessible from multiple physical interfaces. A memory may only be added to an address map whose parent block is the same as the memory's parent block. Add_mem
- virtual function void add_submap ( uvm_reg_map child_map, uvm_reg_addr_t offset ) [source]
Add an address map
Add the specified address map instance to this address map. The address map is located at the specified base address. The number of consecutive physical addresses occupied by the submap depends on the number of bytes in the physical interface that corresponds to the submap, the number of addresses used in the submap and the number of bytes in the physical interface corresponding to this address map.
An address map may be added to multiple address maps if it is accessible from multiple physical interfaces. An address map may only be added to an address map in the grand-parent block of the address submap. Add_submap
- virtual function void set_sequencer ( uvm_sequencer_base sequencer, uvm_reg_adapter adapter ) [source]
Set the sequencer and adapter associated with this map. This method must be called before starting any sequences based on uvm_reg_sequence. Set_sequencer
- virtual function void set_submap_offset ( uvm_reg_map submap, uvm_reg_addr_t offset ) [source]
Set the offset of the given submap to offset . Set_submap_offset
- virtual function uvm_reg_addr_t get_submap_offset ( uvm_reg_map submap ) [source]
Return the offset of the given submap . Get_submap_offset
- virtual function void set_base_addr ( uvm_reg_addr_t offset ) [source]
Set the base address of this map. Set_base_addr
- virtual function void reset ( string kind ) [source]
Reset the mirror for all registers in this address map.
Sets the mirror value of all registers in this address map and all of its submaps to the reset value corresponding to the specified reset event. See uvm_reg_field::reset() for more details. Does not actually set the value of the registers in the design, only the values mirrored in their corresponding mirror.
Note that, unlike the other reset() method, the default reset event for this method is "SOFT". Reset
- virtual function void add_parent_map ( uvm_reg_map parent_map, uvm_reg_addr_t offset ) [source]
Add_parent_map
- virtual function uvm_reg_map get_root_map ( ) [source]
Get the externally-visible address map
Get the top-most address map where this address map is instantiated. It corresponds to the externally-visible address map that can be accessed by the verification environment. Get_root_map
- virtual function uvm_reg_block get_parent ( ) [source]
Get the parent block
Return the block that is the parent of this address map. Get_parent
- virtual function uvm_reg_map get_parent_map ( ) [source]
Get the higher-level address map
Return the address map in which this address map is mapped. returns null if this is a top-level address map. Get_parent_map
- virtual function uvm_reg_addr_t get_base_addr ( uvm_hier_e hier ) [source]
Get the base offset address for this map. If this map is the root map, the base address is that set with the base_addr argument to uvm_reg_block::create_map(). If this map is a submap of a higher-level map, the base address is offset given this submap by the parent map. See set_submap_offset. Get_base_addr
- virtual function int unsigned get_n_bytes ( uvm_hier_e hier ) [source]
Get the width in bytes of the bus associated with this map. If hier is UVM_HIER , then gets the effective bus width relative to the system level. The effective bus width is the narrowest bus width from this map to the top-level root map. Each bus access will be limited to this bus width. Get_n_bytes
- virtual function int unsigned get_addr_unit_bytes ( ) [source]
Get the number of bytes in the smallest addressable unit in the map. Returns 1 if the address map was configured using byte-level addressing. Returns get_n_bytes() otherwise. Get_addr_unit_bytes
- virtual function uvm_endianness_e get_endian ( uvm_hier_e hier ) [source]
Function
get_base_addr
Gets the endianness of the bus associated with this map. If hier is set to UVM_HIER , gets the system-level endianness. Get_endian
- virtual function uvm_sequencer_base get_sequencer ( uvm_hier_e hier ) [source]
Gets the sequencer for the bus associated with this map. If hier is set to UVM_HIER , gets the sequencer for the bus at the system-level. See set_sequencer. Get_sequencer
- virtual function uvm_reg_adapter get_adapter ( uvm_hier_e hier ) [source]
Gets the bus adapter for the bus associated with this map. If hier is set to UVM_HIER , gets the adapter for the bus used at the system-level. See set_sequencer. Get_adapter
- virtual function void get_submaps ( uvm_reg_map maps, uvm_hier_e hier ) [source]
Get the address sub-maps
Get the address maps instantiated in this address map. If hier is UVM_HIER , recursively includes the address maps, in the sub-maps. Get_submaps
- virtual function void get_registers ( uvm_reg regs, uvm_hier_e hier ) [source]
Get the registers
Get the registers instantiated in this address map. If hier is UVM_HIER , recursively includes the registers in the sub-maps. Get_registers
- virtual function void get_fields ( uvm_reg_field fields, uvm_hier_e hier ) [source]
Get the fields
Get the fields in the registers instantiated in this address map. If hier is UVM_HIER , recursively includes the fields of the registers in the sub-maps. Get_fields
- virtual function void get_memories ( uvm_mem mems, uvm_hier_e hier ) [source]
Get the memories
Get the memories instantiated in this address map. If hier is UVM_HIER , recursively includes the memories in the sub-maps. Get_memories
- virtual function void get_virtual_registers ( uvm_vreg regs, uvm_hier_e hier ) [source]
Get the virtual registers
Get the virtual registers instantiated in this address map. If hier is UVM_HIER , recursively includes the virtual registers in the sub-maps. Get_virtual_registers
- virtual function void get_virtual_fields ( uvm_vreg_field fields, uvm_hier_e hier ) [source]
Get the virtual fields
Get the virtual fields from the virtual registers instantiated in this address map. If hier is UVM_HIER , recursively includes the virtual fields in the virtual registers in the sub-maps. Get_virtual_fields
- virtual function uvm_reg_map_info get_reg_map_info ( uvm_reg rg, bit error ) [source]
Get_reg_map_info
- virtual function uvm_reg_map_info get_mem_map_info ( uvm_mem mem, bit error ) [source]
Get_mem_map_info
- virtual function int get_physical_addresses ( uvm_reg_addr_t base_addr, uvm_reg_addr_t mem_offset, int unsigned n_bytes, uvm_reg_addr_t addr ) [source]
Translate a local address into external addresses
Identify the sequence of addresses that must be accessed physically to access the specified number of bytes at the specified address within this address map. Returns the number of bytes of valid data in each access.
Returns in addr a list of address in little endian order, with the granularity of the top-level address map.
A register is specified using a base address with mem_offset as 0. A location within a memory is specified using the base address of the memory and the index of the location within that memory. Get_physical_addresses
- virtual function uvm_reg get_reg_by_offset ( uvm_reg_addr_t offset, bit read ) [source]
Get register mapped at offset
Identify the register located at the specified offset within this address map for the specified type of access. Returns null if no such register is found.
The model must be locked using uvm_reg_block::lock_model() to enable this functionality. Get_reg_by_offset
- virtual function uvm_mem get_mem_by_offset ( uvm_reg_addr_t offset ) [source]
Get memory mapped at offset
Identify the memory located at the specified offset within this address map. The offset may refer to any memory location in that memory. Returns null if no such memory is found.
The model must be locked using uvm_reg_block::lock_model() to enable this functionality. Get_mem_by_offset
- function void set_auto_predict ( bit on ) [source]
Sets the auto-predict mode for his map.
When on is TRUE , the register model will automatically update its mirror (what it thinks should be in the DUT) immediately after any bus read or write operation via this map. Before a uvm_reg::write or uvm_reg::read operation returns, the register's uvm_reg::predict method is called to update the mirrored value in the register.
When on is FALSE , bus reads and writes via this map do not automatically update the mirror. For real-time updates to the mirror in this mode, you connect a uvm_reg_predictor instance to the bus monitor. The predictor takes observed bus transactions from the bus monitor, looks up the associated uvm_reg register given the address, then calls that register's uvm_reg::predict method. While more complex, this mode will capture all register read/write activity, including that not directly descendant from calls to uvm_reg::write and uvm_reg::read.
By default, auto-prediction is turned off.
- function void set_check_on_read ( bit on ) [source]
Sets the check-on-read mode for his map and all of its submaps.
When on is TRUE , the register model will automatically check any value read back from a register or field against the current value in its mirror and report any discrepancy. This effectively combines the functionality of the uvm_reg::read() and uvm_reg::mirror(UVM_CHECK) method. This mode is useful when the register model is used passively.
When on is FALSE , no check is made against the mirrored value.
At the end of the read operation, the mirror value is updated based on the value that was read regardless of this mode setting.
By default, auto-prediction is turned off.
- function void Xget_bus_infoX ( uvm_reg_item rw, uvm_reg_map_info map_info, int size, int lsb, int addr_skip ) [source]
Bus Access
- virtual function uvm_object clone ( ) [source]
Clone
- virtual function void do_print ( uvm_printer printer ) [source]
Do_print
- virtual function void do_copy ( uvm_object rhs ) [source]
Do_copy
- function void set_transaction_order_policy ( uvm_reg_transaction_order_policy pol ) [source]
set the transaction order policy
- function uvm_reg_transaction_order_policy get_transaction_order_policy ( ) [source]
set the transaction order policy
Tasks
- virtual function do_bus_write ( uvm_reg_item rw, uvm_sequencer_base sequencer, uvm_reg_adapter adapter ) [source]
Perform a bus write operation. Do_bus_write
- virtual function do_bus_read ( uvm_reg_item rw, uvm_sequencer_base sequencer, uvm_reg_adapter adapter ) [source]
Perform a bus read operation. Do_bus_read
- virtual function do_write ( uvm_reg_item rw ) [source]
Perform a write operation. Do_write(uvm_reg_item rw)
- virtual function do_read ( uvm_reg_item rw ) [source]
Perform a read operation. Do_read(uvm_reg_item rw)
This class represents an address map. An address map is a collection of registers and memories accessible via a specific physical interface. Address maps can be composed into higher-level address maps.
Address maps are created using the uvm_reg_block::create_map() method.