svt_mem_transaction Class Reference

Inheritance diagram for class svt_mem_transaction:

List of all members.


Detailed Description

This memory access transaction class is used as the request and response type between a memory driver and a memory sequencer.



Public Member Functions

virtual function vmm_data  allocate ( )
virtual function unsigned int  byte_pack ( ref logic [7:0] bytes[], input int unsigned offset, input int kind )
function unsigned int  byte_size ( int kind = -1 )
virtual function unsigned int  byte_unpack ( const ref logic [7:0] bytes[], input int unsigned offset, input int len, input int kind )
virtual function bit  compare ( vmm_data to, output string diff, input int kind )
virtual function vmm_data  copy ( vmm_data to = null )
function void  do_all ( vmm_data :: do_what_e do_what, ref logic [7:0] pack[], const ref logic [7:0] unpack[] )
function vmm_data  do_allocate ( )
function svt_pattern  do_allocate_pattern ( )
function unsigned int  do_byte_pack ( ref logic [7:0] bytes[], input int unsigned offset, input int kind = -1 )
function unsigned int  do_byte_unpack ( const ref logic [7:0] bytes[], input int unsigned offset, input int len, input int kind )
function bit  do_compare ( vmm_data to, output string diff, input int kind )
function bit  do_is_valid ( bit silent = 1, int kind = RELEVANT )
function string  get_mcd_class_name ( )
function void  get_phys_addr ( int burst_ix, ref int unsigned phys_addr[SVT_MEM_SA_CORE_PHYSICAL_DIMENSIONS_MAX] )
function bit  get_prop_val ( string prop_name, ref bit [1023:0] prop_val, input int array_ix, ref svt_data data_obj )
virtual function bit  is_valid ( bit silent = 1, int kind = -1 )
virtual function string  psdisplay ( string prefix = "" )
function int  reasonable_constraint_mode ( bit on_off )
function bit  set_prop_val ( string prop_name, bit [1023:0] prop_val, int array_ix )
function void  new ( vmm_log log = null, string suite_name = "" )

Public Attributes

