UVM Report Mock Update

Get the latest version of SVUnit from GitHub

[CSSBUTTON target=”https://github.com/nosnhojn/svunit-code/archive/master.zip” color=”000000″ textcolor=”ffffff” float=”left”

newwindow=”true”]Download SVUnit[/CSSBUTTON]

I’ve had some good feedback from a couple fellows using the report mock and today I released a new version to start incorporating it. SVUnit v1.4

includes a new UVM report mock.

Two significant changes…

First is that the macros are no longer required. It uses UVM facilities to eventually intercept the global uvm_report_(warning|error|fatal) functions. Logging messages with those globals directly or by using the stock `uvm_* macros both work the same now. Both can be verified using the mock. I’ve expanded the example that’s shipped with SVUnit to demonstrate. Here’s a snapshot of that code that shows our UUT using both the `uvm_error() macro and uvm_report_warning() function:

Screen Shot 2013-05-17 at 10.01.13 AM

…and here’s the 2 tests we use to verify the error and warning are triggered properly:

Screen Shot 2013-05-17 at 10.01.32 AM

Screen Shot 2013-05-17 at 10.01.46 AM

Thanks to my colleague Jean-Marc Tremblay for handling this part of the upgrade.

Second change… with the initial mock, when something went awry and your logging doesn’t match up, the mock told you as much… but only by returning false via the verify_complete(). I didn’t have anything to help people diagnose why, but now I do. In v1.4, when the verify_complete() fails the mock dumps the expected and actual messages it’s logged so far. That dump looks like this:

Screen Shot 2013-05-17 at 9.59.26 AM

You get the expected and actual ID, MSG and severity at each index. So this dump from the mock would tell you, for example, that the error and fatal you were expecting were logged in the wrong order (i.e. you expected fatal then error, but you got error then fatal).

Last change… I had the order of the ID and MSG mixed up in the original so if you simply plugin this new version, I expect you’ll see a lot of failures (in UVM, the argument order is ID then MSG but I had MSG then ID). To clarify, prototypes for the expect functions are now…

Screen Shot 2013-05-17 at 10.13.34 AM Screen Shot 2013-05-17 at 10.13.24 AM Screen Shot 2013-05-17 at 10.13.14 AM

This won’t match what you have now, so unfortunately you’ll have to go back and swap the arg order. Sorry about that :(.

If you’re new to the UVM report mock, you catch up with my original post from a few weeks ago.

Enjoy!

-neil

3 thoughts on “UVM Report Mock Update

  1. Oops! I initially had v1.3 in the blog but have replaced with with v1.4. Version v1.3 was bad so it’s gone from sourceforge 🙂

    -neil

  2. good to hear. since you’re the guy that asked for the dumped debug output, I’ll leave it to you to judge whether or not it’s done to spec 😉

    -neil

Leave a Reply to Anonymous Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.