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

Why did someone decide fractionalBits = binaryPoint? #35

Open
shunshou opened this issue Jan 14, 2017 · 5 comments
Open

Why did someone decide fractionalBits = binaryPoint? #35

shunshou opened this issue Jan 14, 2017 · 5 comments

Comments

@shunshou
Copy link
Member

binaryPoint is ambiguous. Could be # of bits from LSB or MSB before binaryPoint...

@shunshou
Copy link
Member Author

From a user standpoint, I also find it weird that FixedPoint is a chisel3 thing vs. DspReal is a dsptools thing.

Also, one would think that DspReal and Real are similar, except Real is more like Ring vs. DspReal is more like FixedPoint, SInt, etc.

@chick
Copy link
Contributor

chick commented Jan 17, 2017

One of the motivating factors in the choice of binaryPoint was the desire to support binaryPoints that were negative indicating a virtual exponent. I agree where the various players here (FixedPoint, DspReal) seems a bit arbitrary, but the short term decision was based on how fundamental FixedPoint needed to be in order to properly support it. So it became part of chisel/firrtl, the real stuff was supported by the BlackBox/ExternalModule for chisel/firrtl and did not require any changes. The utility of easily fungible Real/Fixed might argue to bring the real implementation down, but it does not seem to be on the short term critical path.

@chick
Copy link
Contributor

chick commented Jan 17, 2017

@shunshou did you have a specific proposal in this issue? Change the name or simply better doc about the amibguities

@shunshou
Copy link
Member Author

Sorry, ok I forgot about the negative binary points. But yes, if that's fine, please document. I just have to think about that every time I generate FixedPoint (back translate from what I'm used to).

@shunshou
Copy link
Member Author

shunshou commented Feb 1, 2017

@chick I got confused again b/c "setBinaryPoint" = set # of fractional bits... Wasn't sure if it trimmed to the right # of fractional bits, shifted the binary point around, etc. etc. It's pretty confusing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants