# How to make error flags of \*E and \*W become UVM\_ERROR and UVM\_WARNING?

**URL:** <https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813>\
**Category:** UVM\
**Tags:** UVM, assert, randomization-error, error-flags\
**Created:** [May 12, 2016, 10:38am UTC](https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813 "2016-05-12T10:38:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reuben](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/reuben/32/1409_2.png) [@Reuben](https://verificationacademy.com/forums/u/Reuben)\
**Post date:** [May 12, 2016, 10:38am UTC](https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813/1 "2016-05-12T10:38:32Z")

</div>

Is there a way to make the error flags of \*E and \*W to become UVM\_ERROR and UVM\_WARNING, respectively?  
\*E and \*W are being flagged whenever I’m having a randomization failure. My testcase is passing even though it sees these \*E and \*W because no UVM\_ERROR and UVM\_WARNING are reported.

I’m thinking to put an else statement together with the assert statement during randomization. And then I will put `uvm\_error on that else statement.  
However, this will take time because I used lots of assert statements when I do randomization.  
So, is there a way to quickly flag a UVM\_ERROR when it sees \*E?

Thanks.

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [May 12, 2016, 12:10pm UTC](https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813/2 "2016-05-12T12:10:03Z")

</div>

_In reply to [Reuben](https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813):_

Could you please explain what is \*E and \*W?

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [May 12, 2016, 1:47pm UTC](https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813/3 "2016-05-12T13:47:45Z")

</div>

_In reply to [chr\_sue](https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813/2):_  
\*E and \*W are tool specific generated error and warning messages. Catching tool generated messages is going to be tool specific.

The problem here is the test writer was lazy and did not check the return status of a call to randomize. (Don’t ignore those warnings when you call a function with a return value as a statement instead of using it an expression). Same for $cast and using the action block of an assertion.

---

<div class="post-metadata">

**Author:** ![Reuben](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/reuben/32/1409_2.png) [@Reuben](https://verificationacademy.com/forums/u/Reuben)\
**Post date:** [May 12, 2016, 3:03pm UTC](https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813/4 "2016-05-12T15:03:35Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/how-to-make-error-flags-of-e-and-w-become-uvm-error-and-uvm-warning/31813/3):_

Actually I thought it would automatically flag TEST FAILED when \*E is seen. In my previous compnay that’s what was happening. No need to put `uvm\_error in the else statement and the test will automatically fail.

I think maybe the CAD engineers in my previous company did something on the script or something else. I don’t know. At first I thought it was a UVM setting. But as you mentioned, it is a tool specific.

Anyway, thanks for the help. I will try to ask Cadence about it. This setting can be useful to me or to the company in the future. Some engineers might accidentally forget checking the return value of functions. So it is good to have a check on these \*E and \*W.
