-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
std-bit-slice implementation (#1906)
* add docs entry for std_bit_slice module * add implementation of std_bit_slice module * add test case for std_bit_slice module * add test data for testing std_bit_slice module * fix backward ordering of range extract parameters * add 'std_bit_slice' implementation to interpreter * change the Value.slice method to accept &self * Update std-bit-slice test to use the new 'comb_mem_d1' * Fix failing test * Add 'std_bit_slice' definition to 'tests/import/a.expect' * update std-bit-slice test
- Loading branch information
1 parent
a2f2f3c
commit cf547b4
Showing
11 changed files
with
114 additions
and
3 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
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,5 @@ | ||
{ | ||
"mem": [ | ||
9 | ||
] | ||
} |
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,28 @@ | ||
import "primitives/core.futil"; | ||
import "primitives/memories/comb.futil"; | ||
|
||
component main(@go go: 1) -> (@done done: 1) { | ||
cells { | ||
@external mem = comb_mem_d1(32, 1, 1); | ||
slice = std_bit_slice(32, 10, 14, 4); | ||
pad = std_pad(4, 32); | ||
} | ||
|
||
wires { | ||
group bit_slice { | ||
slice.in = 32'b00000000000000110010010110110000; | ||
|
||
pad.in = slice.out; | ||
|
||
mem.addr0 = 1'b0; | ||
mem.write_data = pad.out; | ||
mem.write_en = 1'b1; | ||
|
||
bit_slice[done] = mem.done; | ||
} | ||
} | ||
|
||
control { | ||
bit_slice; | ||
} | ||
} |
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,10 @@ | ||
{ | ||
"mem": { | ||
"data": [0], | ||
"format": { | ||
"numeric_type": "bitnum", | ||
"is_signed": false, | ||
"width": 32 | ||
} | ||
} | ||
} |
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