svt_exception Class Reference

Inheritance diagram for class svt_exception:

List of all members.


Detailed Description

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



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 int  collision ( svt_exception test_exception )
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 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 vmm_data  do_copy ( vmm_data to = null )
function bit  do_is_valid ( bit silent = 1, int kind = -1 )
function void  error_driven ( )
virtual function string  get_description ( )
function bit  get_prop_val ( string prop_name, ref bit [1023:0] prop_val, input int array_ix, ref svt_data data_obj )
function real  get_start_time ( )
virtual function void  inject_error_into_xact ( )
virtual function bit  is_valid ( bit silent = 1, int kind = -1 )
function void  new ( vmm_log log = null, string suite_name = "" )
virtual function bit  no_op ( )
virtual function string  psdisplay ( string prefix = "" )
function void  set_constraint_weights ( int new_weight )
function bit  set_prop_val ( string prop_name, bit [1023:0] prop_val, int array_ix )
function void  set_start_time ( real start_time )

Public Attributes

bit  recognized = 0; 
real  start_time = -1; 

Protected Attributes

static protected svt_exception  __vmm_rhs 


Member Function Documentation

 virtual function vmm_data
 svt_exception::allocate

 (   ) 


 Superseded functions 
 vmm_data :: allocate 
 svt_data :: allocate 

 virtual function unsigned int
 svt_exception::byte_pack

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


 Superseded functions 
 vmm_data :: byte_pack 
 svt_data :: byte_pack 

  function unsigned int
 svt_exception::byte_size

 (  int kind = -1  ) 


Returns the size (in bytes) required by the byte_pack operation.

kind - This int indicates the type of byte_size being requested. Only supported kind value is svt_data :: COMPLETE, which results in a size calculation based on the non-static fields. All other kind values result in a return value of 0.


 Superseded functions 
 vmm_data :: byte_size 
 svt_data :: byte_size 

 virtual function unsigned int
 svt_exception::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 

 virtual function int
 svt_exception::collision

 (  svt_exception test_exception  ) 


Checks whether this exception collides with another exception, test_exception. This method must be implemented by extended classes.

test_exception - Exception to be checked as a possible collision.

 virtual function bit
 svt_exception::compare

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


 Superseded functions 
 vmm_data :: compare 
 svt_data :: compare 

 virtual function vmm_data
 svt_exception::copy

 (  vmm_data to = null  ) 


 Superseded functions 
 vmm_data :: copy 
 svt_data :: copy 

  function void
 svt_exception::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 

  function svt_pattern
 svt_exception::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_data :: do_allocate_pattern 

  function unsigned int
 svt_exception::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, based on the requested byte_pack kind.

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 non-static 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_exception::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, based on the requested byte_unpack kind.

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 non-static 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 exception contents, and a return value of 0.


 Superseded functions 
 vmm_data :: do_byte_unpack 
 svt_data :: do_byte_unpack 

  function bit
 svt_exception::do_compare

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


Compares the object with to. Differences are placed in diff.

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. Supports both RELEVANT and COMPLETE compares.


 Superseded functions 
 vmm_data :: do_compare 
 svt_data :: do_compare 

  function vmm_data
 svt_exception::do_copy

 (  vmm_data to = null  ) 


Extend the copy method to copy the exception base class fields.

to - Destination class for the copy operation


 Superseded functions 
 vmm_data :: do_copy 
 svt_data :: do_copy 

  function bit
 svt_exception::do_is_valid

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


Checks to see that the data field values are valid.

silent - bit indicating whether failures should result in warning messages.

kind - This int indicates the type of is_avalid check to attempt. Only supported kind value is svt_data :: COMPLETE, which results in verification that the data members are all valid. All other kind values result in a return value of 1.


 Superseded functions 
 vmm_data :: do_is_valid 
 svt_data :: do_is_valid 

  function void
 svt_exception::error_driven

 (   ) 


Updates the start time to indicate the exception has been driven and generates the STARTED notification.

 virtual function string
 svt_exception::get_description

 (   ) 


Returns a string which provides a description of the exception.

  function bit
 svt_exception::get_prop_val

 (  string prop_name , ref bit [1023:0] prop_val , input int array_ix , ref svt_data 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 its 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 its 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_data :: get_prop_val 

  function real
 svt_exception::get_start_time

 (   ) 


Returns a the start_time for the exception.

 virtual function void
 svt_exception::inject_error_into_xact

 (   ) 


Injects the error into the transaction associated with the exception. This method is not implemented.

 virtual function bit
 svt_exception::is_valid

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


 Superseded functions 
 vmm_data :: is_valid 
 svt_data :: is_valid 

  function void
 svt_exception::new

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


CONSTRUCTOR: Create a new instance of the svt_exception class, passing the appropriate argument values to the svt_data parent class.

log - An vmm_log object reference used to replace the default internal logger. The class extension that calls super.new should pass a reference to its own static log instance.

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


 Superseded functions 
 svt_data :: new 

 virtual function bit
 svt_exception::no_op

 (   ) 


Method used to identify whether an exception is a no-op. In situations where its may be impossible to satisfy the exception constraints (e.g., if the weights for the exception types conflict with the current transaction) the extended exception class should provide a no-op exception type and implement this method to return 1 if and only if the type of the chosen exception corresponds to the no-op exception.

Return values - Indicates whether the exception is a valid (0) or no-op (1) exception.

 virtual function string
 svt_exception::psdisplay

 (  string prefix = ""  ) 


 Superseded functions 
 vmm_data :: psdisplay 
 svt_data :: psdisplay 

  function void
 svt_exception::set_constraint_weights

 (  int new_weight  ) 


Method to change the exception weights as a block.

  function bit
 svt_exception::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_data :: set_prop_val 

  function void
 svt_exception::set_start_time

 (  real start_time  ) 


Sets the start_time for the exception.

start_time - Time to be registered as the start_time for the exception.


Member Attribute Documentation

 bit  attribute
 svt_exception::recognized = 0


Indicates if the exception is an exception to be injected, or an exception which has been recognized by the VIP. This is used for deciding if protocol errors should be flagged for this exception. recognized == 0 indicates the exception is to be injected, recognized = 1 indicates the exception has been recognized.

The default for this should be setup in the exception constructor. The setting should be based on whether or not the exception CAN be recognized. If it can, then recognized should default to 1 in order to make it less likely that protocol errors could be disabled accidentally. If the exception cannot be recognized, then recognized should default to 0.

Since not all suites support exception recognition, the base class assumes that exception recognition is NOT supported and leaves this value initialized to 0.

 real  attribute
 svt_exception::start_time = -1


If set to something other than -1, indicates the (first) time at which the error was driven on the physical interface. At the time at which the error is driven, the STARTED notification (an ON/OFF notification) is indicated (i.e. turned ON).

 static protected svt_exception  attribute
 svt_exception::__vmm_rhs