How can I enable the tool to recognize deferred immediate assertions? It seems to ignore #0 and print errors when state is not stable yet.
assert_checkout_0: assert #0 (state == 2'b00 && out == 1'b1) $info ("state 00/10 has a good out value.");
else $error ("state 00/10 has bad out value.");
Use the assert final instead o the assert #0/ Thus
assert_checkout_0: assert final (state == 2'b00 && out == 1'b1) $info ("state 00/10 has a good out value.");
else $error ("state 00/10 has bad out value.");
(From my SVA book} to prevent race conditions between the assertion and the value being tested, IEEE 1800 introduced the concept of deferred assertions, which are a kind of immediate assertion. They can be used to suppress false reports that occur due to glitching activities on combinational inputs. Since deferred assertions are a subset of immediate assertions, the term deferred assertion (often used for brevity) is equivalent to the term deferred immediate assertion. The term simple immediate assertion refers to an immediate assertion that is not deferred.
A deferred assertion is similar to a simple immediate assertion, but with the following key differences:
Syntax: Deferred assertions use #0 (for an Observed deferred assertion) or final (for a final deferred assertion in the Postponed region) after the verification directive.
Deferral: Reporting is delayed rather than being reported immediately.
Action block limitations: Action blocks may only contain a single subroutine call.
Use outside procedures: A deferred assertion may be used as a module_common_item.
Thank you for your suggestion and explanation. Unfortunately, I get an syntax error for using final. It does not seem to work for ModelSim. Michael
Model Technology ModelSim DE vlog 10.2c Compiler 2013.07 Jul 18 2013
# -- Compiling module one_hot
# ** Error: one_hot.sv(42): near "final": syntax error, unexpected "final".
# ** Error: C:/modelsim_dlx_10.2c/win32pe/vlog failed.
# Error in macro ./run.do line 7
# C:/modelsim_dlx_10.2c/win32pe/vlog failed.
# while executing
# "vlog -sv one_hot.sv"
assert_checkout_0: assert **final** (state == 2'b00 && out == 1'b1) $info ("state 00/10 has a good out value.");
else $error ("state 00/10 has bad out value.");