svt_message_manager Class Reference

Inheritance diagram for class svt_message_manager:

List of all members.


Detailed Description

This class provides access to the methodology specific reporting facility. The class provides SVC specific interpretations of the reporting capabilities, and provides support for SVC specific methods.



Public Member Functions

static function int  calc_format_count ( string message )
function int  convert_client_verbosity ( )
static function int  facilitate_get_client_verbosity_level ( string pref_mgr_id, string def_mgr_id )
static function bit  facilitate_is_supported_client_verbosity ( string pref_mgr_id, string def_mgr_id, int client_verbosity )
static function void  facilitate_report_message ( string pref_mgr_id, string def_mgr_id, int client_verbosity, int client_severity, string message, int message_id = -1, string filename = "", int line = 0 )
static function svt_message_manager  find_message_manager ( string pref_mgr_id, string def_mgr_id )
function void  get_client_verbosity ( int methodology_verbosity, int methodology_severity, ref int client_verbosity, ref int client_severity )
function int  get_client_verbosity_level ( )
function void  get_methodology_id_and_message ( string client_message, ref string message_id, ref string message )
function string  get_methodology_message ( string client_message )
function void  get_methodology_verbosity ( int client_verbosity, int client_severity, ref int methodology_verbosity, ref int methodology_severity, ref bit include_prefix, ref bit include_newline )
function string  get_name ( )
static function bit  is_string_var ( string var_typename )
function bit  is_supported_client_verbosity ( int client_verbosity )
static function svt_message_manager  localized_report_message ( svt_message_manager msg_mgr, string pref_mgr_id, string def_mgr_id, int client_verbosity, int client_severity, string message, int message_id = -1, string filename = "", int line = 0 )
function void  new ( string name = "", ovm_report_object reporter = null )
static function void  replace_percent_m ( ref string message, input string percent_m_replacement )
function void  report_message ( int client_verbosity, int client_severity, string message, int message_id = -1, string filename = "", int line = 0 )
function void  watch_for_verbosity_changes ( )

Public Attributes

int  m_client_verbosity = -1; 
static svt_message_manager  preferred_msg_mgr [string] 
ovm_report_object  reporter 
static svt_message_manager  shared_msg_mgr = new; 

Protected Attributes

protected string  name = ""; 


Member Function Documentation

 static function int
 svt_message_manager::calc_format_count

 (  string message  ) 


Utility method which calculates how many format specifiers (e.g., %s) are included in the string.

message - The string to be processed.

Return values - Indicates how many format specifiers were found.

  function int
 svt_message_manager::convert_client_verbosity

 (   ) 


Converts the methodology verbosity into the client's representation

 static function int
 svt_message_manager::facilitate_get_client_verbosity_level

 (  string pref_mgr_id , string def_mgr_id  ) 


Static method used to get the current message level. Useful for controlling output generation.

pref_mgr_id - Used to find the preferred message manager to retrieve the client verbosity level from.

def_mgr_id - Used to find default message manager if cannot find message manager for pref_mgr_id.

Return values - The current client specified verbosity level associated with the indicated message manager.

 static function bit
 svt_message_manager::facilitate_is_supported_client_verbosity

 (  string pref_mgr_id , string def_mgr_id , int client_verbosity  ) 


Utility method that can be used to decide if the client verbosity can be supported.

client_verbosity - Client specified verbosity value that is to be evaluated.

Return values - Indicates whether the client_verbosity corresponds to a support verbosity level (1) or not (0).

 static function void
 svt_message_manager::facilitate_report_message

 (  string pref_mgr_id , string def_mgr_id , int client_verbosity , int client_severity , string message , int message_id = -1, string filename = "", int line = 0  ) 


Static method used to find the right message manager and report information to the transcript.

pref_mgr_id - Used to find the preferred message manager to report the message.

def_mgr_id - Used to find default message manager if cannot find message manager for pref_mgr_id.

client_verbosity - Client specified verbosity which defines the output level.

client_severity - Client specified severity which helps define the output level.

message - Text to be reported.

message_id - Optional ID associated with the text to be reported.

filename - Optional argument identifying the source file for the message.

line - Optional argument identifying the source line number for the message.

 static function svt_message_manager
 svt_message_manager::find_message_manager

 (  string pref_mgr_id , string def_mgr_id  ) 


Utility method which can be used to find the most appropriate message manager based on the pref_mgr_id and def_mgr_id.

pref_mgr_id - Used to find the preferred message manager.

def_mgr_id - Used to find default message manager if cannot find message manager for pref_mgr_id.

Return values - Handle to the message manager which was found.

  function void
 svt_message_manager::get_client_verbosity

 (  int methodology_verbosity , int methodology_severity , ref int client_verbosity , ref int client_severity  ) 


Method used to convert from methodology verbosity/severity to client technology verbosity/severity.

methodology_verbosity - Methodology verbosity value that is to be converted.

methodology_severity - Methodology severity value that is to be converted.

client_verbosity - The client verbosity value corresponding to the methodology verbosity.

client_severity - The client severity value corresponding to the methodology severity.


 Superseding functions 
 svt_svc_message_manager :: get_client_verbosity 

  function int
 svt_message_manager::get_client_verbosity_level

 (   ) 


Method used to get the current client specified verbosity level. Useful for controlling output generation.

Return values - The current client specified verbosity level associated with this message manager.

  function void
 svt_message_manager::get_methodology_id_and_message

 (  string client_message , ref string message_id , ref string message  ) 


