svt_err_catcher Class Reference

Inheritance diagram for class svt_err_catcher:

List of all members.


Detailed Description

This file creates a UVM/OVM message catcher class to demote expected error and warnings.

The add_message_text_to_demote method is used to add a regex expression to match the message text of ERROR or WARNING messages to be demoted.

The add_message_id_to_demote() method is used to add a regex expression to match the message id of ERROR or WARNING messages to be demoted.

Any ERROR or WARNING message or ID that matches these expressions are demoted to INFO level messages. The number of times that a message or id is demoted is tracked in the demoted_messages_count [string] and the demoted_id_count [string] arrays.



Public Member Functions

function void  add_message_id_to_demote ( string id, int limit = 0 )
function void  add_message_text_to_demote ( string msg, int limit = 0 )
function action_e  catch ( )
function ovm_object  create ( string name = "" )
function int  get_demoted_id_count ( string id )
function int  get_demoted_id_limit ( string id )
function int  get_demoted_messages_count ( string msg )
function int  get_demoted_messages_limit ( string msg )
function string_q_t  get_ids_to_demote ( )
function string_q_t  get_messages_to_demote ( )
virtual function ovm_object_wrapper  get_object_type ( )
static function type_id  get_type ( )
virtual function string  get_type_name ( )
function void  new ( string name = "svt_err_catcher" )
function void  remove_message_id_to_demote ( string id, bit retain_limit_check = 0 )
function void  remove_message_text_to_demote ( string msg, bit retain_limit_check = 0 )
function bit  report ( bit silent = 0 )

Public Attributes

static const string  type_name = "svt_err_catcher"; 

Protected Attributes

protected int  demoted_id_count [string] 
protected int  demoted_id_limit [string] 
protected int  demoted_messages_count [string] 
protected int  demoted_messages_limit [string] 
protected string_q_t  ids_to_demote 
protected string_q_t  ids_to_demote_removed 
protected bit  ids_to_demote_removed_limit_check [string] 
protected string_q_t  messages_to_demote 
protected string_q_t  messages_to_demote_removed 
protected bit  messages_to_demote_removed_limit_check [string] 

Member Typedefs

 typedef class  type_id 


Member Function Documentation

  function void
 svt_err_catcher::add_message_id_to_demote

 (  string id , int limit = 0  ) 


Adds a new regex entry that will be used to match against the message ID of every ERROR and WARNING message.

The limit argument of this method will restrict the error catcher to demote the message ID the number of times provided. After this number of demotions is reached then the message will continue to be issued as normal. A limit value of 0 indicates no limit (all matching message IDs observed will be demoted).

Multiple calls of this method with the same message ID will result in updates to the limit value for this message ID. If a limit value of 0 is supplied in a subsequent call then the limit will be reset back to 0 (unlimited). Positive values received will increase the limit value and negative values will decrease the limit value. If the limit value is modified to be equal to 0 by a subsequent call then the message ID demotion for this ID will be removed.

Errors will be generated if the limit is set to a value of less than 0, either in the first call or in subsequent calls.

id - Regex expression used to match the message id

limit - Number of times that the message id is demoted before the message filter is disabled. A value of 0 will cause all messages to be demoted (no limit).

  function void
 svt_err_catcher::add_message_text_to_demote

 (  string msg , int limit = 0  ) 


Adds a new regex entry that will be used to match against the message text of every ERROR and WARNING message.

The limit argument of this method will restrict the error catcher to demote the message text the number of times provided. After this number of demotions is reached then the message will continue to be issued as normal. A limit value of 0 indicates no limit (all matching message text observed will be demoted).

Multiple calls of this method with the same message text will result in updates to the limit value for this message text. If a limit value of 0 is supplied in a subsequent call then the limit will be reset back to 0 (unlimited). Positive values received will increase the limit value and negative values will decrease the limit value. If the limit value is modified to be equal to 0 by a subsequent call then the message text demotion for this text will be removed.

Errors will be generated if the limit is set to a value of less than 0, either in the first call or in subsequent calls.

msg - Regex expression used to match the message text

limit - Number of times that the message text is demoted before the message filter is disabled. A value of 0 will cause all messages to be demoted (no limit).

  function action_e
 svt_err_catcher::catch

 (   ) 


UVM/OVM catch method implementation

 Superseded functions 
 svt_report_catcher :: catch 

  function ovm_object
 svt_err_catcher::create

 (  string name = ""  ) 


 Superseded functions 
 ovm_object :: create 

  function int
 svt_err_catcher::get_demoted_id_count

 (  string id  ) 


Returns the number of times that a message ID has been demoted.

id - Message ID text that was used in the call to add_message_id_to_demote

Return values - number of times that the message ID has been demoted

  function int
 svt_err_catcher::get_demoted_id_limit

 (  string id  ) 


Returns the demotion limit that has been set up for this message ID.

