Jump to content

any way to set different default printer for local class?


Recommended Posts

Hi,

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?

Link to comment
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).

Link to comment
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.

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