Say we define a special mux like this:
template <typename T> T Mux(bvec<10> sel, const vec<1024, T> &in) {
bus<sz<T>::value> b;
for (unsigned i = 0; i < 1024; ++i)
b.connect(Flatten(in[i]), sel == Lit<10>(i));
return b;
}
and we build roms by attaching literals to the inputs. It becomes quite larger after tri-state merge, creating a network for all cases in which the bus will be driven 1 and another network for all cases in which the output will be driven 0. There should be some way to recognize these kinds of buses and leave them undisturbed.