rand svt_mem_addr_t  addr 
rand svt_mem_data_t  data [] 
rand bit  is_read 
int unsigned  phys_addr [SVT_MEM_SA_CORE_PHYSICAL_DIMENSIONS_MAX
rand svt_mem_data_t  valid [] 

Protected Attributes

static protected svt_mem_transaction  __vmm_rhs 

Constraints

constraint  mem_transaction_valid_ranges  ( )
constraint  reasonable_data_size  ( )


Member Function Documentation

 virtual function vmm_data
 svt_mem_transaction::allocate

 (   ) 


 Superseded functions 
 vmm_data :: allocate 
 svt_data :: allocate 
 svt_transaction :: allocate 

 virtual function unsigned int
 svt_mem_transaction::byte_pack

 (  ref logic [7:0] bytes [], input int unsigned offset , input int kind  ) 


 Superseded functions 
 vmm_data :: byte_pack 
 svt_data :: byte_pack 
 svt_transaction :: byte_pack 

  function unsigned int
 svt_mem_transaction::byte_size

 (  int kind = -1  ) 


Returns the size (in bytes) required by the byte_pack operation. If protocol defines physical representation for transaction then -1 kind does RELEVANT byte_size calculation. If not, -1 kind results in an error. svt_data :: COMPLETE always results in COMPLETE byte_size calculation.

 Superseded functions 
 vmm_data :: byte_size 
 svt_data :: byte_size 
 svt_transaction :: byte_size 

 virtual function unsigned int
 svt_mem_transaction::byte_unpack

 (  const ref logic [7:0] bytes [], input int unsigned offset , input int len , input int kind  ) 


 Superseded functions 
 vmm_data :: byte_unpack 
 svt_data :: byte_unpack 
 svt_transaction :: byte_unpack 

 virtual function bit
 svt_mem_transaction::compare

 (  vmm_data to , output string diff , input int kind  ) 


 Superseded functions 
 vmm_data :: compare 
 svt_data :: compare 
 svt_transaction :: compare 

 virtual function vmm_data
 svt_mem_transaction::copy

 (  vmm_data to = null  ) 


 Superseded functions 
 vmm_data :: copy 
 svt_data :: copy 
 svt_transaction :: copy 

  function void
 svt_mem_transaction::do_all

 (  vmm_data :: do_what_e do_what , ref logic [7:0] pack [], const ref logic [7:0] unpack []  ) 


 Superseded functions 
 vmm_data :: do_all 
 svt_data :: do_all 
 svt_transaction :: do_all 

  function vmm_data
 svt_mem_transaction::do_allocate

 (   ) 


Allocates a new object of type svt_mem_transaction.

 Superseded functions 
 vmm_data :: do_allocate 

  function svt_pattern
 svt_mem_transaction::do_allocate_pattern

 (   ) 


HDL Support: This method allocates a pattern containing svt_pattern_data instances for all of the primitive data fields in the object. The svt_pattern_data :: name is set to the corresponding field name, the svt_pattern_data :: value is set to 0.

Return values - An svt_pattern instance containing entries for all of the data fields.


 Superseded functions 
 svt_data :: do_allocate_pattern 
 svt_transaction :: do_allocate_pattern 

  function unsigned int
 svt_mem_transaction::do_byte_pack

 (  ref logic [7:0] bytes [], input int unsigned offset , input int kind = -1  ) 


Packs the object into the bytes buffer, beginning at offset. If protocol defines physical representation for transaction then -1 kind does RELEVANT byte_pack. If not, -1 kind results in an error. svt_data :: COMPLETE always results in COMPLETE byte_pack.

bytes - Buffer that will contain the packed bytes at the end of the operation.

offset - Offset into bytes where the packing is to begin.

kind - This int indicates the type of byte_pack being requested. Only supported kind value is svt_data :: COMPLETE, which results in all of the fields being packed and the return of an integer indicating the number of packed bytes. All other kind values result in no change to the buffer contents, and a return value of 0.


 Superseded functions 
 vmm_data :: do_byte_pack 
 svt_data :: do_byte_pack 
 svt_transaction :: do_byte_pack 

  function unsigned int
 svt_mem_transaction::do_byte_unpack

 (  const ref logic [7:0] bytes [], input int unsigned offset , input int len , input int kind  ) 


Unpacks the object from the bytes buffer, beginning at offset. If protocol defines physical representation for transaction then -1 kind does RELEVANT byte_unpack. If not, -1 kind results in an error. svt_data :: COMPLETE always results in COMPLETE byte_unpack.

bytes - Buffer containing the bytes to be unpacked.

offset - Offset into bytes where the unpacking is to begin.

len - Number of bytes to be unpacked.

kind - This int indicates the type of byte_unpack being requested. Only supported kind value is svt_data :: COMPLETE, which results in all of the fields being unpacked and the return of an integer indicating the number of unpacked bytes. All other kind values result in no change to the buffer contents, and a return value of 0.


 Superseded functions 
 vmm_data :: do_byte_unpack 
 svt_data :: do_byte_unpack 
 svt_transaction :: do_byte_unpack 

  function bit
 svt_mem_transaction::do_compare

 (  vmm_data to , output string diff , input int kind  ) 


Compares the object with to. Differences are placed in diff. Only supported kind values are -1 and svt_data :: COMPLETE. If protocol defines physical representation for transaction then -1 does RELEVANT compare. If not, -1 does COMPLETE (i.e., all fields checked) compare. svt_data :: COMPLETE always results in COMPLETE compare.

to - vmm_data object to be compared against.

diff - String indicating the differences between this and to.

kind - This int indicates the type of compare to be attempted. Only supported kind value is svt_data :: COMPLETE, which results in comparisons of the non-static data members. All other kind values result in a return value of 1.

The basic comparison function is implemented as follows: For a given bit position, If both sides have the corresponding valid bit set, the corresponding data bits are compared If both sides exist and only one side has valid bit set, it is considered a mismatch If both sides exist and no side has the valid bit set, it is considered a match If only one side exists, and if the valid bit is set, it is considered a mismatch If only one side exists, and if the valid bit is not set, it is considered a match


 Superseded functions 
 vmm_data :: do_compare 
 svt_data :: do_compare 
 svt_transaction :: do_compare 

  function bit
 svt_mem_transaction::do_is_valid

 (  bit silent = 1, int kind = RELEVANT  ) 


Checks to see that the data field values are valid, focusing mainly on checking/enforcing valid_ranges constraint. Only supported kind values are -1 and svt_data :: COMPLETE. If protocol defines physical representation for transaction then -1 does RELEVANT is_valid. If not, -1 does COMPLETE (i.e., all fields checked) is_valid. svt_data :: COMPLETE always results in COMPLETE is_valid.

 Superseded functions 
 vmm_data :: do_is_valid 
 svt_data :: do_is_valid 
 svt_transaction :: do_is_valid 

  function string
 svt_mem_transaction::get_mcd_class_name

 (   ) 


Returns the class name for the object used for logging.

 Superseded functions 
 svt_data :: get_mcd_class_name 

  function void
 svt_mem_transaction::get_phys_addr

 (  int burst_ix , ref int unsigned phys_addr [SVT_MEM_SA_CORE_PHYSICAL_DIMENSIONS_MAX]  ) 


Method used to obtain the physical address for a specific beat within a burst.

burst_ix - Desired beat within the burst.

Return values - The physical address for the indicated burst_ix.

  function bit
 svt_mem_transaction::get_prop_val

 (  string prop_name , ref bit [1023:0] prop_val , input int array_ix , ref svt_data data_obj  ) 


HDL Support: For read access to public data members of this class.

 Superseded functions 
 svt_data :: get_prop_val 
 svt_transaction :: get_prop_val 

 virtual function bit
 svt_mem_transaction::is_valid

 (  bit silent = 1, int kind = -1  ) 


 Superseded functions 
 vmm_data :: is_valid 
 svt_data :: is_valid 
 svt_transaction :: is_valid 

 virtual function string
 svt_mem_transaction::psdisplay

 (  string prefix = ""  ) 


 Superseded functions 
 vmm_data :: psdisplay 
 svt_data :: psdisplay 
 svt_transaction :: psdisplay 

  function int
 svt_mem_transaction::reasonable_constraint_mode

 (  bit on_off  ) 


Method to turn reasonable constraints on/off as a block.

 Superseded functions 
 svt_data :: reasonable_constraint_mode 

  function bit
 svt_mem_transaction::set_prop_val

 (  string prop_name , bit [1023:0] prop_val , int array_ix  ) 


HDL Support: For write access to public data members of this class.

 Superseded functions 
 svt_data :: set_prop_val 
 svt_transaction :: set_prop_val 

  function void
 svt_mem_transaction::new

 (  vmm_log log = null, string suite_name = ""  ) 


CONSTRUCTOR: Create a new transaction instance, passing the appropriate argument values to the vmm_data parent class.

log - Sets the log file that is used for status output.

suite_name - A String that identifies the product suite to which the transaction object belongs.


 Superseded functions 
 svt_data :: new 
 svt_transaction :: new 


Member Attribute Documentation

 rand svt_mem_addr_t  attribute
 svt_mem_transaction::addr


The base address of the memory burst operation, using byte-level granularity. How that base address is interpreted for the remainder of the data burst depends on the component or transactor fulfilling the transaction.

 rand svt_mem_data_t  attribute
 svt_mem_transaction::data[]


Burst of data to be written or that has been read. The length of the array specifies the length of the burst. The bits that are valid in each array element is indicated by the corresponding element in the 'valid' array

 rand bit  attribute
 svt_mem_transaction::is_read


Indicates if the memory transaction is a READ or WRITE operation. When set, indicates a READ operation.

 int unsigned  attribute
 svt_mem_transaction::phys_addr[SVT_MEM_SA_CORE_PHYSICAL_DIMENSIONS_MAX]


Values representing the base physical address for the transaction. These values must be assigned in order to enable recording of the physical address.

Actual production of physical addresses for communication with the memory are done through the get_phys_addr method.

 rand svt_mem_data_t  attribute
 svt_mem_transaction::valid[]


Indicates which bits in corresponding 'data' array element are valid. The size of this array must be either 0 or equal to the size of the 'data' array. A size of 0 implies all data bits are valid. Defaults to size == 0.

 static protected svt_mem_transaction  attribute
 svt_mem_transaction::__vmm_rhs


Member Constraint Documentation

  constraint
 svt_mem_transaction::mem_transaction_valid_ranges


constraint mem_transaction_valid_ranges {
    data.size() == valid.size();
  }

  constraint
 svt_mem_transaction::reasonable_data_size


constraint reasonable_data_size {
    data.size() <= 1024;
    data.size() > 0;
  }