svt_configuration Class Reference

Inheritance diagram for class svt_configuration:

List of all members.


Detailed Description

Base class for all SVT model configuration data descriptor objects. As functionality commonly needed for configuration of SVT models is defined, it will be implemented (or at least prototyped) in this class.



Public Member Functions

function svt_pattern  allocate_check_enable_pattern ( )
function svt_pattern  allocate_cov_enable_pattern ( )
function svt_pattern  allocate_debug_feature_pattern ( )
function svt_pattern  allocate_dynamic_pattern ( )
function svt_pattern  allocate_pa_feature_pattern ( )
function svt_pattern  allocate_static_pattern ( )
function void  check_packer_max_bytes ( )
function void  copy_dynamic_data ( uvm_sequence_item to )
function void  copy_static_data ( uvm_sequence_item to )
function bit  decode_prop_val ( string prop_name, bit [1023:0] prop_val, ref string prop_val_string, input svt_pattern_data :: type_enum typ )
function svt_pattern  do_allocate_pattern ( )
function void  do_copy ( uvm_object rhs )
function void  do_pack ( uvm_packer packer )
function void  do_unpack ( uvm_packer packer )
function void  enable_cov_options ( )
function void  enable_debug_options ( string inst, string path = "" )
function void  enable_pa_options ( bit enable_debug_opts = 0 )
function void  find_sub_configurations ( ref svt_configuration sub_cfgs[string] )
function bit  get_check_prop_val ( )
function bit  get_cov_prop_val ( )
function int  get_packer_max_bytes_required ( )
function bit  get_prop_val ( string prop_name, ref bit [1023:0] prop_val, input int array_ix, ref svt_sequence_item_base data_obj )
function bit  is_pa_enabled ( )
function void  new ( string name = "svt_configuration_inst", string suite_name = "" )
function void  record_cfg_info ( string inst_name )
function bit  set_prop_val ( string prop_name, bit [1023:0] prop_val, int array_ix )
function void  setup_cov_plusarg ( )
function void  setup_pa_plusarg ( )
function int  static_rand_mode ( bit on_off )

Public Attributes

bit  enable_runtime_trace_recording = 0; 
bit  enable_signal_callbacks = 0; 
bit  enable_sled = 0; 
string  filter_psdisplay_short [$] 
string  inst = SVT_UNSET_INST_NAME


Member Function Documentation

  function svt_pattern
 svt_configuration::allocate_check_enable_pattern

 (   ) 


This method allocates a pattern containing svt_pattern_data instances for all of the data fields in the object that are related to enabling coverage.

Regular expressions are used to identify checks which will be enabled. If these expressions identify properties that should not be enabled for checks, or if there are properties that are missed by these expressions then this method can be extended and the pattern can be altered.

Return values - An svt_pattern instance containing entries for all of the fields related to enabling coverage.

  function svt_pattern
 svt_configuration::allocate_cov_enable_pattern

 (   ) 


This method allocates a pattern containing svt_pattern_data instances for all of the data fields in the object that are related to enabling coverage.

Regular expressions are used to identify coverage which will be enabled. If these expressions identify properties that should not be enabled for coverage, or if there are properties that are missed by these expressions then this method can be extended and the pattern can be altered.

Return values - An svt_pattern instance containing entries for all of the fields related to enabling coverage.

  function svt_pattern
 svt_configuration::allocate_debug_feature_pattern

 (   ) 


This method allocates a pattern containing svt_pattern_data instances for all of the data fields in the object that are related to debug.

Regular expressions are used to identify debug features that will be enabled. If these expressions identify properties that should not be enabled for debug, or if there are properties that are missed by these expressions then this method can be extended and the pattern can be altered.

Return values - An svt_pattern instance containing entries for all of the fields related to debug

  function svt_pattern
 svt_configuration::allocate_dynamic_pattern

 (   ) 


This method allocates the same pattern as allocate_pattern, minus the elements which do not include the "dynamic" keyword.

Return values - An svt_pattern instance containing entries for the data fields which include the "dynamic" keyword.

  function svt_pattern
 svt_configuration::allocate_pa_feature_pattern

 (   ) 


This method allocates a pattern containing svt_pattern_data instances for all of the data fields in the object that are related to PA.

Regular expressions are used to identify PA features that will be enabled. If these expressions identify properties that should not be enabled for PA, or if there are properties that are missed by these expressions then this method can be extended and the pattern can be altered.

