In reply to Mandar_Thete:
Hi all,
Please find a working example ready to run, given below…
the same can be ported to uvm using ovm2uvm.pl
refer OVM2UVM | Verification Academy for the details.
tested on ovm 2.1.2 and uvm 1.1d using the above method.
Feel free to provide your valuable feedbacks.
import ovm_pkg::*;
module display;
initial begin
run_test(“my_test”);
end
initial #100 ovm_top.stop_request();
endmodule:display
class my_test extends ovm_test;
`ovm_component_utils(my_test)
int fh,fh1;
function new (string name , ovm_component parent);
super.new(name, parent);
endfunction:new
virtual task run();
fh = $fopen (“my_test_fh.log”,“w”); // opening two text files
fh1= $fopen (“my_test_fh1.log”,“w”);
set_report_default_file(fh1); // setting default write file as fh1
`ovm_info(get_name(),“Hello world”,OVM_LOW) // this will be printed only to terminal/ simulation log
// since ‘set_report_severity_action’ is not yet set
$fdisplay(fh,“fdisplay - Hello world”); // will be written irrespective of ‘set_report_*’ setting
set_report_severity_action(OVM_INFO, OVM_LOG); // redirecting `ovm_info ony to text file
ovm_info(get_name(),"My world",OVM_LOW) // will be in text file my_test_fh1.log $fdisplay(fh,"fdisplay - My world"); set_report_default_file(fh); // setting default to fh, here after all
ovm_info woll be
// directed to fh
// instead of fh1
set_report_severity_action(OVM_INFO, OVM_LOG | OVM_DISPLAY ); // setting `ovm_info to be directed to my_test_fh.log
// and to terminal/ simulation log
$fdisplay(fh1,“fdisplay1 - My world”);
`ovm_info(get_name(),"My last world :-) ",OVM_LOW) // will be in text file my_test_fh.log
// and in terminal/ simulation log
$fclose(fh);
$fclose(fh1);
endtask:run
endclass:my_test
regards,
Sachin Scaria