How to use 'assert' and 'report'

Z

ZHIQUAN

Guest
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?
 
ZHIQUAN wrote:
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
 
On Apr 24, 6:54 pm, Mike Treseler <mike_trese...@comcast.net> wrote:
ZHIQUAN wrote:
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
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
 

Welcome to EDABoard.com

Sponsor

Back
Top