Return values - An svt_pattern instance containing entries for all of the fields related to PA.

  function svt_pattern
 svt_configuration::allocate_static_pattern

 (   ) 


This method allocates the same pattern as allocate_pattern, minus the elements which include the "dynamic" keyword.

Return values - An svt_pattern instance containing entries for the data fields which do not include the "dynamic" keyword.

  function void
 svt_configuration::check_packer_max_bytes

 (   ) 


This method checks the packer max bytes value required by the suite. This involves checking the value provided by get_packer_max_bytes_required against `SVT_XVM_UC(MAX_PACKER_BYTES). It also includes checking `SVT_XVM_UC(MAX_PACKER_BYTES) against the `SVT_XVM(pack_bitstream_t) size to make sure that the define is consistent with the buffer storage which has been allocated.

If the user is using multi-step compilation and has failed to specify `SVT_XVM_UC(PACKER_MAX_BYTES) on the command line then it can lead to a compile time failure about an unrecognized macro. This method isprovided in unencrypted form to simplify the recognition of this situation. This situation can be resolved by adding an appropriate `SVT_XVM_UC(MAX_PACKER_BYTES) value on the appropriate command line.

  function void
 svt_configuration::copy_dynamic_data

 (  uvm_sequence_item to  ) 


Used to limit a copy to the dynamic data members of the object.

 Superseding functions 
 svt_fifo_rate_control_configuration :: copy_dynamic_data 
 svt_mem_configuration :: copy_dynamic_data 
 svt_base_mem_suite_configuration :: copy_dynamic_data 
 svt_mem_suite_configuration :: copy_dynamic_data 

  function void
 svt_configuration::copy_static_data

 (  uvm_sequence_item to  ) 


Used to limit a copy to the static data members of the object.

 Superseding functions 
 svt_fifo_rate_control_configuration :: copy_static_data 
 svt_mem_configuration :: copy_static_data 
 svt_base_mem_suite_configuration :: copy_static_data 
 svt_mem_suite_configuration :: copy_static_data 

  function bit
 svt_configuration::decode_prop_val

 (  string prop_name , bit [1023:0] prop_val , ref string prop_val_string , input svt_pattern_data :: type_enum typ  ) 


Provide string values for contained_cfg_opts.

prop_name - The name of the property being encoded.

prop_val_string - The string describing the value to be encoded.

prop_val - The bit vector encoding of prop_val_string.

typ - Optional field type used to help in the encode effort.

Return values - The enum value corresponding to the desc.


 Superseded functions 
 svt_sequence_item_base :: decode_prop_val 
 Superseding functions 
 svt_fifo_rate_control_configuration :: decode_prop_val 
 svt_mem_configuration :: decode_prop_val 

  function svt_pattern
 svt_configuration::do_allocate_pattern

 (   ) 


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_sequence_item_base :: do_allocate_pattern 
 Superseding functions 
 svt_fifo_rate_control_configuration :: do_allocate_pattern 
 svt_mem_configuration :: do_allocate_pattern 
 svt_base_mem_suite_configuration :: do_allocate_pattern 
 svt_mem_suite_configuration :: do_allocate_pattern 

  function void
 svt_configuration::do_copy

 (  uvm_object rhs  ) 


Extend the UVM copy routine to copy via copy_static_data/copy_dynamic_data

 Superseded functions 
 uvm_object :: do_copy 
 uvm_transaction :: do_copy 
 svt_sequence_item_base :: do_copy 

  function void
 svt_configuration::do_pack

 (  uvm_packer packer  ) 


Pack the fields in the configuration base class.

 Superseded functions 
 uvm_object :: do_pack 
 svt_sequence_item_base :: do_pack 
 Superseding functions 
 svt_mem_suite_configuration :: do_pack 

  function void
 svt_configuration::do_unpack

 (  uvm_packer packer  ) 


Unpack the fields in the configuration base class.

 Superseded functions 
 uvm_object :: do_unpack 
 svt_sequence_item_base :: do_unpack 
 Superseding functions 
 svt_mem_suite_configuration :: do_unpack 

  function void
 svt_configuration::enable_cov_options

 (   ) 


Parses the configuration object using patterns and automatically enables coverage if enable_cov set to '1' based on the svt_enable_cov plusarg.

This method is called automatically when the reconfigure method is called on any of the top level components.

  function void
 svt_configuration::enable_debug_options

 (  string inst , string path = ""  ) 


Parses the configuration object using patterns and enables debug options.

This method should be called by the top level component in extended suites, immediately after the configuration is received for the first time. It is also called automatically when the reconfigure method is called.

inst - Instance name of the component that is enabled for debug

path - Optional argument to provide the hierarchical path to this object

  function void
 svt_configuration::enable_pa_options

 (  bit enable_debug_opts = 0  ) 


Parses the configuration object using patterns and automatically enables PA options if enable_pa set to '1' based on the svt_enable_pa plusarg.

This method is called automatically when the reconfigure or enable_debug_opts method is called on any of the top level components.

  function void
 svt_configuration::find_sub_configurations

 (  ref svt_configuration sub_cfgs [string]  ) 


This method scans the sub-object hierarchy looking for sub-configurations. It returns an associative array of the objects, indexed by the paths to the sub-objects.

sub_cfgs - An svt_configuration associative array with entries for all of the svt_configration sub-objects, indexed by the sub-object field names.

  function bit
 svt_configuration::get_check_prop_val

 (   ) 


Parses the configuration object using patterns to see if checks has been enabled on any of the layers or protocol as a whole.

  function bit
 svt_configuration::get_cov_prop_val

 (   ) 


Parses the configuration object using patterns to see if coverage has been enabled on any of the layers or protocol as a whole.

  function int
 svt_configuration::get_packer_max_bytes_required

 (   ) 


This method returns the maximum packer bytes value required by the suite. This is checked against `SVT_XVM_UC(MAX_PACKER_BYTES) when the configuration class is constructed to make sure the provied value is sufficient for the extended suite.

