Hardware Reference
In-Depth Information
//... await reset activity completed ...
@ck; //synchronize and start assertion from this tick
$asserton();
end
//... other code ..
endmodule
In this case, assertion a will start evaluation attempts starting from the moment
statement @ck unblocks.
What if the call to $asserton() were made in a program that executes in the
Reactive region as in this code snippet?
module m;
bit clk;
prg my_program();
default clocking ck @( posedge clk); endclocking
a: assert property ( ... some_property ...);
//... other code ..
endmodule
program prg;
initial begin
$assertoff();
//... await reset activity completed ...
@m.ck; //synchronize and start assertion from this tick
$asserton();
end
//... other code...
endprogram
Since the call is made from the Reactive region, the assertion is not yet enabled
when the evaluation of a is to start in the Observed region, the first evaluation of a
will only happen one clock tick later. Also, the $assertoff does not execute until
the Reactive region of time step 0, hence the assertion evaluation attempt at time 0
is enabled and will execute if there is a clock tick.
t
If the initialization phase is to be executed again later in the simulation, we should
again stop the assertions, but in that case we should consider using $assertkill .
It stops the subsequent evaluation attempts, and also any evaluation attempts that
have started earlier (that would still be continuing evaluation during the initialization
phase). Calling this task thus avoids failures of evaluation attempts that do not matter
anymore, even though they started during the“normal” design phase.
The above approach will work well if we need to stop all assertions, but what
if some assertions should run during the special phase? The tasks accept a list
of arguments that define the modules or scopes and the depth down to individual
assertions to which the task call applies. The argument list is of the same form as
for the well-known $dumpvars task:
assert_control_task :: D name[ ( levels[ , list_of_scopes_or_assertions] ) ] ;
name ::=
Search WWH ::




Custom Search