Method used to remove client specific text or add methodology specific text to an 'in process' display message, and also to pull out the messageID if provided in the message.

client_message - Client provided message which is to be converted to a methodology message.

message_id - The ID extracted from the client message.

message - The final message extracted from the client message.


 Superseding functions 
 svt_svc_message_manager :: get_methodology_id_and_message 

  function string
 svt_message_manager::get_methodology_message

 (  string client_message  ) 


Method used to remove client specific text or add methodology specific text to an 'in process' display message.

client_message - Client provided message which is to be converted to a methodology message.

Return values - Message after it has been converted to the current methodology.


 Superseding functions 
 svt_svc_message_manager :: get_methodology_message 

  function void
 svt_message_manager::get_methodology_verbosity

 (  int client_verbosity , int client_severity , ref int methodology_verbosity , ref int methodology_severity , ref bit include_prefix , ref bit include_newline  ) 


Method used to convert from client technology verbosity/severity to methodology verbosity/severity.

client_verbosity - Client specified verbosity value that is to be converted.

client_severity - Client specified severity value that is to be converted.

methodology_verbosity - The methodology verbosity value corresponding to the client provided technology verbosity.

methodology_severity - The methodology severity value corresponding to the client provided technology severity.

include_prefix - Indicates whether the resulting message should include a prefix.

include_newline - Indicates whether the resulting message should be preceded by a carriage return.


 Superseding functions 
 svt_svc_message_manager :: get_methodology_verbosity 

  function string
 svt_message_manager::get_name

 (   ) 


Utility method for getting the name of the message manager.

Return values - The name associated with this message manager.

 static function bit
 svt_message_manager::is_string_var

 (  string var_typename  ) 


Utility method that can be used to recognize a string argument.

var_typename - The '$typename' value for the argument.

Return values - Indicates whether the var_typename reflects the variable is of type string (1) or not (0).

  function bit
 svt_message_manager::is_supported_client_verbosity

 (  int client_verbosity  ) 


Utility method that can be used to decide if the client verbosity can be supported.

client_verbosity - Client specified verbosity value that is to be evaluated.

Return values - Indicates whether the client_verbosity corresponds to a support verbosity level (1) or not (0).


 Superseding functions 
 svt_svc_message_manager :: is_supported_client_verbosity 

 static function svt_message_manager
 svt_message_manager::localized_report_message

 (  svt_message_manager msg_mgr , string pref_mgr_id , string def_mgr_id , int client_verbosity , int client_severity , string message , int message_id = -1, string filename = "", int line = 0  ) 


Method used to report information to the transcript through a local message manager.

If the supplied message manager is non-null then this method dispatches the message through that. If the the supplied message manager is null then a message manager is first obtained using find_message_manager, and then the message is dispatched through that.

The message manager used is returned through the return value of the function. This can then be used to update the local reference so that the lookup does not need to be performed again.

msg_mgr - Reference to the local message manager

pref_mgr_id - ID of the preferred message manager

def_mgr_id - ID of the default message manager

client_verbosity - Client specified verbosity which defines the output level.

client_severity - Client specified severity which helps define the output level.

message - Text to be reported.

message_id - Optional ID associated with the text to be reported.

filename - Optional argument identifying the source file for the message.

line - Optional argument identifying the source line number for the message.

  function void
 svt_message_manager::new

 (  string name = "", ovm_report_object reporter = null  ) 


CONSTRUCTOR: Create a new Message Log instance.

name - Name associated with the message manager, used to add the message manager to the preferred_msg_mgr array.

reporter - The reporter associated with this message manager resource.


 Superseding functions 
 svt_svc_message_manager :: new 

 static function void
 svt_message_manager::replace_percent_m

 (  ref string message , input string percent_m_replacement  ) 


Utility method that can be used to replace all '%m' references in the string with an alternative string.

message - Reference to the message including the '%m' values to be replaced.

percent_m_replacement - Ths string that is supposed to replace all of the '%m' values in message.

  function void
 svt_message_manager::report_message

 (  int client_verbosity , int client_severity , string message , int message_id = -1, string filename = "", int line = 0  ) 


Method used to report information to the transcript.

client_verbosity - Client specified verbosity which defines the output level.

client_severity - Client specified severity which helps define the output level.

message - Text to be reported.

message_id - Optional ID associated with the text to be reported.

filename - Optional argument identifying the source file for the message.

line - Optional argument identifying the source line number for the message.


 Superseding functions 
 svt_svc_message_manager :: report_message 

  function void
 svt_message_manager::watch_for_verbosity_changes

 (   ) 


Establishes a constantly running thread that watches for changes in the verbosity level of the reporter/log associated with this message manager.

Member Attribute Documentation

 int  attribute
 svt_message_manager::m_client_verbosity = -1


Verbosity level of the associated reporter/log object. This value is set to the client's default severity when the class is constructed, and then it is updated when the client's verbosity changes.

 protected string  attribute
 svt_message_manager::name = ""


Name given to the message manager at construction.

 static svt_message_manager  attribute
 svt_message_manager::preferred_msg_mgr[string]


Static svt_message_manager associative array which can be used to access preferred svt_message_manager instances.

 ovm_report_object  attribute
 svt_message_manager::reporter


The reporter associated with this message manager resource. Public so it can be set after message manager creation.

 static svt_message_manager  attribute
 svt_message_manager::shared_msg_mgr = new


Static default svt_message_manager which can be used when no preferred svt_message_manager is available.