You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Dialects/LTL.md
+56-37Lines changed: 56 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,54 +48,54 @@ a ##1 b ##1 c // 1 cycle delay between a, b, and c
48
48
49
49
In the simplest form, a cycle delay can appear as a prefix of another sequence, e.g., `##1 a`. This is essentially a concatenation with only one sequence, `a`, and an initial cycle delay of the concatenation of `1`. The prefix delays map to the LTL dialect as follows:
50
50
51
-
-`##N seq`. **Fixed delay.** Sequence `seq` has to match exactly `N` cycles in the future. Equivalent to `ltl.delay %seq, N, 0`.
52
-
-`##[N:M] seq`. **Bounded range delay.** Sequence `seq` has to match anywhere between `N` and `M` cycles in the future, inclusive. Equivalent to `ltl.delay %seq, N, (M-N)`
53
-
-`##[N:$] seq`. **Unbounded range delay.** Sequence `seq` has to match anywhere at or beyond `N` cycles in the future, after a finite amount of cycles. Equivalent to `ltl.delay %seq, N`.
54
-
-`##[*] seq`. Shorthand for `##[0:$]`. Equivalent to `ltl.delay %seq, 0`.
55
-
-`##[+] seq`. Shorthand for `##[1:$]`. Equivalent to `ltl.delay %seq, 1`.
51
+
-`##N seq`. **Fixed delay.** Sequence `seq` has to match exactly `N` cycles in the future. Equivalent to `ltl.delay %clk, posedge, %seq, N, 0`.
52
+
-`##[N:M] seq`. **Bounded range delay.** Sequence `seq` has to match anywhere between `N` and `M` cycles in the future, inclusive. Equivalent to `ltl.delay %clk, posedge, %seq, N, (M-N)`
53
+
-`##[N:$] seq`. **Unbounded range delay.** Sequence `seq` has to match anywhere at or beyond `N` cycles in the future, after a finite amount of cycles. Equivalent to `ltl.delay %clk, posedge, %seq, N`.
54
+
-`##[*] seq`. Shorthand for `##[0:$]`. Equivalent to `ltl.delay %clk, posedge, %seq, 0`.
55
+
-`##[+] seq`. Shorthand for `##[1:$]`. Equivalent to `ltl.delay %clk, posedge, %seq, 1`.
56
56
57
57
Concatenation of two sequences always involves a cycle delay specification in between them, e.g., `a ##1 b` where sequence `b` starts in the cycle after `a` ends. Zero-cycle delays can be specified, e.g., `a ##0 b` where `b` starts in the same cycle as `a` ends. If `a` and `b` are booleans, `a ##0 b` is equivalent to `a && b`.
58
58
59
59
The dialect separates concatenation and cycle delay into two orthogonal operations, `ltl.concat` and `ltl.delay`, respectively. The former models concatenation as `a ##0 b`, and the latter models delay as a prefix `##1 c`. The SVA concatenations with their infix delays map to the LTL dialect as follows:
60
60
61
61
-`seqA ##N seqB`. **Binary concatenation.** Sequence `seqB` follows `N` cycles after `seqA`. This can be represented as `seqA ##0 (##N seqB)`, which is equivalent to
62
62
```
63
-
%0 = ltl.delay %seqB, N, 0
63
+
%0 = ltl.delay %clk, posedge, %seqB, N, 0
64
64
ltl.concat %seqA, %0
65
65
```
66
66
67
67
-`seqA ##N seqB ##M seqC`. **Variadic concatenation.** Sequence `seqC` follows `M` cycles after `seqB`, which itself follows `N` cycles after `seqA`. This can be represented as `seqA ##0 (##N seqB) ##0 (##M seqC)`, which is equivalent to
68
68
```
69
-
%0 = ltl.delay %seqB, N, 0
70
-
%1 = ltl.delay %seqC, M, 0
69
+
%0 = ltl.delay %clk, posedge, %seqB, N, 0
70
+
%1 = ltl.delay %clk, posedge, %seqC, M, 0
71
71
ltl.concat %seqA, %0, %1
72
72
```
73
73
Since concatenation is associative, this is also equivalent to `seqA ##N (seqB ##M seqC)`:
74
74
```
75
-
%0 = ltl.delay %seqC, M, 0
75
+
%0 = ltl.delay %clk, posedge, %seqC, M, 0
76
76
%1 = ltl.concat %seqB, %0
77
-
%2 = ltl.delay %1, N, 0
77
+
%2 = ltl.delay %clk, posedge, %1, N, 0
78
78
ltl.concat %seqA, %2
79
79
```
80
80
And also `(seqA ##N seqB) ##M seqC`:
81
81
```
82
-
%0 = ltl.delay %seqB, N, 0
82
+
%0 = ltl.delay %clk, posedge, %seqB, N, 0
83
83
%1 = ltl.concat %seqA, %0
84
-
%2 = ltl.delay %seqC, M, 0
84
+
%2 = ltl.delay %clk, posedge, %seqC, M, 0
85
85
ltl.concat %1, %2
86
86
```
87
87
88
88
-`##N seqA ##M seqB`. **Initial delay.** Sequence `seqB` follows `M` cycles afer `seqA`, which itself starts `N` cycles in the future. This is equivalent to a delay on `seqA` within the concatenation:
89
89
```
90
-
%0 = ltl.delay %seqA, N, 0
91
-
%1 = ltl.delay %seqB, M, 0
90
+
%0 = ltl.delay %clk, posedge, %seqA, N, 0
91
+
%1 = ltl.delay %clk, posedge, %seqB, M, 0
92
92
ltl.concat %0, %1
93
93
```
94
94
Alternatively, the delay can also be placed on the entire concatenation:
95
95
```
96
-
%0 = ltl.delay %seqB, M, 0
96
+
%0 = ltl.delay %clk, posedge, %seqB, M, 0
97
97
%1 = ltl.concat %seqA, %0
98
-
ltl.delay %1, N, 0
98
+
ltl.delay %clk, posedge, %1, N, 0
99
99
```
100
100
101
101
- Only the fixed delay `##N` is shown here for simplicity, but the examples extend to the other delay flavors `##[N:M]`, `##[N:$]`, `##[*]`, and `##[+]`.
@@ -160,6 +160,25 @@ Sequence and property expressions in SVAs can specify a clock with respect to wh
160
160
-`@(negedge clk) seqOrProp`. **Trigger on high-to-low clock edge.** Equivalent to `ltl.clock %seqOrProp, negedge %clk`.
161
161
-`@(edge clk) seqOrProp`. **Trigger on any clock edge.** Equivalent to `ltl.clock %seqOrProp, edge %clk`.
162
162
163
+
#### Delay clocking (concise)
164
+
165
+
`ltl.delay` takes a clock `Value` and a `ClockEdgeAttr` as its first two
0 commit comments