-
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.
support floating point as a numeric type so that we can write regular…
… decimal representation of real numbers
- Loading branch information
1 parent
c1b2037
commit b301926
Showing
5 changed files
with
114 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"mem_read": { | ||
"data": [ | ||
4.2 | ||
], | ||
"format": { | ||
"is_signed": true, | ||
"numeric_type": "floating_point", | ||
"width": 32 | ||
} | ||
}, | ||
"mem_write": { | ||
"data": [ | ||
0.0 | ||
], | ||
"format": { | ||
"is_signed": true, | ||
"numeric_type": "floating_point", | ||
"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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"mem_read": { | ||
"data": [ | ||
4.2 | ||
], | ||
"format": { | ||
"is_signed": true, | ||
"numeric_type": "floating_point", | ||
"width": 32 | ||
} | ||
}, | ||
"mem_write": { | ||
"data": [ | ||
4.2 | ||
], | ||
"format": { | ||
"is_signed": true, | ||
"numeric_type": "floating_point", | ||
"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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import "primitives/compile.futil"; | ||
import "primitives/memories/comb.futil"; | ||
|
||
component main<"toplevel"=1,>(@clk clk: 1, @reset reset: 1, @go go: 1) -> (@done done: 1) { | ||
cells { | ||
reg0 = std_reg(32); | ||
@external mem_read = comb_mem_d1(32, 1, 1); | ||
@external mem_write = comb_mem_d1(32, 1, 1); | ||
} | ||
wires { | ||
group read { | ||
mem_read.addr0 = 1'b0; | ||
reg0.in = mem_read.read_data; | ||
reg0.write_en = 1'b1; | ||
read[done] = reg0.done; | ||
} | ||
|
||
group write { | ||
mem_write.addr0 = 1'b0; | ||
mem_write.write_en = 1'b1; | ||
mem_write.write_data = reg0.out; | ||
write[done] = mem_write.done; | ||
} | ||
} | ||
control { | ||
seq { | ||
read; | ||
write; | ||
} | ||
} | ||
} |