How to use 'assert' and 'report'

Z

ZHIQUAN

ex: assert(clear/='1') or (preset/='1')
report "Both preset and clear are set !"
severity warning

Does the 'report' statement can get a output with content 'Both...set'
if the assert is activated. I am trying to use it but nothing output.
Where the output will be shown?
 
M

Mike Treseler

ZHIQUAN said:
ex: assert(clear/='1') or (preset/='1')
report "Both preset and clear are set !"
^^^^
Neither
severity warning

Does the 'report' statement can get a output with content 'Both...set'
if the assert is activated. I am trying to use it but nothing output.
Where the output will be shown?

To standard output -- usually the simulator command line.
But the assertion report only occurs if the assertion *fails*
Looks like you may have this backwards.
Note also that synthesis tools ignore all of this.

-- Mike Treseler
 
A

Andy

To standard output -- usually the simulator command line.
But the assertion report only occurs if the assertion *fails*
Looks like you may have this backwards.
Note also that synthesis tools ignore all of this.

-- Mike Treseler

Just don't do something stupid like I once did, and put a semicolon
after the asserted expression!

"Report" is also a stand-alone statement that also echoes out to the
terminal (or log file), with no condition at all.

I scratched my head for an embarrassingly long time once trying to
figure out why my assertion was firing!

It wasn't, but I had an unintentional "report" statement that was
spewing out an "error" message right behind it.

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top