}
}
@Override
public void propagate(InstanceState state) {
Value in = state.getPort(1);
BitWidth wout = state.getAttributeValue(ATTR_OUT_WIDTH);
String type = getType(state.getAttributeSet());
Value extend;
if (type.equals("one")) {
extend = Value.TRUE;
} else if (type.equals("sign")) {
int win = in.getWidth();
extend = win > 0 ? in.get(win - 1) : Value.ERROR;
} else if (type.equals("input")) {
extend = state.getPort(2);
if (extend.getWidth() != 1) extend = Value.ERROR;
} else {
extend = Value.FALSE;
}
Value out = in.extendWidth(wout.getWidth(), extend);
state.setPort(0, out, 1);
}