|
|
|
|
|
|
|
|
|
|
|
|
Negation
|
|
|
A negation property is same as logic not operator on outcome of a propery. So if the outcome is true, then negation makes it false. Below example which is modified version of earlier example. |
|
|
|
|
|
|
|
|
|
|
|
Example : Negation
|
|
|
|
|
|
1 //+++++++++++++++++++++++++++++++++++++++++++++++++
2 // DUT With assertions
3 //+++++++++++++++++++++++++++++++++++++++++++++++++
4 module negation_assertion();
5
6 logic req,gnt,clk;
7 //=================================================
8 // Clock generator
9 //=================================================
10 initial begin
11 clk = 0;
12 forever #1 clk ++;
13 end
14 //=================================================
15 // Simple DUT behaviour
16 //=================================================
17 always @ (posedge clk)
18 gnt <= req;
19 //=================================================
20 // Test Vector generation
21 //=================================================
22 initial begin
23 req <= 0;
24 #3 req <= 1;
25 #5 req <= 0;
26 #1 $finish;
27 end
28 //=================================================
29 // A negation property
30 //=================================================
31 property negation_prop;
32 @ (posedge clk)
33 not (req ##1 gnt);
34 endproperty
35 //=================================================
36 // Assertion Directive Layer
37 //=================================================
38 negation_assert : assert property (negation_prop);
39
40 endmodule
You could download file negation_assertion.sv here
|
|
|
|
|
|
Simulation : Negation
|
|
|
|
|
|
"negation_assertion.sv", 38:
negation_assertion.negation_assert: started at 5s failed at 7s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|