endmatch
code addAB sigCD sigO
+ bool CD_SIGNED = false;
if (addA) {
addAB = addA;
sigCD = port(addAB, \B);
- sigCD.extend_u0(32, param(addAB, \B_SIGNED).as_bool());
+ CD_SIGNED = param(addAB, \B_SIGNED).as_bool();
}
if (addB) {
addAB = addB;
sigCD = port(addAB, \A);
- sigCD.extend_u0(32, param(addAB, \A_SIGNED).as_bool());
+ CD_SIGNED = param(addAB, \A_SIGNED).as_bool();
}
if (addAB) {
if (mul->type == \SB_MAC16) {
int natural_mul_width = GetSize(sigA) + GetSize(sigB);
int actual_mul_width = GetSize(sigH);
- int actual_acc_width = GetSize(sigO);
+ int actual_acc_width = GetSize(sigCD);
if ((actual_acc_width > actual_mul_width) && (natural_mul_width > actual_mul_width))
reject;
reject;
sigO = port(addAB, \Y);
+ sigCD.extend_u0(32, CD_SIGNED);
}
endcode
else if (muxB)
sigCD = port(muxAB, \A);
else log_abort();
- sigCD.extend_u0(32, addAB && param(addAB, \A_SIGNED).as_bool() && param(addAB, \B_SIGNED).as_bool());
+ sigCD.extend_u0(32, addAB && param(addAB, \A_SIGNED).as_bool() && param(addAB, \B_SIGNED).as_bool());
}
}
endcode