The ovm_report_object provides an interface to the OVM reporting facility. Through this interface, components issue the various messages with different severity levels that occur during simulation. Users can configure what actions are taken and what file(s) are output for individual messages from a particular component or for all messages from all components in the environment.
A report consists of an id string, severity, verbosity level, and the textual message itself. If the verbosity level of a report is greater than the configured maximum verbosity level of its report object, it is ignored.
Reporting Methods:
Following are the primary reporting methods in the OVM.
verbosity -- the verbosity of the message, indicating its relative importance. If this number is less than or equal to the effective verbosity level, then the report is issued, subject to the configured action and file descriptor settings.
filename/line -- If required to print filename and line number from where the message is issued, use macros, `__FILE__ and `__LINE__.
Actions:
These methods associate the specified action or actions with reports of the givenseverity, id, or severity-id pair.
Following are the actions defined:
OVM_NO_ACTION -- Do nothing
OVM_DISPLAY -- Display report to standard output
OVM_LOG -- Write to a file
OVM_COUNT -- Count up to a max_quit_count value before exiting
OVM_EXIT -- Terminates simulation immediately
OVM_CALL_HOOK -- Callback the hook method .
Configuration:
Using these methods, user can set the verbosity levels and set actions.
In the following example, messages from rpting::run() method are of different verbosity level. In the top module, 3 objects of rpting are created and different verbosity levels are set using set_report_verbosity_level() method.
`include "ovm.svh"
import ovm_pkg::*;
class rpting extends ovm_threaded_component;
`ovm_component_utils(rpting)
function new(string name,ovm_component parent);
super.new(name, parent);
endfunction
task run();
ovm_report_info(get_full_name(),
"Info Message : Verbo lvl - OVM_NONE ",OVM_NONE,`__FILE__,`__LINE__);
ovm_report_info(get_full_name(),
"Info Message : Verbo lvl - OVM_LOW ",OVM_LOW);
ovm_report_info(get_full_name(),
"Info Message : Verbo lvl - 150 ",150);
ovm_report_info(get_full_name(),
"Info Message : Verbo lvl - OVM_MEDIUM",OVM_MEDIUM);
ovm_report_warning(get_full_name(),
"Warning Messgae from rpting",OVM_LOW);
ovm_report_error(get_full_name(),
"Error Message from rpting \n\n",OVM_LOG);
endtask