svt_mem_word Class Reference

Inheritance diagram for class svt_mem_word:

List of all members.


Detailed Description

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


Member Function Documentation

  function bit [SVT_MEM_MAX_ADDR_WIDTH-1:0]
 svt_mem_word::get_addr

 (   ) 


Returns the byte-level address of this memory location.

Return values - The byte-level address of this data word.

  function bit [SVT_MEM_MAX_ADDR_REGION_WIDTH-1:0]
 svt_mem_word::get_addrspace

 (   ) 


Returns the address space of this memory location.

Return values - The address space of this data word.

  function string
 svt_mem_word::get_word_content_str

 (  string prefix = ""  ) 


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.

  function string
 svt_mem_word::get_word_value_str

 (  string prefix = ""  ) 


Returns the value of this memory location without the key prefixed (used by the UVM print routine).

  function bit
 svt_mem_word::is_locked

 (   ) 


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.

  function void
 svt_mem_word::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  ) 


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.

  function bit [(SVT_MEM_MAX_DATA_WIDTH-1):0]
 svt_mem_word::read

 (  int set_lock = -1  ) 


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.

  function bit
 svt_mem_word::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  ) 


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).


Member Attribute Documentation