Support DontCare in Mux and cloneSupertype #995
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds general support for DontCare to cloneSupertype, and add special case handling in Mux for the chisel style (DontCare object) to firrtl style (invalidate wire) conversion. Not sure how to actually test the DontCare case, but this tests the other case.
Note that it will still be difficult to use DontCare in a Mux, because Scala doesn't understand that DontCare should be a bottom type of Data, so it will infer the output type of Mux to be the common supertype of DontCare (which extends Element) and your Data, which usually means you'll get a Element or Data out, instead of something more specific eg UInt.
This also kind of feels like a game of whackamole, since DontCare support may be subtly broken in other contexts, though I guess it also makes no sense to do something like
1.U + DontCare
Related issue: resolves #848
Type of change: other enhancement
Impact: API addition (no impact on existing code)
Development Phase: implementation
Release Notes
Support DontCare in Muxes