Skip to content

Commit 3323294

Browse files
committed
fix : Verif CLock I1 to !seq.clock
1 parent f446e29 commit 3323294

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

include/circt/Dialect/Verif/VerifOps.td

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ def ClockEdgeAttr : I32EnumAttr<"ClockEdge", "clock edge",
7171

7272
class ClockedAssertLikeOp<string mnemonic, list<Trait> traits = []> :
7373
VerifOp<mnemonic, traits> {
74-
let arguments = (ins LTLAnyPropertyType:$property,
75-
ClockEdgeAttr:$edge, I1:$clock,
76-
Optional<I1>:$enable,
77-
OptionalAttr<StrAttr>:$label);
74+
let arguments = (ins LTLAnyPropertyType:$property, ClockEdgeAttr:$edge,
75+
ClockType:$clock, Optional<I1>:$enable, OptionalAttr<StrAttr>:$label);
7876
let assemblyFormat = [{
7977
$property (`if` $enable^)? `,` $edge $clock
8078
(`label` $label^)? attr-dict `:` type($property)
@@ -162,7 +160,7 @@ def HasBeenResetOp : VerifOp<"has_been_reset", [Pure]> {
162160
startup or power-cycling and the start of reset. `verif.has_been_reset` is
163161
guaranteed to produce a 0 value in that period, as well as during the reset.
164162
}];
165-
let arguments = (ins I1:$clock, I1:$reset, BoolAttr:$async);
163+
let arguments = (ins ClockType:$clock, I1:$reset, BoolAttr:$async);
166164
let results = (outs I1:$result);
167165
let assemblyFormat = [{
168166
$clock `,` custom<KeywordBool>($async, "\"async\"", "\"sync\"")

test/Dialect/Verif/basic.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ hw.module @foo() {
133133
}
134134

135135
// CHECK-LABEL: hw.module @HasBeenReset
136-
hw.module @HasBeenReset(in %clock: i1, in %reset: i1) {
136+
hw.module @HasBeenReset(in %clock: !seq.clock, in %reset: i1) {
137137
// CHECK-NEXT: verif.has_been_reset %clock, async %reset
138138
// CHECK-NEXT: verif.has_been_reset %clock, sync %reset
139139
%hbr0 = verif.has_been_reset %clock, async %reset

test/Dialect/Verif/canonicalization.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: circt-opt --canonicalize %s | FileCheck %s
22

33
// CHECK-LABEL: @HasBeenReset
4-
hw.module @HasBeenReset(in %clock: i1, in %reset: i1) {
4+
hw.module @HasBeenReset(in %clock: !seq.clock, in %reset: i1) {
55
// CHECK-NEXT: %false = hw.constant false
66
// CHECK-NEXT: %true = hw.constant true
77
%false = hw.constant false
@@ -37,21 +37,21 @@ hw.module @HasBeenReset(in %clock: i1, in %reset: i1) {
3737
}
3838

3939
// CHECK-LABEL: @clockedAssert
40-
hw.module @clockedAssert(in %clock : i1, in %a : i1, in %en : i1) {
40+
hw.module @clockedAssert(in %clock : !seq.clock, in %a : i1, in %en : i1) {
4141
// CHECK: verif.clocked_assert %a if %en, posedge %clock : i1
4242
%clk = ltl.clock %a, posedge %clock : i1
4343
verif.assert %clk if %en : !ltl.sequence
4444
}
4545

4646
// CHECK-LABEL: @clockedAssume
47-
hw.module @clockedAssume(in %clock : i1, in %a : i1, in %en : i1) {
47+
hw.module @clockedAssume(in %clock : !seq.clock, in %a : i1, in %en : i1) {
4848
// CHECK: verif.clocked_assume %a if %en, posedge %clock : i1
4949
%clk = ltl.clock %a, posedge %clock : i1
5050
verif.assume %clk if %en : !ltl.sequence
5151
}
5252

5353
// CHECK-LABEL: @clockedCover
54-
hw.module @clockedCover(in %clock : i1, in %a : i1, in %en : i1) {
54+
hw.module @clockedCover(in %clock : !seq.clock, in %a : i1, in %en : i1) {
5555
// CHECK: verif.clocked_cover %a if %en, posedge %clock : i1
5656
%clk = ltl.clock %a, posedge %clock : i1
5757
verif.cover %clk if %en : !ltl.sequence

test/Dialect/Verif/verify.mlir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// -----
44

5-
hw.module @verifyClocks(in %clk: i1, in %a: i1, in %b: i1) {
5+
hw.module @verifyClocks(in %clk: !seq.clock, in %a: i1, in %b: i1) {
66
%n0 = ltl.not %a : i1
77

88
// expected-error @below {{Nested clock or disable operations are not allowed for clock_assertlike operations.}}
@@ -12,7 +12,7 @@ hw.module @verifyClocks(in %clk: i1, in %a: i1, in %b: i1) {
1212

1313
// -----
1414

15-
hw.module @verifyClocks1(in %clk: i1, in %a: i1, in %b: i1) {
15+
hw.module @verifyClocks1(in %clk: !seq.clock, in %a: i1, in %b: i1) {
1616
%n0 = ltl.not %a : i1
1717

1818
// expected-error @below {{Nested clock or disable operations are not allowed for clock_assertlike operations.}}
@@ -22,7 +22,7 @@ hw.module @verifyClocks1(in %clk: i1, in %a: i1, in %b: i1) {
2222

2323
// -----
2424

25-
hw.module @verifyClocks2(in %clk: i1, in %a: i1, in %b: i1) {
25+
hw.module @verifyClocks2(in %clk: !seq.clock, in %a: i1, in %b: i1) {
2626
%n0 = ltl.not %a : i1
2727

2828
// expected-error @below {{Nested clock or disable operations are not allowed for clock_assertlike operations.}}
@@ -32,7 +32,7 @@ hw.module @verifyClocks2(in %clk: i1, in %a: i1, in %b: i1) {
3232

3333
// -----
3434

35-
hw.module @deeplynested(in %clk: i1, in %a: i1, in %b: i1) {
35+
hw.module @deeplynested(in %clk: !seq.clock, in %a: i1, in %b: i1) {
3636
%n0 = ltl.not %a : i1
3737
// expected-error @below {{Nested clock or disable operations are not allowed for clock_assertlike operations.}}
3838
%clocked = ltl.clock %n0, posedge %clk : !ltl.property
@@ -47,6 +47,6 @@ hw.module @deeplynested(in %clk: i1, in %a: i1, in %b: i1) {
4747

4848
// -----
4949

50-
hw.module @clockedarg(in %clocked: !ltl.property, in %a: i1, in %clk: i1) {
50+
hw.module @clockedarg(in %clocked: !ltl.property, in %a: i1, in %clk: !seq.clock) {
5151
verif.clocked_assert %clocked if %a, posedge %clk : !ltl.property
5252
}

0 commit comments

Comments
 (0)