SV Assertions PDF
SV Assertions PDF
Assertions
by
Pankaj Badhe
Verification engineers
Interface, cross block, higher level behaviour.
assert (A == B)
else $error("It's gone wrong");
sequence acknowledge
##[1:2] Ack;
endsequence
12/19/2011 Pankaj Badhe 18
property handshake;
@(posedge Clock) request |-> acknowledge;
endproperty
sequence s2;
@(posedge clk) $rose(a);
endsequence
property p;
a |-> s;
endproperty
Property p26 checks that if there is a valid start signal on any given
positive edge of the clock, 2 clock cycles later, signal "a" will repeat
three times continuously or intermittently before there is a valid stop
signal. One clock cycle later, the signal "stop" should be detected low.
It checks for the exact same thing as property p25 except that it uses a
"non-consecutive repeat operator in the place of a "go to" repeat
operator. This means that, in property p26, there is no expectation that
there is a valid match on signal "a"in the previous cycle of a valid
match on "stop" signal.
Property p2 6;
@ (posedge clk) $rose(start) | -> ##2 (a[=3]) ##1 stop ##1 !stop;
endproperty
a26: assert property(p26);
Property p20;
@ (posedge clk) (c && d) |-> ($past((a&&b), 2, e) == 1'bl);
endproperty
Just like the assert statement, the cover statement can also have an
action block. Upon a successful coverage match, a function or a task
can be called or a local variable update can be performed.
program M_assertions(...);
// sequences, properties, assertions for M go here
endprogram
The design signals that are bound can contain cross module reference
to any signal within the scope of the bound instance.