Jump to content

How to change the print format used by UVM?


Recommended Posts

I need to dump the contents of a queue in my scoreboard. When the queue is large and the items in the queue have a lot of properties, the report becomes very large and hard to parse. This is because the default UVM print format is table.

    foreach(my_q[i]) begin
      `uvm_info("REPORT", $sformatf("my_q[%0d]:\n%s",
        i, my_q[i].sprint()), UVM_LOW)
    end

I'm interested in printing each item on a single line. How do I accomplish the following:

  1. Change the format from the command line?
  2. Change the default format that is used by my whole scoreboard?
  3. Change the format that is used only by the method that is dumping the queue contents?

You can edit and re-run the simple example of this issue here: http://www.edaplayground.com/s/4/656

Link to comment
Share on other sites

I updated your code.  
This is the quickest way of using the default printers classes:

`uvm_info("REPORT", $sformatf("my_q[%0d]:\n%s",
        i, my_q[i].sprint(uvm_default_line_printer)), UVM_LOW)
 // the uvm_default_printer is the uvm_default_table_printer,  you can change it globally or pass one these declared printer classes:
uvm_default_table_printer
uvm_default_line_printer
uvm_default_tree_printer

I updated your code with the uvm_default_line_printer call and it works.

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...