OVM Verbosity

The OVM Reference for OVM 2.0.1 seems unsure about how the ovm_report verbosity levels work. That is, the numerical values and even the names listed varies for different parts of the Reference. Looking in the code, I find these defaults for the different report functions in ovm_report_global.svh

  • ovm_report_info OVM_MEDIUM
  • ovm_report_warning OVM_MEDIUM
  • ovm_report_error OVM_LOW
  • ovm_report_fatal OVM_NONE

and these values are defined in ovm_report_defines.svh

  • OVM_NONE = 0,
  • OVM_LOW = 100,
  • OVM_MEDIUM = 200,
  • OVM_HIGH = 300,
  • OVM_FULL = 400,
  • OVM_DEBUG = 500

I find also the check_verbosity() function in ovm_root.svh that interprets the plusarg +OVM_VERBOSITY and sets verbosity for all (or most) reporter objects. This function is not described in the OVM Reference.

I’m thinking of basing my test bench verbosity controls around what I see in the ovm 2.0.1 code as described above. Will this be safe? That is, will the next release have the code change to match the Reference? or the Reference to match the code?

In 2.0.2 the reference manual is being changed to matched the code. Natural Docs will be used to generate the reference using comments inside the code. So, if you need the numerical values for some reason, the values inside the code are the safest to use.

As a side note, check_verbosity isn’t really intended to be a user visible function. It is called by ovm_root when the root object is constructed. The function (as you inferred) checks the command line verbosity setting and sets the root report object to use it; any subsequent components will inherit this setting (probably all report objects should inherit it, but right now only components inherit it).

john

Thanks John, That’s what I was looking for. I don’t intend to reference the numerical values for the standard verbosity levels; but I needed to know that the current enumerated types will remain - their values can change if you need to.

And on the check_verbosity() function, I don’t mean that I’ll have any dependencies on the function; but rather on the +OVM_VERBOSITY command line option.

Also, have there been any discussions about more detailed control? In most cases I don’t want to see ALL of the OVM_HIGH messages throughout the test bench; but only those from a bfm or scoreboard or other block. Maybe a way on the command line to specify the string name for an object and adjust the verbosity level for that object?

George

Hi George,

This hasn’t really been discussed much. I have talked with some people about it in the past. The main problem is that the plusarg mechanism isn’t really great for this. You always get the first match, so to provide something from a plusarg, it would be necessary to have some big plusarg that had all the info (unless something was done via vpi).

Another possibility would be to provide a plusarg that gives a side file (something like +OVM_VERBOSITY_SETTINGS=). This would be pretty easy to implement, but requires to user to deal with some special file format.

Maybe you have some better idea how this could be done :)

john

Hi John, I haven’t. I agree that a seperate file would be easy; but a little cumbersome in usage. I’ll think more on it.

George

Hi,
I’m new to OVM so I have a question about severities and verbosities.
My understanding so far is:
There are 4 possibilities for reporting: info,warning,error & fatal.

I can choose which of the reports will be printed with the help of the +ovm_verbosity plusarg.
If I choose NONE, it prints only fatal reports.
If I choose LOW, it prints fatals and errors.
If I choose MEDIUM, it prints all 4 types.

So what’s the advantage of using HIGH, FULL and DEBUG then?:confused:
There are also printing info,warning,error and fatal, aren’t they?

Hi blue,

The calls to ovm_report_* can include a parameter to change the verbosity to those extra OVM_HIGH, OVM_FULL, or OVM_DEBUG. I wouldn’t change the verbosity for ovm_report_error, or _fatal, or _warn. If you do, other users could get confused as to why the error messages aren’t appearing. Also, I wouldn’t set +ovm_verbosity below ovm_medium for the same reason.

You can then use ovm_report_info(…,OVM_HIGH or OVM_FULL) to get more detailed messages from your test bench for debug. Internal OVM code uses OVM_DEBUG, so I would avoid that one as well.

George

So OVM provides 3 “fixed” report functions and 1 that I can change by myself, instead of giving thousands of different report functions (like VMM). This makes sense.

Thanks for your explanation.:)

I’ve decided it’s time to add some control to displaying OVM_HIGH messages in my test bench; but I can’t quite work out how to use the existing functions. The following turns on all OVM_HIGH messages of course, but gives way to many messages.
set_report_verbosity_level(OVM_HIGH);