id - Message ID text that was used in the call to add_message_id_to_demote

Return values - number of times that the message ID will be demoted

  function int
 svt_err_catcher::get_demoted_messages_count

 (  string msg  ) 


Returns the number of times that a message has been demoted.

msg - Message text that was used in the call to add_message_text_to_demote

Return values - number of times that the message has been demoted

  function int
 svt_err_catcher::get_demoted_messages_limit

 (  string msg  ) 


Returns the demotion limit that has been set up for this message text.

msg - Message text that was used in the call to add_message_text_to_demote

Return values - number of times that the message will be demoted

  function string_q_t
 svt_err_catcher::get_ids_to_demote

 (   ) 


Returns the queue of message ID entries that have been submitted.

Return values - Queue of strings that have been submitted to demote message ID

  function string_q_t
 svt_err_catcher::get_messages_to_demote

 (   ) 


Returns the queue of message text entries that have been submitted.

Return values - Queue of strings that have been submitted to demote message text

 virtual function ovm_object_wrapper
 svt_err_catcher::get_object_type

 (   ) 


 Superseded functions 
 ovm_object :: get_object_type 

 static function type_id
 svt_err_catcher::get_type

 (   ) 


 Superseded functions 
 ovm_object :: get_type 

 virtual function string
 svt_err_catcher::get_type_name

 (   ) 


 Superseded functions 
 ovm_object :: get_type_name 

  function void
 svt_err_catcher::new

 (  string name = "svt_err_catcher"  ) 


Constructor

 Superseded functions 
 ovm_object :: new 
 svt_report_catcher :: new 

  function void
 svt_err_catcher::remove_message_id_to_demote

 (  string id , bit retain_limit_check = 0  ) 


Removes an existing entry from the message ID to demote queue. The string value must be an exact match for an existing entry or an error message is generated.

By default the limit check associated with this message text entry is also removed. This check can be retained using the retain_limit_check argument.

id - Message ID to demote entry to be removed

retain_limit_check - Optional argument that allows the limit check for this message ID to be retained

  function void
 svt_err_catcher::remove_message_text_to_demote

 (  string msg , bit retain_limit_check = 0  ) 


Removes an existing entry from the message text to demote queue. The string value must be an exact match for an existing entry or an error message is generated.

By default the limit check associated with this message text entry is also removed. This check can be retained using the retain_limit_check argument.

msg - Message text to demote entry to be removed

retain_limit_check - Optional argument that allows the limit check for this message ID to be retained

  function bit
 svt_err_catcher::report

 (  bit silent = 0  ) 


Analyzes all expected message and ID demotions and returns 1 if all expected messages were demoted, and 0 if any expected messages were not detected.

silent - Controls whether each missing message is displayed

Return values - Status of all expected message demotions. Return value of 1 indicates that all expected messages were observed, and 0 indicates that not all messages were observed.


Member Attribute Documentation

 protected int  attribute
 svt_err_catcher::demoted_id_count[string]


Array to store the number of times that a particular message id has been demoted.

 protected int  attribute
 svt_err_catcher::demoted_id_limit[string]


Array to store the number of times that a particular WARNING message will be demoted before the message filter is disabled.

 protected int  attribute
 svt_err_catcher::demoted_messages_count[string]


Array to store the number of times that a particular message text has been demoted.

 protected int  attribute
 svt_err_catcher::demoted_messages_limit[string]


Array to store the number of times that a particular ERROR message will be demoted before the message filter is disabled.

 protected string_q_t  attribute
 svt_err_catcher::ids_to_demote


Queue that contains regex expressions to identify message ID to be demoted. Multiple messages can be demoted by pushing multiple values to the queue.

 protected string_q_t  attribute
 svt_err_catcher::ids_to_demote_removed


ids_to_demote entries that have been removed via a call to remove_message_id_to_demote. These are retained so that they can be used to summarize the report catcher activity.

 protected bit  attribute
 svt_err_catcher::ids_to_demote_removed_limit_check[string]


Flag that determines whether the limit check should be executed on message ID entries that have been removed.

 protected string_q_t  attribute
 svt_err_catcher::messages_to_demote


Queue that contains regex expressions to identify message text to be demoted. Multiple messages can be demoted by pushing multiple values to the queue.

 protected string_q_t  attribute
 svt_err_catcher::messages_to_demote_removed


messages_to_demote entries that have been removed via a call to remove_message_text_to_demote. These are retained so that they can be used to summarize the report catcher activity.

 protected bit  attribute
 svt_err_catcher::messages_to_demote_removed_limit_check[string]


Flag that determines whether the limit check should be executed on message text entries that have been removed.

 static const string  attribute
 svt_err_catcher::type_name = "svt_err_catcher"


Member Typedef Documentation

 Typedefe'd string ==>   string

 typedef class  svt_err_catcher::type_id
 Typedefe'd string ==>   ovm_object_registry#(svt_err_catcher,)