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

RFE: option to have AUTORESET reset flops to x rather than 0 #1839

Open
jwise opened this issue Aug 30, 2023 · 1 comment
Open

RFE: option to have AUTORESET reset flops to x rather than 0 #1839

jwise opened this issue Aug 30, 2023 · 1 comment

Comments

@jwise
Copy link

jwise commented Aug 30, 2023

I've been trying to get a little better at leaving invalid state machine parameters initialized to x rather than 0 in my resets (knowing that my synthesis tool will squash them to 0 eventually), so that I can get earlier feedback in simulation if something takes a path I do not expect it to. It would be nice to have an option to have AUTORESET set flops to x as a default, and then have to explicitly set flops to either asserted or deasserted if I care.

@wsnyder
Copy link
Member

wsnyder commented Aug 30, 2023

That should be easy to add (e.g. AUTORESETX?), but I feel the need to caution this can be a dangerous methodology.

Synthesis is allowed to pick any value it wants that optimizes well (not just 0), and simulation might not catch it given that in IEEE "if ('x)" evaluates false. So, assigning Xs is a known route to synthesis-simulation mismatch bugs.

To counteract that, with such a methodology the user needs to be certain to be using formal or x-pessimism simulator (or verilator -x-assign unique).

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

2 participants