svt_fifo_rate_control Class Reference

Inheritance diagram for class svt_fifo_rate_control:

List of all members.


Detailed Description

Utility class which may be used by agents to model a FIFO based resource class to control the rate at which transactions are sent from a component



Public Member Functions

function unsigned int  byte_size ( int kind = -1 )
function bit  check_fifo_fill_level ( svt_transaction xact, int num_bytes )
function svt_pattern  do_allocate_pattern ( )
function unsigned int  do_byte_pack ( ref logic [7:0] bytes[], input int unsigned offset, input int kind )
function unsigned int  do_byte_unpack ( const ref logic [7:0] bytes[], input int unsigned offset, input int len, input int kind )
function vmm_data  do_copy ( vmm_data to = null )
function string  get_mcd_class_name ( )
function bit  get_prop_val ( string prop_name, ref bit [1023:0] prop_val, input int array_ix, ref svt_data data_obj )
function void  new ( vmm_log log = null, string suite_name = "" )
function int  reasonable_constraint_mode ( bit on_off )
function void  reset_all ( )
function void  reset_curr_fill_level ( )
function void  reset_sema ( )
function bit  set_prop_val ( string prop_name, bit [1023:0] prop_val, int array_ix )
function void  update_fifo_levels_every_clock ( )
task   update_fifo_levels_on_data_xmit ( svt_transaction xact, int num_bytes )
task   update_total_expected_fill_levels ( svt_transaction xact, svt_fifo_rate_control :: fifo_mode_enum mode = svt_fifo_rate_control::FIFO_ADD_TO_ACTIVE, int num_bytes )
task   wait_for_fifo_full ( int num_bytes )

Public Attributes

svt_fifo_rate_control_configuration  fifo_cfg 
int  fifo_curr_fill_level = 0; 
int  total_expected_fill_level = 0; 

Protected Attributes

protected semaphore  fifo_sema 

Member Typedefs

 typedef enum  fifo_mode_enum 


Member Function Documentation

  function unsigned int
 svt_fifo_rate_control::byte_size

 (  int kind = -1  ) 


Returns the size (in bytes) required by the byte_pack operation. Only supports COMPLETE pack so kind must be svt_data :: COMPLETE.

 Superseded functions 
 vmm_data :: byte_size 
 svt_data :: byte_size 

  function bit
 svt_fifo_rate_control::check_fifo_fill_level

 (  svt_transaction xact , int num_bytes  ) 

  function svt_pattern
 svt_fifo_rate_control::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 

  function unsigned int
 svt_fifo_rate_control::do_byte_pack

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


Packs the object into the bytes buffer, beginning at offset. Only supports COMPLETE pack so kind must be svt_data :: COMPLETE.

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 

  function unsigned int
 svt_fifo_rate_control::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. Only supports COMPLETE unpack so kind must be svt_data :: COMPLETE.

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 

  function vmm_data
 svt_fifo_rate_control::do_copy

 (  vmm_data to = null  ) 


Extend the copy method to copy the transaction class fields.

to - Destination class for the copy operation


 Superseded functions 
 vmm_data :: do_copy 
 svt_data :: do_copy 

  function string
 svt_fifo_rate_control::get_mcd_class_name

 (   ) 


Returns the class name for the object used for logging.

 Superseded functions 
 svt_data :: get_mcd_class_name 

  function bit
 svt_fifo_rate_control::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 

  function void
 svt_fifo_rate_control::new

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


CONSTRUCTOR: Create a new configuration 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 configuration object belongs.


 Superseded functions 
 svt_data :: new 

  function int
 svt_fifo_rate_control::reasonable_constraint_mode

 (  bit on_off  ) 


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

 Superseded functions 
 svt_data :: reasonable_constraint_mode 

  function void
 svt_fifo_rate_control::reset_all

 (   ) 


Resets current and expected fill level and semaphore

  function void
 svt_fifo_rate_control::reset_curr_fill_level

 (   ) 


Resets the current fill level

  function void
 svt_fifo_rate_control::reset_sema

 (   ) 


Resets the semaphore

  function bit
 svt_fifo_rate_control::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 

  function void
 svt_fifo_rate_control::update_fifo_levels_every_clock

 (   ) 


Updates FIFO levels every clock. Must be implemented in an extended class

  task
 svt_fifo_rate_control::update_fifo_levels_on_data_xmit

 (  svt_transaction xact , int num_bytes  ) 


Decrements FIFO levels by num_bytes

xact - Handle to the transaction based on which the update is made.

num_bytes - Number of bytes to be decremented from the current FIFO level.

  task
 svt_fifo_rate_control::update_total_expected_fill_levels

 (  svt_transaction xact , svt_fifo_rate_control :: fifo_mode_enum mode = svt_fifo_rate_control::FIFO_ADD_TO_ACTIVE, int num_bytes  ) 


Updates total_expected_fill_level based on num_bytes

xact - Handle to the transaction based on which the update is made.

mode - Indicates the mode in which this task is called. If the value passed is 'add_to_active', num_bytes are added to the total_expected_fill_level. If the value passed is 'remove_from_active', num_bytes are decremented from total_expected_fill_level.

num_bytes - Number of bytes to be incremented or decremented from the total_expected_fill_level.

  task
 svt_fifo_rate_control::wait_for_fifo_full

 (  int num_bytes  ) 


Waits for the FIFO to be full after taking num_bytes into account

num_bytes - The number of bytes to be added to the current fifo level before checking whether FIFO is full or not.


Member Attribute Documentation

 svt_fifo_rate_control_configuration  attribute
 svt_fifo_rate_control::fifo_cfg


FIFO rate control configuration corresponding to this class

 int  attribute
 svt_fifo_rate_control::fifo_curr_fill_level = 0


The current fill level of the FIFO

 protected semaphore  attribute
 svt_fifo_rate_control::fifo_sema


Semaphore used to access the FIFO

 int  attribute
 svt_fifo_rate_control::total_expected_fill_level = 0


The total expected fill level

Member Typedef Documentation

 typedef enum  svt_fifo_rate_control::fifo_mode_enum
FIFO_ADD_TO_ACTIVE(SVT_FIFO_ADD_TO_ACTIVE)
FIFO_REMOVE_FROM_ACTIVE(SVT_FIFO_REMOVE_FROM_ACTIVE)