|
|
|
|
|
|
|
|
|
|
|
|
Conjunction
|
|
|
A Conjumction operator and is used for a Conjunction property. It works like a logical and operator, where all of the properties should evauate to true, then conjunction property evaluates to true. Below example shows that. |
|
|
|
|
|
|
|
|
|
|
|
Example : Conjunction
|
|
|
|
|
|
1 //+++++++++++++++++++++++++++++++++++++++++++++++++
2 // DUT With assertions
3 //+++++++++++++++++++++++++++++++++++++++++++++++++
4 module conjunction_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 logic gnt2;
18 initial begin
19 gnt2 <= 0; gnt <= 0;
20 end
21 always @ (posedge clk)
22 begin
23 gnt2 <= req;
24 gnt <= gnt2;
25 end
26 //=================================================
27 // Test Vector generation
28 //=================================================
29 initial begin
30 req <= 0;
31 #3 req <= 1;
32 #5 req <= 0;
33 #1 $finish;
34 end
35 //=================================================
36 // A conjunction property
37 //=================================================
38 property delay1;
39 req ##1 gnt;
40 endproperty
41 property delay2;
42 req ##2 gnt;
43 endproperty
44 // See the AND operator
45 property conjunction_prop;
46 @ (posedge clk)
47 delay1 and delay2;
48 endproperty
49 //=================================================
50 // Assertion Directive Layer
51 //=================================================
52 conjunction_assert : assert property (conjunction_prop);
53
54 endmodule
You could download file conjunction_assertion.sv here
|
|
|
|
|
|
Simulation : Conjunction
|
|
|
|
|
|
"conjunction_assertion.sv", 52:
conjunction_assertion.conjunction_assert: started at 1s failed at 1s
Offending 'req'
"conjunction_assertion.sv", 52:
conjunction_assertion.conjunction_assert: started at 3s failed at 3s
Offending 'req'
"conjunction_assertion.sv", 52:
conjunction_assertion.conjunction_assert: started at 5s failed at 7s
Offending 'gnt'
$finish called from file "conjunction_assertion.sv", line 33.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|