-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SeqToSV] Do not use
always_ff
for compreg with initializer (#7838)
- Loading branch information
1 parent
65e230c
commit 2d416af
Showing
4 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// RUN: circt-opt %s --lower-seq-to-sv=lower-to-always-ff | FileCheck %s | ||
|
||
// CHECK-LABEL: hw.module @basic(in %clk : i1, in %d : i8, out q : i8) { | ||
// CHECK: %[[REG:.*]] = sv.reg : !hw.inout<i8> | ||
// CHECK: %[[RD:.*]] = sv.read_inout %[[REG]] : !hw.inout<i8> | ||
// CHECK: sv.alwaysff(posedge %clk) { | ||
// CHECK-NEXT: sv.passign %[[REG]], %d : i8 | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: hw.output %[[RD]] : i8 | ||
// CHECK-NEXT: } | ||
hw.module @basic(in %clk: !seq.clock, in %d: i8, out q: i8) { | ||
%q = seq.compreg %d, %clk : i8 | ||
hw.output %q : i8 | ||
} | ||
|
||
// CHECK-LABEL: hw.module @basicWithInit(in %clk : i1, in %d : i8, out q : i8) { | ||
// CHECK: sv.initial { | ||
// CHECK: } | ||
// CHECK: %[[CST:.*]] = hw.constant 19 : i8 | ||
// CHECK: %[[REG:.*]] = sv.reg init %[[CST]] : !hw.inout<i8> | ||
// CHECK: %[[RD:.*]] = sv.read_inout %[[REG]] : !hw.inout<i8> | ||
// CHECK: sv.always posedge %clk { | ||
// CHECK-NEXT: sv.passign %[[REG]], %d : i8 | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: hw.output %[[RD]] : i8 | ||
// CHECK-NEXT: } | ||
hw.module @basicWithInit(in %clk: !seq.clock, in %d: i8, out q: i8) { | ||
%init = seq.initial () { | ||
%cst = hw.constant 19 : i8 | ||
seq.yield %cst : i8 | ||
} : () -> !seq.immutable<i8> | ||
|
||
%q = seq.compreg %d, %clk initial %init : i8 | ||
hw.output %q : i8 | ||
} |
2d416af
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI failure seems unrelated. See #7859.