Jump to content
Sign in to follow this  

any way to set different default printer for local class?

Recommended Posts


I have multiple scoreboards.

For each, I would like all the output to go to a locally-specified file.

For example, scoreboard1 would output to 'scoreboard1.log', scoreboard_fred to 'scoreboard_fred.log'.

However, there doesn't seem to be a way to redirect all output within a class and still use the `uvm_info/debug/warn/err macros.

Have I missed anything?

Share this post

Link to post
Share on other sites

Are scoreboard1 and scoreboard_fred different classes?

You can always extend 1 of the 3 printers (uvm_table_printer, uvm_line_printer, uvm_tree_printer) in any class. That would be their local printer. You have to instantiate in a higher class but you can use it based on the class. The class should be a uvm_object not a component, so you probably want to do something in the object class based on which scoreboard. The uvm_object class allows you to reference data automation with the factory -- and all the Policy Based Classes use this information (Print, Clone, Record ...)

You can also extend any default or defined printer with the do_print call back. This allows you to override or change the output. It will always be called, whereas -- if you define a new printer, it needs to be allocated and passed to obj.print or obj.sprint where obj is a data object class.

mcd is in the knob class (associated with any defined printer). This allows you to redirect output to a file. The standard output is the simulator output file (like log files, etc).

Share this post

Link to post
Share on other sites

scoreboard1 and scoreboard_fred are two different classes. Ideally, I'd have a scoreboard_base class, that each scoreboard would derive from.

But I'm not clear how this would really solve my problem. Let's say that the scoreboard creates an instance (or a copy) of an incoming sequence-item, and then wants to print it.

I want the print functions in the seq-item to use the locally-defined printer (so that the seq-item output goes to the file defined by the scoreboard).

But I don't see a way to do that.

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
Sign in to follow this