-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compaction Accounts for Continuous Assignments (#1847)
* first pass * code cleaning * documentation * clippy * bug fix * better analyssi * documentation
- Loading branch information
Showing
8 changed files
with
318 additions
and
29 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
47 changes: 47 additions & 0 deletions
47
tests/passes/schedule-compaction/continuous-compaction.expect
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,47 @@ | ||
import "primitives/core.futil"; | ||
component main(@go go: 1, @clk clk: 1, @reset reset: 1) -> (out: 8, @done done: 1) { | ||
cells { | ||
r0 = std_reg(8); | ||
r1 = std_reg(8); | ||
r2 = std_reg(8); | ||
r3 = std_reg(8); | ||
add = std_add(8); | ||
} | ||
wires { | ||
static<1> group write_r0 { | ||
r0.in = 8'd1; | ||
r0.write_en = 1'd1; | ||
} | ||
static<1> group write_r1 { | ||
r1.in = add.out; | ||
r1.write_en = 1'd1; | ||
} | ||
static<1> group write_r2 { | ||
r2.in = 8'd3; | ||
r2.write_en = 1'd1; | ||
} | ||
static<1> group write_r3 { | ||
r3.in = 8'd3; | ||
r3.write_en = 1'd1; | ||
} | ||
out = r1.out; | ||
add.right = 8'd1; | ||
add.left = r0.out; | ||
} | ||
control { | ||
seq { | ||
static<2> par { | ||
static<2> seq { | ||
write_r0; | ||
write_r1; | ||
} | ||
static<1> seq { | ||
write_r2; | ||
} | ||
static<1> seq { | ||
write_r3; | ||
} | ||
} | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
tests/passes/schedule-compaction/continuous-compaction.futil
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,45 @@ | ||
// -p validate -p schedule-compaction | ||
|
||
import "primitives/core.futil"; | ||
|
||
component main() -> (out: 8) { | ||
cells { | ||
r0 = std_reg(8); | ||
r1 = std_reg(8); | ||
r2 = std_reg(8); | ||
r3 = std_reg(8); | ||
add = std_add(8); | ||
} | ||
wires { | ||
static<1> group write_r0 { | ||
r0.write_en = 1'd1; | ||
r0.in = 8'd1; | ||
} | ||
static<1> group write_r1 { | ||
r1.write_en = 1'd1; | ||
r1.in = add.out; | ||
} | ||
static<1> group write_r2 { | ||
r2.write_en = 1'd1; | ||
r2.in = 8'd3; | ||
} | ||
static<1> group write_r3 { | ||
r3.write_en = 1'd1; | ||
r3.in = 8'd3; | ||
} | ||
add.left = r0.out; | ||
add.right = 8'd1; | ||
out = r1.out; | ||
} | ||
control { | ||
seq { | ||
@compactable static seq { | ||
write_r0; | ||
// Continuous assignments to add.left and add.right prevent compation. | ||
write_r1; | ||
write_r2; | ||
write_r3; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.