I want to use Mux to choose bundle enter code here class ComIO extends Bunlde { val in = Input(UInt(32.W) val in = Input(UInt(32.W) }
class EntIO extends Bundle {
val com = new ComIO
}
class Ent extends Module {
val io = IO(new EntIO)
...
}
class DemoIO extends Bundle {
val com1 = new ComIO
val com2 = new ComIO
val en = Input(Bool())
}
class Demo extends Module {
val io = IO(new DemoIO)
val ent = Module(new Ent)
ent.io <> Mux(io.en,io.com1,io.com2)
}
enter code here
The Error is flowing
Muxes are unidirectional, you can't use them for bidirectional things. Try using a
when
: