Inheritance diagram for class svt_mem_word:
This class is used to represent a single word of data stored in memory. It is intended to be used to create a sparse array of stored memory data, with each element of the array representing a full data word in memory. The object is initilized with, and stores the information about the location (address space, and byte address) of the location represented. It supports read and write (with byte enables) operations, as well as lock/unlock operations.
Public Member Functions | |
| function bit [SVT_MEM_MAX_ADDR_WIDTH-1:0] | get_addr ( ) |
| function bit [SVT_MEM_MAX_ADDR_REGION_WIDTH-1:0] | get_addrspace ( ) |
| function string | get_word_content_str ( string prefix = "" ) |
| function string | get_word_value_str ( string prefix = "" ) |
| function bit | is_locked ( ) |
| function void | new ( bit [SVT_MEM_MAX_ADDR_REGION_WIDTH-1:0] addrspace, bit [SVT_MEM_MAX_ADDR_WIDTH-1:0] addr, bit [SVT_MEM_MAX_DATA_WIDTH-1:0] init_data = 'bx ) |
| function bit [(SVT_MEM_MAX_DATA_WIDTH-1):0] | read ( int set_lock = -1 ) |
| function bit | write ( bit [SVT_MEM_MAX_DATA_WIDTH-1:0] data, bit [SVT_MEM_MAX_DATA_WIDTH/8-1:0] byteen = ~0, int set_lock = -1 ) |
Public Attributes | |
|
||
Returns the byte-level address of this memory location.
Return values - The byte-level address of this data word. |
|
||
Returns the address space of this memory location.
Return values - The address space of this data word. |
|
||
Dumps the contents of this memory word object to a string which reports the Address Space, Address, Locked/Unlocked Status, and Data.
prefix - A user-defined string that precedes the object content string
Return values - A string representing the content of this memory word object. |
|
||
Returns the value of this memory location without the key prefixed (used by the UVM print routine).
|
|
||
Returns the locked/unlocked state of this memory location.
Return values - 1 if this memorly location is currently locked, or 0 if it is not. |
|
||
CONSTRUCTOR: Create a new instance of this class. This does not initialize any data within this class. It simply constructs the data word object, thereby preparing it for read/write operations.
addrspace - Identifies the address space within which this data word resides.
addr - Identifies the byte address (within the address space) at which this data word resides.
init_data - (Optional) Sets the stored data to a default initial value. |
|
||
Returns the value of the data word stored by this object.
set_lock - (Optional) If supplied as 1 (or any positive int), locks this memory location (preventing writes). If supplied as 0, unlocks this memory location (to allow writes). If not supplied (or supplied as any negative int) the locked/unlocked state of this memory location is not changed. |
|
||
Stores a data word into this object, with optional byte-enables.
data - The data word to be stored. If the memory location is currently locked, the attempted write will not change the stored data, and the function will return 0.
byteen - (Optional) The byte-enables to be applied to this write. A 1 in a given bit position enables the byte in the data word corresponding to that bit position.
set_lock - (Optional) If supplied as 1 (or any positive int), locks this memory location (preventing writes). If supplied as 0, unlocks this memory location (to allow writes). If not supplied (or supplied as any negative int) the locked/unlocked state of this memory location is not changed.
Return values - 1 if the write was successful, or 0 if it was not successful (because the memory location was locked). |