Thursday 2 June 2016

Be careful while writing UVM Report Messages


This blog is dedicated to helping you with implementing UVM message report mechanism in your testbench. During verification, everybody used to run multiple regressions to generate different scenarios. Most cases, we find errors while running regression which are reported as UVM_ERROR in the log file.

Due to limitation of time-line, we prefer to run the regression with “UVM_NONE” verbosity. But there may be a case when this regression result is not reliable.

Take an example, you have implemented a function for “crc_check” which checks the CRC value is expected or not. If it is not expected then prints an error message that “Received CRC is incorrect”. Here, some people prefer UVM macros for printing messages i.e.
`uvm_error(“crc_check”, “Received CRC is incorrect”)

But some people do not prefer to use macros. So they use UVM functions (uvm_report_*) for message reporting. So, we may write:
uvm_report_error(“crc_check”, “Received CRC is incorrect”);

There is no problem in NORMAL simulation. But a big problem arises when we simulate the test with UVM_NONE verbosity. Here is the problem:

Sometimes we become habitual by using “`uvm_error” macro in which verbosity is not required. UVM macro take care it internally. Note: Verbosity of `uvm_error is “UVM_NONE”. In “uvm_report_error” function, 3rd argument specifies the verbosity of that error message. Default value of that argument is “UVM_LOW”. In the above case, verbosity is not specified and running simulation with “UVM_NONE” verbosity. So, UVM will not report any error message in the log files and also in the summary message, you will not get any UVM_ERROR.

So, Congratulation!!! Your Test PassedJ.

But is it really passed? Or did you forget something in a hurry? Or Anyhow you want to make it pass? J

So, proper usage of “uvm_report_error” should be,

uvm_report_error(“crc_check”, “Received CRC is incorrect”, UVM_NONE);