|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



UVM REPORTING



The uvm_report_object provides an interface to the UVM 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 UVM.


virtual function void uvm_report_info
(string id,string message,int verbosity=UVM_MEDIUM,string filename="",int line=0)

virtual function void uvm_report_warning
(string id,string message,int verbosity=UVM_MEDIUM,string filename="",int line=0)

virtual function void uvm_report_error
(string id,string message,int verbosity=UVM_LOW, string filename="",int line=0)

virtual function void uvm_report_fatal
(string id,string message,int verbosity=UVM_NONE, string filename="",int line=0)

(S)Arguments description:


id -- a unique id to form a group of messages.

message -- The message text

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 given severity, id, or severity-id pair.

Following are the actions defined:

UVM_NO_ACTION -- Do nothing
UVM_DISPLAY -- Display report to standard output
UVM_LOG -- Write to a file
UVM_COUNT -- Count up to a max_quit_count value before exiting
UVM_EXIT -- Terminates simulation immediately
UVM_CALL_HOOK -- Callback the hook method .



Configuration:



Using these methods, user can set the verbosity levels and set actions.


function void set_report_verbosity_level
(int verbosity_level)
function void set_report_severity_action
(uvm_severity severity,uvm_action action)
function void set_report_id_action
(string id,uvm_action action)
function void set_report_severity_id_action
(uvm_severity severity,string id,uvm_action action)








(S)Example


Lets see an example:

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 "uvm.svh"
import uvm_pkg::*;

class rpting extends uvm_component;

`uvm_component_utils(rpting)

function new(string name,uvm_component parent);
super.new(name, parent);
endfunction

task run();

uvm_report_info(get_full_name(),
"Info Message : Verbo lvl - UVM_NONE ",UVM_NONE,`__FILE__,`__LINE__);

uvm_report_info(get_full_name(),
"Info Message : Verbo lvl - UVM_LOW ",UVM_LOW);

uvm_report_info(get_full_name(),
"Info Message : Verbo lvl - 150 ",150);

uvm_report_info(get_full_name(),
"Info Message : Verbo lvl - UVM_MEDIUM",UVM_MEDIUM);

uvm_report_warning(get_full_name(),
"Warning Messgae from rpting",UVM_LOW);

uvm_report_error(get_full_name(),
"Error Message from rpting \n\n",UVM_LOW);
endtask

endclass

module top;

rpting rpt1;
rpting rpt2;
rpting rpt3;

initial begin
rpt1 = new("rpt1",null);
rpt2 = new("rpt2",null);
rpt3 = new("rpt3",null);

rpt1.set_report_verbosity_level(UVM_MEDIUM);
rpt2.set_report_verbosity_level(UVM_LOW);
rpt3.set_report_verbosity_level(UVM_NONE);
run_test();


end
endmodule

(S)Download the source code


uvm_reporting.tar
Browse the code in uvm_reporting.tar


(S)Command to run the simulation


VCS Users : make vcs
Questa Users: make questa



(S)Log file:

UVM_INFO reporting.sv(13)@0:rpt1[rpt1]Info Message:Verbo lvl - UVM_NONE
UVM_INFO @0:rpt1[rpt1] Info Message : Verbo lvl - UVM_LOW
UVM_INFO @0:rpt1[rpt1] Info Message : Verbo lvl - 150
UVM_INFO @0:rpt1[rpt1] Info Message : Verbo lvl - UVM_MEDIUM
UVM_WARNIN@0:rpt[rpt1] Warning Messgae from rpting
UVM_ERROR @0:rpt1[rpt1] Error Message from rpting


UVM_INFOreporting.sv(13)@0:rpt2[rpt2]Info Message:Verbo lvl - UVM_NONE
UVM_INFO@ 0:rpt2[rpt2] Info Message : Verbo lvl - UVM_LOW
UVM_WARNING@0:rpt2[rpt2] Warning Messgae from rpting
UVM_ERROR@0:rpt2[rpt2] Error Message from rpting


UVM_INFOreporting.sv(13)@0:rpt3[rpt3]Info Message:Verbo lvl - UVM_NONE
UVM_ERROR @ 9200 [TIMOUT] Watchdog timeout of '23f0' expired.


Index
Introduction
Uvm Testbench
Uvm Reporting
Uvm Transaction
Uvm Configuration
Uvm Factory
Uvm Sequence 1
Uvm Sequence 2
Uvm Sequence 3
Uvm Sequence 4
Uvm Sequence 5
Uvm Sequence 6
Uvm Tlm 1
Uvm Tlm 2
Uvm Callback

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright 2007-2017 :: all rights reserved www.testbench.in::Disclaimer