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:
…and here’s the 2 tests we use to verify the error and warning are triggered properly:
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:
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…
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
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
I can confirm that it’s working now.
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