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)

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

Share this post

Link to post
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:

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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now