Hello,
Another issue in the frontend_c::predict_bpu function is that if BP was disabled but the user sets perfect_BP, it will still act as perfect.
It might be more of a usability than a correctness issue but it sounds more intuitive if BP was disabled to void the effect of the perfect_BP parameter.
In that case, this line of code:
if (*m_simBase->m_knobs->KNOB_USE_BRANCH_PREDICTION) mispredicted = false;
can be replaced by the condition of use_branch_prediction:
if ((*m_simBase->m_knobs->KNOB_USE_BRANCH_PREDICTION) && (*m_simBase->m_knobs->KNOB_PERFECT_BP)) mispredicted = false;
Mohamed