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 int  collision ( svt_exception test_exception )
function svt_pattern  do_allocate_pattern ( )
function bit  do_compare ( uvm_object rhs, uvm_comparer comparer )
function void  do_copy ( uvm_object rhs )
function bit  do_is_valid ( bit silent = 1, int kind = -1 )
function void  do_pack ( uvm_packer packer )
function void  do_unpack ( uvm_packer packer )
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_sequence_item_base data_obj )
function real  get_start_time ( )
virtual function void  inject_error_into_xact ( )
function void  new ( string name = "svt_exception_inst", string suite_name = "" )
virtual function bit  no_op ( )
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; 


Member Function Documentation

 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.

  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_sequence_item_base :: do_allocate_pattern 

  function bit
 svt_exception::do_compare

 (  uvm_object rhs , uvm_comparer comparer  ) 


Override the 'do_compare' method to compare fields directly.

 Superseded functions 
 uvm_object :: do_compare 
 svt_sequence_item_base :: do_compare 

  function void
 svt_exception::do_copy

 (  uvm_object rhs  ) 


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

rhs - Source object to be copied.


 Superseded functions 
 uvm_object :: do_copy 
 uvm_transaction :: do_copy 
 svt_sequence_item_base :: 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_sequence_item_base :: 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 
 svt_sequence_item_base :: do_is_valid 

  function void
 svt_exception::do_pack

 (  uvm_packer packer  ) 


Pack the fields in the exception base class.

 Superseded functions 
 uvm_object :: do_pack 
 svt_sequence_item_base :: do_pack 

  function void
 svt_exception::do_unpack

 (  uvm_packer packer  ) 


Unpack the fields in the exception base class.

 Superseded functions 
 uvm_object :: do_unpack 
 svt_sequence_item_base :: do_unpack 

  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_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 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_sequence_item_base :: 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.

  function void
 svt_exception::new

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


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

name - Intance name for this object

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


 Superseded functions 
 svt_sequence_item_base :: 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.

  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_sequence_item_base :: 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 "begin" event is triggered.