suleesh Posted July 27, 2011 Report Share Posted July 27, 2011 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 Quote Link to comment Share on other sites More sharing options...
adielkhan Posted July 27, 2011 Report Share Posted July 27, 2011 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 Quote Link to comment Share on other sites More sharing options...
Roman Posted September 1, 2011 Report Share Posted September 1, 2011 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. Quote Link to comment Share on other sites More sharing options...
abhijitmit Posted January 29, 2012 Report Share Posted January 29, 2012 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..??? Quote Link to comment Share on other sites More sharing options...
uwes Posted January 30, 2012 Report Share Posted January 30, 2012 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 Quote Link to comment Share on other sites More sharing options...
Roman Posted January 30, 2012 Report Share Posted January 30, 2012 Try following? uvm_report_global_server glob = new(); Quote Link to comment Share on other sites More sharing options...
abhijitmit Posted February 2, 2012 Report Share Posted February 2, 2012 Thanks Roman and Uwes. new() is working for me. -abhijitmit Quote Link to comment Share on other sites More sharing options...
janick Posted February 6, 2012 Report Share Posted February 6, 2012 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(). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.