Hi, all
My requirement is to print by default using factory method when UVM_DEBUG verbosity is passed and to print in customized format when other verbosity is passed, so i used below code to fullfil this criteria,
function void dps_cmd_pkt::do_print(uvm_printer printer);
super.do_print(printer);
// assemble_cmd();
$value$plusargs("UVM_VERBOSITY=%s", verbosity);
if(verbosity != "UVM_DEBUG")begin
if(printer.knobs.sprint == 0)begin
uvm_report_info ("do_print", convert2string(), UVM_LOW);end
else begin
printer.m_string = convert2string();
end
end
here in convert2string method returns custom print format which i have override in this class.
Now my problem is in the test i have taken two instance one is dps_cmd_pkt class and other is ahb_monitor_item class and print this two class.
dps_cmd_pkt.print();
ahb_mon_item.print();
so for dps_cmd_pkt class print works fine and displays custom format which i want, but for ahb_mon_item this test print the same string which is for dps_cmd_pkt(NOTE: ahb_mon_item doesn’t have do_print in class function definition).
this is happening for all objects which hasn’t do_print method and calls after the object.print which has do_print method.
Please help me !!!