How to print a data item?

How can i print the data item/transaction by using 'uvm_info or uvm_report_info.

I know that we can print it like obj.print(), but i wanted print the data item by using either 'uvm_info or uvm_report_info so that i can print them by using verbosity level when ever i wanted.

Please help. Thannks in advance.

Ravi.

Yes you can Print Object in`uvm_info or report method using sprint() method.

`uvm_info({get_type_name," : ID"},$psprintf("Printing Object \n %s",obj.sprint()),UVM_HIGH)

It also work with UVM Report method(which is not recommended to use)

Regards,
Vinay Jain

In reply to Vinay Jain:

Yeah it is working…Thank you Vinay

In reply to ravi_1822:

One comment is that $psprintf() is not part of the official SystemVerilog LRM, although most simulators will support it. $sformatf() is the appropriate function to use.