I really want to turn on OVM_HIGH messages for certain report ids. I don’t see a function for doing this. The following call turns off all messages for the specified report id (where report_id is a string, of course)
set_report_id_action(report_id, OVM_NO_ACTION);

I was hoping that the following would likewise turn on all messages including those of verbosity OVM_HIGH for report_id – but it does not
set_report_id_action(report_id, OVM_DISPLAY);

In the OVM_Reference for 2.0.2, the description for … includes this
An action associated with a particular severity-id pair takes precedence over an action associated with id, which take precedence over an an action associated with a severity.

I interpreted this to mean that set_report_id_action would override the default set for severity (OVM_INFO in this case); but it apparently does not include that.

A more cumbersom option would be to add code to every object to set its report server to verbosity OVM_HIGH when we need that. I was hoping to do this at a global level.

Any ideas of how to do that?

George

By the way, the code I’m using to try this out is here – and I’m using OVM 2.0.2

if ($value$plusargs("report_id_display_high=%s",report_id_display_high) != "") 
      begin
        ovm_report_info(report_id, $psprintf("report_id_display_high value is %s", report_id_display_high));
     //   set_report_verbosity_level(OVM_HIGH);
        set_report_id_action(report_id_display_high, OVM_DISPLAY); //OVM_NO_ACTION OVM_DISPLAY
      end
        ovm_report_info("GG_bus_read", "test message DEFAULT");
        ovm_report_info("GG_bus_read", "test message OVM_HIGH",OVM_HIGH);
        ovm_report_info("GG_no_id", "test message no_id DEFAULT");
        ovm_report_info("GG_no_id", "test message no_id OVM_HIGH",OVM_HIGH);

The GG_no_id messages are to ensure that only the specified report id is affected.

Hi George,

The reporting stuff kind of works backwards from what you are wanting.

The verbosity is associated with a specific report object (components happen to be report objects).

Verbosity is the first level of control, if the verbosity level of a report object is lower than the verbosity level of the incoming message, then that message is filtered before there is any chance for actions to be looked at.

Once you get through the verbosity filter, the message gets sent on to the report handler to check actions associated with the id tag and the severity.

Unfortunately, today, there is no wildcard settings for the tags, so you need to know the explicit tag to control things.

I think you can get the control you want by doing something like:

  set_report_verbosity_level_hier(OVM_FULL);
  set_report_severity_action_hier(OVM_INFO, OVM_NO_ACTION);
  set_report_id_action_hier("mymessage", OVM_DISPLAY);

Note, however, that this will have a performance impact. Typically users will check verbosity before doing significant message string formatting. The above code is essentially turning off the verbosity filter and making it useless, so all messages will have to get formatted. Then, there is the additional impact of the action lookups (these are just associative arrays so the performance of a lookup is pretty fast, but still non-zero).

I am not sure if this quite does what you want. Let me know.

john

Thanks John, No this seems cumbersome. I was hoping to find a function like
set_report_id_verbosity_level(“report_id”,OVM_HIGH);

For now, I can put some $test$plusargs in some key components that I want to turn up verbosity for and use this in start_of_simulation for each component.
set_report_verbosity_level(OVM_HIGH);

Does it seem like a reasonable enhancement request to get a set_report_id_verbosity_level function? I was suprised that there wasn’t one there already.

George

In the meantime, I’ve added this code to one of my components where I would like to turn on and off verbosity. I’ll add it to other components as I need them.

report_id = "ahb_driver";
    if ($value$plusargs({report_id,"_verbosity=%s"},verbosity_level) != "")
       if (verbosity_level=="ovm_high" | verbosity_level=="OVM_HIGH" | verbosity_level=="HIGH" | verbosity_level=="high")
         set_report_verbosity_level(OVM_HIGH);
       else
         ovm_report_error(report_id, $psprintf("%s_verbosity %s not recognized - must be ovm_high, OVM_HIGH, high, or HIGH", report_id, verbosity_level));

With this code in the ahb_driver.start_of_simulation, I can add this to the simulation call - which is similar to what I’m looking for
+ahb_driver_verbosity=OVM_HIGH

It’s just that I have to implement that code in any component where I want to control verbosity.

George

George,

Another thing you can do is use the verbosity argument associated with each message, using a completely different scheme to filter messages. There’s no need to use the defaults that come with ovm_report_*