-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
comb-prop
: Disable rewrites when wire output is used (#1656)
- Loading branch information
1 parent
22742f8
commit 4970ba5
Showing
5 changed files
with
228 additions
and
61 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,18 @@ | ||
import "primitives/compile.futil"; | ||
component main<"toplevel"=1>(@go go: 1, @clk clk: 1, @reset reset: 1) -> (out: 32, @done done: 1) { | ||
cells { | ||
opt = std_wire(32); | ||
r = std_reg(32); | ||
r0 = std_reg(1); | ||
r1 = std_reg(1); | ||
r2 = std_reg(1); | ||
} | ||
wires { | ||
r.in = opt.out; | ||
r.write_en = 1'd1; | ||
opt.in = r0.out ? 32'd10; | ||
opt.in = r1.out ? 32'd20; | ||
out = r2.out ? opt.out; | ||
} | ||
control {} | ||
} |
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,22 @@ | ||
// -p well-formed -p comb-prop | ||
import "primitives/compile.futil"; | ||
component main<"toplevel"=1>() -> (out: 32) { | ||
cells { | ||
opt = std_wire(32); | ||
r = std_reg(32); | ||
// Stable conditions | ||
r0 = std_reg(1); | ||
r1 = std_reg(1); | ||
r2 = std_reg(1); | ||
} | ||
wires { | ||
r.in = opt.out; | ||
r.write_en = 1'd1; | ||
|
||
opt.in = r0.out ? 32'd10; | ||
opt.in = r1.out ? 32'd20; | ||
|
||
out = r2.out ? opt.out; | ||
} | ||
control {} | ||
} |