Jump to content

Recommended Posts

Posted

Hi,

I have my top env extended from uvm_env. I want to get the handle to uvm_report_server from this top env so that i can use the get_severity_count for reporting the no of UVM_ERROR etc. How can I access the get_severity_count from my report function? I am usinh UVM 1.1 version.

I am adding my code here.

function void report();

uvm_report_server reportServer;

//reportServer = m_rh.m_glob.get_server(); // This is how I used to access the handle in UVM EA. This does not work with UVM 1.1 Please tell me how can I access in UVM1.1

$display("");

$display("---Test Summary---");

$display("");

$display("");

report_header();

report_summarize();

$display("");

"

$display("---Final Test Status---");

assert(reportServer.get_severity_count(UVM_FATAL) == 0 && reportServer.get_severity_count(UVM_ERROR) == 0) begin

assert(reportServer.get_severity_count(UVM_WARNING) == 0) begin

$display("");

$display("***PASSED***");

$display("");

end

else begin

$display("");

$warning("***WARNED***");

$display("");

end

end

else begin

$display("");

$error("***FAILED***");

$display("");

end

endfunction

Posted

HI,

If you want the code to look like EA then you could do:

     uvm_report_global_server glob = new;
    uvm_report_server serv;
    serv = glob.get_server();

Although you can simplfy by using:

     uvm_report_server serv = uvm_report_server::get_server();

Also, you probably have somewhere done:

     
    uvm_report_global_server glob = new;
    my_server serv;
    glob.set_server(serv)

This can now become:

     
    my_server serv ;
    uvm_report_server::set_server(serv);

-adiel

  • 1 month later...
Posted

Hi suleesh,

Here is an example for you.

function void report_phase(uvm_phase phase);

uvm_report_server svr;

super.report_phase(phase);

svr = uvm_report_server::get_server();

if (svr.get_severity_count(UVM_FATAL) +

svr.get_severity_count(UVM_ERROR) +

svr.get_severity_count(UVM_WARNING) > 0)

`uvm_info("final_phase", "STATUS: Failed", UVM_LOW)

else

`uvm_info("final_phase", "STATUS: Passed", UVM_LOW)

endfunction

The above example code shows it being done in the report_phase of UVM, as it is

the most suggested phase to finally declare the simulation as Passed/Failed.

  • 4 months later...
Posted

Hi all,

I am new to UVM.

I wanted to declare a test pass/fail deping the number of UVM Error.

Depending on the above discussion,I copied your code.

function void usb_mod_env::report_phase(uvm_phase phase);

super.report_phase(phase);

$system("echo \"report() is called from env\"");

uvm_report_global_server glob = new;

uvm_report_server svr;

svr = glob.get_server();

if (svr.get_severity_count(UVM_FATAL) + svr.get_severity_count(UVM_ERROR) + svr.get_severity_count(UVM_WARNING) > 0)

`uvm_info("final_phase", "STATUS: Failed", UVM_LOW)

else

`uvm_info("final_phase", "STATUS: Passed", UVM_LOW)

endfunction :report_phase

But ,getting the following error,

near "glob": syntax error, unexpected IDENTIFIER, expecting #

Any clues wat happening..???

Posted

hi,

hard to guess without seeing the full error message including line/column info (and seeing if this is a compile/runtime error). another strange thing is the the $system just to print something - hope you want to do more than that right??

/uwe

Posted

Avoid using the new()-based approach. It is a hold over from OVM when some simulators were unable to properly implement the singleton pattern.

Use svr = uvm_report_server::get_server();

Your syntax error is caused by declaring a variable in the statement block. Move your variable declation to before the call to super.report_phase().

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.

Guest
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...