The default implementation just returns `SVT_XVM_UC(MAX_PACKER_BYTES) value. Individual suites extend this method to indicate any specific requirements they may have.

Note: This method should only be implemented by suites that require packing/unpacking operations for normal operation, and if the default size defined in the UVM/OVM base class library is not sufficient. In this situation the VIP developer knows that the user must provide a larger value on the command line through the use of of the `SVT_XVM_UC(MAX_PACKER_BYTES) macro, and so this check should be performed in the constructor of the configuration object.

Not all suites require packing/unpacking operations for normal operation. If a VIP developer determines that packing/unpacking is not required for normal operation of the VIP then this method should not be implemented (and the check should not be performed). However, if a larger value for `SVT_XVM_UC(MAX_PACKER_BYTES) is required to complete pack/unpack operations for specific transactions then these operations will fail if the user attempts this. In this situation the VIP developer should determine what minimum `SVT_XVM_UC(MAX_PACKER_BYTES) is required and should implement the get_packer_max_bytes_required method in the extended transaction class instead. This will cause the check to only be performed if the user attempts to pack or unpack the transaction class, and so the user will only need to provide `SVT_XVM_UC(MAX_PACKER_BYTES) value on the command line if they need to perform the pack/unpack operations.

  function bit
 svt_configuration::get_prop_val

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


This method is used by a component's command interface, to allow command code to retrieve the value of a single named property of a data class derived from this class. If the prop_name argument does not match a property of the class, or if the array_ix argument is not zero and does not point to a valid array element, this function returns '0'. Otherwise it returns '1', with the value of the prop_val argument assigned to the value of the specified property. However, If the property is a sub-object, a reference to it is assigned to the data_obj (ref) argument. In that case, the prop_val argument is meaningless. The component will then store the data object reference in its temporary data object array, and return a handle to its location as the prop_val argument of the get_data_prop task of the component. The command testbench code must then use that handle to access the properties of the sub-object.

prop_name - The name of a property in this class, or a derived class.

prop_val - A ref argument used to return the current value of the property, expressed as a 1024 bit quantity. When returning a string value each character requires 8 bits so returned strings must be 128 characters or less.

array_ix - If the property is an array, this argument specifies the index being accessed. If the property is not an array, it should be set to 0.

data_obj - If the property is not a sub-object, this argument is assigned to null. If the property is a sub-object, a reference to it is assigned to this (ref) argument. In that case, the prop_val argument is meaningless. The component will then store the data object reference in its temporary data object array, and return a handle to its location as the prop_val argument of the get_data_prop task of the component. The command testbench code must then use that handle to access the properties of the sub-object.

Return values - A single bit representing whether or not a valid property was retrieved.


 Superseded functions 
 svt_sequence_item_base :: get_prop_val 
 Superseding functions 
 svt_fifo_rate_control_configuration :: get_prop_val 
 svt_mem_configuration :: get_prop_val 
 svt_base_mem_suite_configuration :: get_prop_val 
 svt_mem_suite_configuration :: get_prop_val 

  function bit
 svt_configuration::is_pa_enabled

 (   ) 


Checks the PA related flags 'enable_xml_gen' and returns '1' if any of the 'enable_.*xml_gen' is set.

Clients can override this function if requeried to be.

  function void
 svt_configuration::new

 (  string name = "svt_configuration_inst", string suite_name = ""  ) 


CONSTRUCTOR: Creates a new instance of the svt_configuration class.

name - Instance name of this object.

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


 Superseded functions 
 svt_sequence_item_base :: new 
 Superseding functions 
 svt_fifo_rate_control_configuration :: new 
 svt_mem_configuration :: new 
 svt_base_mem_suite_configuration :: new 
 svt_mem_suite_configuration :: new 

  function void
 svt_configuration::record_cfg_info

 (  string inst_name  ) 


Record the configuration information inside FSDB if writer is available, if the writer is not available at this time then register the data, when the writer is created the data can be written out into FSDB.

inst_name - Instance name of the component that is enabled for debug

  function bit
 svt_configuration::set_prop_val

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


This method is used by a component's command interface, to allow command code to set the value of a single named property of a data class derived from this class. This method cannot be used to set the value of a sub-object, since sub-object consruction is taken care of automatically by the command interface. If the prop_name argument does not match a property of the class, or it matches a sub-object of the class, or if the array_ix argument is not zero and does not point to a valid array element, this function returns '0'. Otherwise it returns '1'.

prop_name - The name of a property in this class, or a derived class.

prop_val - The value to assign to the property, expressed as a 1024 bit quantity. When assigning a string value each character requires 8 bits so assigned strings must be 128 characters or less.

array_ix - If the property is an array, this argument specifies the index being accessed. If the property is not an array, it should be set to 0.

Return values - A single bit representing whether or not a valid property was set.


 Superseded functions 
 svt_sequence_item_base :: set_prop_val 
 Superseding functions 
 svt_fifo_rate_control_configuration :: set_prop_val 
 svt_mem_configuration :: set_prop_val 
 svt_base_mem_suite_configuration :: set_prop_val 
 svt_mem_suite_configuration :: set_prop_val 

  function void
 svt_configuration::setup_cov_plusarg

 (   ) 


This method sets up the field indicating whether coverage support should be enabled automatically.

  function void
 svt_configuration::setup_pa_plusarg

 (   ) 


This method sets up the fields indicating whether PA support should be enabled automatically.

  function int
 svt_configuration::static_rand_mode

 (  bit on_off  ) 


 Superseding functions 
 svt_fifo_rate_control_configuration :: static_rand_mode 
 svt_mem_configuration :: static_rand_mode 
 svt_base_mem_suite_configuration :: static_rand_mode 
 svt_mem_suite_configuration :: static_rand_mode 


Member Attribute Documentation

 bit  attribute
 svt_configuration::enable_runtime_trace_recording = 0


Determines if runtime trace recording is to be enabled or not. By default the data is dumped at end of simulation into trace file
type: Static

 bit  attribute
 svt_configuration::enable_signal_callbacks = 0


(Default = 0) When 1 the model will enable callbacks associated with signal changes (pre_*_drive_cb_exec and post_*_sample_cb_exec).

This feature can be set directly or via the command line, using the '+define' plusarg (e.g., '+define+SVT__ENABLE_SIGNAL_CB').

 bit  attribute
 svt_configuration::enable_sled = 0


Determines if MERCURY(SLED) dumping is to enabled or not.
type: Static

 string  attribute
 svt_configuration::filter_psdisplay_short[$]


Field to store psdisplay_short display/trace-file fields to be removed. User need to input Field Header name in this field.

 string  attribute
 svt_configuration::inst = SVT_UNSET_INST_NAME


Used to in some situations to define the Instance Name of a component prior to its construction. Mainly used in situations where the creating component is creating multiple sub-components where those sub-components do not have obvious names. E.g., an env creating multiple masters could name them master[0], master[1], etc. But the user may want to name them CPU, CTRLR, etc. Some components therefore use this to support a mechanism for overriding the default names (e.g., master[0], etc.) with more useful testbench provided names (e.g., CPU, etc.).