Print severity in UVM

Hi,

I am working on print optimization in a log.
I want to disable all the .print() calls in the verification environment.
There could be two solutions.

  1. Have verbosity in the .print method. - Is there any knob in .print method for that.
  2. I would like to have test command line switch that can disable that for me.

Please assist.

In reply to anurag7883:

The UVM is providing to you a very powerful reporting mechanism with the corresponding macros. This includes the verbosity.
The simple print method does not have this.

In reply to chr_sue:

In reply to anurag7883:
The UVM is providing to you a very powerful reporting mechanism with the corresponding macros. This includes the verbosity.
The simple print method does not have this.

To print a whole class_members we can’t use those reporting mechanism.
While building the environment those prints were required.
Now env is stable. we need not see all members… But going and changing them to a report mechanism should not be a effective way.
I am asking if UVM has given any hack to this problem or we can make a hack with relatively less effort?

In reply to anurag7883:

I think .print() is SystemVerilog’s built in class function, not UVM feature. So, I don’t think you can control it by UVM.
You can control log printing by UVM feature if you replace all your .print() printing part with the following.

`uvm_info( Message id name, Your class instance name.sprint(), UVM_NONE/LOW/MEDIUM/HIGH/FULL/DEBUG)

In reply to serizawa:

In reply to anurag7883:
I think .print() is SystemVerilog’s built in class function, not UVM feature. So, I don’t think you can control it by UVM.
You can control log printing by UVM feature if you replace all your .print() printing part with the following.
`uvm_info( Message id name, Your class instance name.sprint(), UVM_NONE/LOW/MEDIUM/HIGH/FULL/DEBUG)

Thanks, I appreciate the solution.
It helps me set the guideline to the team for code in this manner now on…
But, it would not reduce the work as we need to change all the .print calls individually.

Just to add on what I know is %p is used in SV to print a class. In UVM print is a defined virtual method like copy and compare in uvm_object class.

In reply to anurag7883:

F.Y.I

UVM Message Display Commands - Capabilities, Proper Usage and Guidelines

  1. transaction.print() -vs- transaction.sprint()
  2. convert2string()

In reply to serizawa:

In reply to anurag7883:
F.Y.I
UVM Message Display Commands - Capabilities, Proper Usage and Guidelines

  1. transaction.print() -vs- transaction.sprint()
  2. convert2string()

Thanks a lot for the reference.
I get to understand I don’t have any short way to do it.
Environment must be changed and should follow the above guideline to have better control ability and less simulation time.