public void propagate(InstanceState state) {
BitWidth data = state.getAttributeValue(StdAttr.WIDTH);
BitWidth select = state.getAttributeValue(Plexers.ATTR_SELECT);
boolean enable = state.getAttributeValue(Plexers.ATTR_ENABLE).booleanValue();
int inputs = 1 << select.getWidth();
Value en = enable ? state.getPort(inputs + 1) : Value.TRUE;
Value out;
if (en == Value.FALSE) {
Object opt = state.getAttributeValue(Plexers.ATTR_DISABLED);
Value base = opt == Plexers.DISABLED_ZERO ? Value.FALSE : Value.UNKNOWN;
out = Value.repeat(base, data.getWidth());
} else if (en == Value.ERROR && state.isPortConnected(inputs + 1)) {
out = Value.createError(data);
} else {
Value sel = state.getPort(inputs);
if (sel.isFullyDefined()) {
out = state.getPort(sel.toIntValue());
} else if (sel.isErrorValue()) {
out = Value.createError(data);
} else {
out = Value.createUnknown(data);
}
}