how to properly prevent FSM recoding? #4120
-
I am using Yosys with OpenROadFlow and I have the following SystemVerilog code
For Gate Level Simulation debug, I would like to prevent YOSYS from recoding the FSM into a one-hot format. Despite using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I can't reproduce this - do you have a complete example (RTL+yosys script)?
and the script:
it correctly applies the attribute and just trims the unused bits:
If you want it to not touch the state bits at all, you can use the attribute As for what drives recoding, the heuristic there is very simple: if the FSM has less than 32 states, it prefers one-hot encoding, otherwise binary. |
Beta Was this translation helpful? Give feedback.
Do you mean a third-party plugin? Have you checked if the attribute is present after importing the design?
You can run this script to check:
If you do not see
attribute \fsm_encoding "user"
listed in the output, that would be a problem with the plugin that you should report to its authors.