You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the current behavior is a bug, please provide the steps to reproduce the problem:
Consider the following two functions below, muxLess and whenLess. As a user, they appear to implement the same logic and I would expect them to both function. However, the whenLess case elaborates and works as expected while muxLess flames out with an error:
java.lang.AssertionError: can't create Mux with heterogeneous types class chisel3.core.UInt and class chisel3.core.DontCare$
chisel3.core.cloneSupertype$$anonfun$1.apply(Data.scala:132)
chisel3.core.cloneSupertype$$anonfun$1.apply(Data.scala:112)
[...]
scala.collection.AbstractTraversable.reduce(Traversable.scala:104)
chisel3.core.cloneSupertype$.apply(Data.scala:112)
chisel3.core.Mux$.do_apply(Mux.scala:32)
[...]
// doesn't workdefmuxLess(in: UInt, outWire: UInt):Unit= {
outWire :=Mux(in <48.U, in, DontCare)
}
// works finedefwhenLess(in: UInt, outWire: UInt):Unit= {
when(in <48.U) {
outWire := in
} .otherwise {
outWire :=DontCare
}
}
classMyMyModuleextendsModule {
valio=IO(newBundle {
valin=Input(UInt(12.W))
valout=Output(UInt(12.W))
})
whenLess(io.in, io.out) // works
muxLess(io.in, io.out) // doesn't work
}
Please tell us about your environment: Chisel 3.1
What is the use case for changing the behavior? Seems like an arbitrary restriction to a user that we can't use DontCare in a Mux() but can use it in a when() statement to accomplish the exact same thing.
The text was updated successfully, but these errors were encountered:
Type of issue: bug report
Development Phase: request
If the current behavior is a bug, please provide the steps to reproduce the problem:
Consider the following two functions below,
muxLess
andwhenLess
. As a user, they appear to implement the same logic and I would expect them to both function. However, thewhenLess
case elaborates and works as expected whilemuxLess
flames out with an error:Please tell us about your environment: Chisel 3.1
What is the use case for changing the behavior? Seems like an arbitrary restriction to a user that we can't use DontCare in a Mux() but can use it in a when() statement to accomplish the exact same thing.
The text was updated successfully, but these errors were encountered: