Skip to content
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

ChiselGen embeds wrong binary format of float #265

Open
kelayamatoz opened this issue Aug 27, 2019 · 0 comments
Open

ChiselGen embeds wrong binary format of float #265

kelayamatoz opened this issue Aug 27, 2019 · 0 comments
Assignees

Comments

@kelayamatoz
Copy link
Collaborator

kelayamatoz commented Aug 27, 2019

In ChiselCodeGen.quoteConst, the string representation of a float is emitted as c.toString. However, when c is of type emul.FloatPoint and when c comes from a LUT, c.toString returns a string of the float format instead of the binary format. As a result, the generated chisel LUT would contain a list of floating point numbers instead of a list of integer numbers that represent the binary form of the floats. This issue mostly affects memories that need to be initialized with high-precision types, e.g. a LUT for doing high-precision sigmoid / tanh functions.

I've put the fix on commit 0ec748d on this branch. It's working with the test apps I pushed, but feel free to let me know if there are other things I'm missing.

@kelayamatoz kelayamatoz self-assigned this Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant