Jump to content

How to control the print verbosity of print function?


Recommended Posts

If I use uvm_report_xxx function , I can use set_report_verbosity_level to control what I want to print. But when I call print function to print the variable with field automation, I can't find any way to disable the print except to comment the function . Please give some recommend for this . Thanks.

Link to comment
Share on other sites

Use sprint() instead of print(), which will return a string with the formatted printout, and then use uvm_report_info() to print that string.

Actually, you should use the `uvm_info macro, and embed the sprint() call within the macro arguments. The macro will avoid the overhead of evaluating the message expression (your sprint() call) if the message isn't going to print because of the verbosity level.

I've never used print(), for precisely the reason that you can't control the verbosity of what gets printed.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...