}
}
private static PinState getState(InstanceState state) {
PinAttributes attrs = (PinAttributes) state.getAttributeSet();
BitWidth width = attrs.width;
PinState ret = (PinState) state.getData();
if (ret == null) {
Value val = attrs.threeState ? Value.UNKNOWN : Value.FALSE;
if (width.getWidth() > 1) {
Value[] arr = new Value[width.getWidth()];
java.util.Arrays.fill(arr, val);
val = Value.create(arr);
}
ret = new PinState(val, val);
state.setData(ret);
}
if (ret.sending.getWidth() != width.getWidth()) {
ret.sending = ret.sending.extendWidth(width.getWidth(),
attrs.threeState ? Value.UNKNOWN : Value.FALSE);
}
if (ret.receiving.getWidth() != width.getWidth()) {
ret.receiving = ret.receiving.extendWidth(width.getWidth(), Value.UNKNOWN);
}
return ret;
}