ASSERTION
GOUTAMI
WHAT IS ASSERTION???
• Assertions are primarily used to validate the behavior of a design
• Check the occurrence of a specific condition or sequence of events.
TYPES OF ASSERTION
IMMEDIATE ASSERTION
1] Immediate assertions check for a
condition at the zero/current simulation
time.
2]An immediate assertion is the same as
an if..else statement with assertion
control. Immediate assertions have to be
placed in a procedural block definition.
CONCURRENT ASSERTION
• 1] Concurrent assertions check the
sequence of events spread over
multiple clock cycles
• 2]The test expression is evaluated at
clock edges based on the sampled
values of the variables involved,it can
be placed in a procedural block,
a module, an interface or a
program definition
Types cont..
• 3] syntax :
• label: assert(expression)
action_block;
Ex: always @(posedge clk) assert
(a && b);
• 3]syntax:
• c_assert: assert
property(@(posedge clk) not(a
&& b));
BUILDING
BLOCKS OF
ASSERTION
IMPLECATION OPERATOR
1]Need of Implication Operator ??
sequence seq;
@(posedge clk) a ##2 b;
endsequence
2]TYPES OF IMPLICATION OPERATOR
A] OVERLAPPING IMPLICATION OPERATOR
B] NON-OVERLAPPING IMPLICATION OPERATOR
OVERLAPPING IMPLICATION
OPERATOR
NON-OVERLAPPING IMPLICATION OPERATOR
THE IMPLICATIONWITH A FIXED DELAY
ON THE CONSEQUENT
• property p;
• @(posedge clk) a |-> ##2 b;
• endproperty
• a: assert property(p);
THE IMPLICATION WITH A SEQUENCE AS
AN ANTECEDENT
• property p;
• @(posedge clk) a |-> ##2 b;
• endproperty
• a: assert property(p);
THE IMPLICATION WITH A SEQUENCE AS
AN ANTECEDENT
• sequence seq_1;
• (a && b) ##1 c;
• endsequence
•
• sequence seq_2;
• ##2 !d;
• endsequence
•
• property p;
• @(posedge clk) seq_1 |-> seq_2;
• endpeoperty
• a: assert property(p);
THE IMPLICATION WITH A SEQUENCE AS
AN ANTECEDENT
• sequence seq_1;
• (a && b) ##1 c;
• endsequence
•
• sequence seq_2;
• ##2 !d;
• endsequence
•
• property p;
• @(posedge clk) seq_1 |-> seq_2;
• endpeoperty
• a: assert property(p);
SIMPLE DELAY ASSERTION
ASSERTION WITH DELAY RANGES
$rose
$fell
$stable
• Property stable_p checks when signal “a” asserts high, it checks for no
change in signal “b”. It means, signal “b” should stay as it was in
the previous cycle.
$past
Disable Iff
REPETITION OPERATOR
1] Consecutive repetition operator
2] Go to repetition operator
3] Non Consecutive repetition operator
Consecutive repetition operator:
Signal_name1 [->n] ##1
signal_name2
Go to repetition operator:
Non Consecutive repetition operator
IF ELSE
INSIDE
PROPERTY
$ONEHOT
PROPERTY
Throughout:
LOCAL VARIABLE
INSIDE
PROPERTY:
Question:::
• 1] check if clock of given frequency is working fine or not.
.lets assume duty cycle as 50% ???
Or
Write a checker to see if clock is running at 10MHZ?
Answer:
Property clock_freq_p;
time prev_time;
@(posedge clk)(1,prev_time=$realtime) |=> ($realtime-prev_time ==TP);
endproperty

assertion.pptx