Hardware Reference
In-Depth Information
$asserton
j $assertoff
j $assertkill
list_of_scopes_or_assertions ::= scope_or_assertion , {scope_or_assertion}
scope_or_assertion ::=
scope_identifier
j assertion_identifier
j hierarchical_identifier
The levels argument is a nonnegative integer constant. When set to 0, it applies to
all the items on the list_of_scopes_or_assertions and all the scopes below. When set
to 1, it applies only to the items in the current scope but not to the hierarchy under it.
When set to some n>1 , it applies to the items and to n-1 levels of hierarchy below.
Of course, if the item is a full hierarchical path to an assertion, the task applies only
to that assertion since there are no levels below.
7.3.2
Tasks for Controlling Action Blocks
Assertions have optional action blocks (Chap. 4 ), that is, blocks of procedural code
that are executed when the assertion attempt succeeds (pass action block) or fails
(fail action block). In the case of covers, only the pass action block is available
because cover failure is not interesting. The following example shows a concurrent
assertion a and a concurrent cover c , each with action blocks.
Example 7.35.
a: assert property (p1)
begin // pass action block
process_pass();
$info("assertion PASSED");
end
else begin // fail action block
process_failure();
$error("assertion FAILED");
end
c: cover property (p2)
begin // pass action block
process_cover();
$info("COVERED");
t
end
By default, the action blocks execute on every success and failure of the assert
and cover statements. This behavior may not be desirable, for example, when the
property passes vacuously or when running massive regression tests where only
failures should be reported.
SystemVerilog provides several tasks for controlling the execution of action
blocks:
Search WWH ::




Custom Search