ucb-bar / chisel2-deprecated

chisel.eecs.berkeley.edu
388 stars 90 forks source link

Support bulk connects in `when`? #727

Open jkorinth opened 7 years ago

jkorinth commented 7 years ago

Feature request: It would be nice to mux Bundles in when statements, e.g.,

when (somesignal) {
  bundle <> otherBundle
}
.otherwise {
  bundle <> defaultBundle
}

The idea would be to generate a bunch of

bundle.x := Mux(somesignal, otherBundle.x, defaultBundle.x)
...

statements. This would save a lot of typing, e.g., in arbiting xbars with large protocols (AXI, Wishbone, ...).

I guess that won't be as easy as it sounds since there's a lot of special cases to be caught, but I think it would be very useful. In case you can't support it, it would also be helpful to generate a compiler error for the code above.