-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parse Floating Point Constants #2195
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
} | ||
} | ||
} |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh the second thought is that it only proves that it reads/writes the same value, but doesn't prove that it's not necessarily intepretting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you explain what you mean by that? The comment is lacking enough context to make sense to me. |
||
], | ||
"format": { | ||
"is_signed": true, | ||
"numeric_type": "floating_point", | ||
"width": 32 | ||
} | ||
} | ||
} |
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 = ieee754_const(1.00); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sampsyo thoughts on this representation as opposed to the idea of only having a primitive called |
||
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; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
separate out
iee754_const(
into"ieee754" ~ "("