OneHotEnum: a ChiselEnum with one-hot encoding#5040
OneHotEnum: a ChiselEnum with one-hot encoding#5040kammoh wants to merge 2 commits intochipsalliance:mainfrom
Conversation
|
Binary incompatibility is due to the change in |
|
I've implemented a similar feature here a long time ago: #2261 |
Hi Carlos, This is certainly very useful feature and, from my own experience, it can help with the timing of many designs. |
Synthesis tools usually can infer the optimal encoding for a finite state machine (FSM) described in SystemVerilog or VHDL. However, this does not seem to be the case for the SV generated by Chisel/firtool. In certain designs, especially with a larger state, the state equality checks can increase the critical path delay.
This PR adds a new
ChiselEnumsubclass namedOneHotEnumwith explicit one-hot encoding and optimized value checks (a new.isand also the existing.isOneOf).Contributor Checklist
docs/src?Type of Improvement
Desired Merge Strategy
Release Notes
Reviewer Checklist (only modified by reviewer)
3.6.x,5.x, or6.xdepending on impact, API modification or big change:7.0)?Enable auto-merge (squash)and clean up the commit message.Create a merge commit.