-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Firtool] Rerun IMCP after register optimizations (#6179)
This PR adds extra IMCP just after register optimization pass. We separated register optimization from IMCP to avoid changing observable behaivor of hardward in IMCP but the separation started to craete phase-ordering problem regarding IMCP and reg optimization pass. This commit for now adds one more IMCP after register optimization to fix one particular regression reported internally
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
; RUN: firtool %s | FileCheck %s | ||
; Check that `r` is optimized and the constant is propagated to the top-level port. | ||
; CHECK-NOT: Passthrough | ||
; CHECK-NOT: Child | ||
; CHECK-LABEL: module Example | ||
; CHECK: assign out = 1'h0; | ||
|
||
circuit Example : | ||
module Passthrough: | ||
input en: UInt<1> | ||
output out: UInt<1> | ||
out <= en | ||
|
||
module Child: | ||
input clock: Clock | ||
input zero: UInt<1> | ||
input unknown: UInt<1> | ||
output out: UInt<1> | ||
|
||
reg r : UInt<1>, clock | ||
r <= zero | ||
node b = and(r, unknown) | ||
inst p of Passthrough | ||
p.en <= b | ||
out <= p.out | ||
|
||
module Example: | ||
input clock: Clock | ||
input unknown: UInt<1> | ||
output out: UInt<1> | ||
inst c of Child | ||
c.clock <= clock | ||
c.zero <= UInt<1>(0) | ||
c.unknown <= unknown | ||
out <= c.out |