-
Notifications
You must be signed in to change notification settings - Fork 58
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
Support setting FSM encoding attribute #135
Comments
I'm not yet convinced nMigen needs to provide an abstraction for this. In particular, what if you request e.g. a Also, it seems to be a niche feature with more potential for misuse than use, like If you're fine adding platform-specific attributes, you can already do this with: with m.FSM() as fsm:
fsm.state.attrs["syn_encoding"] = "onehot" |
FYI - Here is what Vivado says about FSM state encoding;
It may be that it is impossible to know the best FSM state encoding until you have timing information? |
I think for now, the above |
To get make sure your FSM state variable stays as a specific encoding, most synthesis tools support setting an encoding attribute on the state register. This appears to be something that Synopsys Synplify added and then everyone else copied for compatibility (Quartus II + Libero + Diamond).
A list of the valid encoding schemes seems to be;
There also seems to be an extra
safe
value which can be added;It would be good to be able to do this with nMigen.
The text was updated successfully, but these errors were encountered: