Jump to content

Controlling the verbosity of `uvm_info

Recommended Posts

Hi All,

I am new to uvm and while I was writing the env for my dut I noticed something. `uvm_info is printing a lot of information which will be useful during debug but may not be useful while running regression.

UVM_INFO /my_dut/tb/src/test/my_test.sv(55) @ 134500 : uvm_test_top [MY_TEST] test passed

The info like from which file, which line, the message is coming from is useful while debug. But it may increase the load and make a bigger logfile.

Is the a method to turn off those parts of the message ? :confused:

Please help.

Thanks in advance

Sreenath V

Edited by sreenathws
Link to comment
Share on other sites

One thing to try is to override the default report server. If you have a common base class for tests, you can replace the standard report server in the base test constructor, for example:

function Test::new(string name, uvm_component parent);
super.new(name, parent);
  MyReportServer mySrv = new();
  uvm_report_server srv = get_report_server();
endfunction: new

MyReportServer can take over the message formatting, test summary, and other things, for example:

class MyReportServer extends uvm_report_server;

  // my own test summary:
  function void summarize(UVM_FILE file);
    int n = get_severity_count(UVM_FATAL);
    n += get_severity_count(UVM_ERROR);
    n += get_severity_count(UVM_WARNING);
    `uvm_info("STATUS", {"** TEST ", n ? "FAIL" : "PASS", "ED **"}, UVM_NONE);
  endfunction: summarize
  // get rid of the file name in diagnostics:
  function string compose_message
    uvm_severity severity, string name, string id,
    string message, string filename, int line
    return super.compose_message(severity, name, id, message, "", 0);
  endfunction: compose_message
  // get rid of the TEST_DONE message:
  function void process_report
    uvm_severity severity, string name, string id,
    string message, uvm_action action, UVM_FILE file,
    string filename, int line, string composed_message,
    int verbosity_level, uvm_report_object client
    if (id == "TEST_DONE") action -= UVM_DISPLAY;
    super.process_report(severity, name, id, message, action,
      file, filename, line, composed_message, verbosity_level, client);
  endfunction: process_report
endclass: MyReportServer

Hope this helps.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...