Hardware Reference
In-Depth Information
10
20
30
40
50
60
70
80
90
100
clk
reset
a
b
Fig. 13.2
Waveform for a_disable
The attempt that begins at time 40 is also disabled. Exactly when it is disabled
depends on the behavior of reset at time 40. According to the waveform, the
sampled value of reset at time 40 is 1'b1 , but a disable condition is evaluated
using current values, not sampled values. If the value of reset remains 1'b1 until
the beginning of the assertion evaluation attempt at time 40, then that attempt
is preempted at time 40. Otherwise, the attempt is disabled by the brief, glitchy
transition to 1'b1 of reset at time 55. 1 Again, because of the preemption, this
attempt neither passes nor fails, even though, in the absence of the disable clause,
the evaluation of the underlying property would have passed at time 60. The attempts
that begin at times 60, 80, and 100 are not disabled. The first fails at time 80, the
second passes at time 100, and the third passes vacuously at time 100.
To avoid preemption on glitches in the disable condition, such as the pulse at
time 55 in Fig. 13.2 , $sampled can be used to force evaluation using only sampled
values. Suppose that Line 2 of Fig. 13.1 is changed to
disable iff ($sampled(reset))
The disable condition is still monitored continuously, but the use of $sampled
means that, in any time step, only the sampled value of reset is relevant, and
this value is persistent throughout the time step. As a result, the glitch in reset
at time 55 is no longer visible to the disable condition. And the behavior at time 40
is more predictable: the sampled value of reset at time 40 is 1'b1 , which persists
as the sampled value throughout the time step and preempts the attempt beginning
at time 40.
A disable clause may be specified within the declaration of a named property.
The disable clause must follow any local variable declarations (see Sect. 16.1 ). It
may be specified either before or after an explicit clocking event control in the body
of the property declaration, but it must precede all other terms of the underlying
property. If a named property specifies a disable clause, then instances of the
property must ensure that, after elaboration, 2
the disable clause is at the top-level
1 It is presumed that this impulse is a glitch, although, technically, the graphical representation
does not imply this without further information, e.g., concerning the timescale. A waveform tool
can identify glitches unambiguously.
Search WWH ::




Custom Search