Automating SPEC CPU2006 Execution with GitHub Actions (6. Fixing the Frontend Plugin for SIFT Generation)

A huge number of trace files were being generated by mistake during SIFT generation, so I'll debug this.

In the check for the Region of Interest (ROI) start condition, the m_in_roi state check was inverted. Specifically, the problem was as follows.

// problematic code
if (m_in_roi && roi_inst_count == m_fast_forward_target) {
   std::cout << "[FRONTEND] Detail Mode Start\n";
   FrontendCallbacks<QemuFrontend>::handleMagic (threadid, SIM_CMD_ROI_START, 0, 0);
}

I changed the ROI start condition to !m_in_roi and made it set m_in_roi to true when the ROI starts.

// after the fix
if (!m_in_roi && roi_inst_count == m_fast_forward_target) {
   std::cout << "[FRONTEND] Detail Mode Start\n";
   FrontendCallbacks<QemuFrontend>::handleMagic (threadid, SIM_CMD_ROI_START, 0, 0);
   m_in_roi = true;
}

At the end of the ROI, I now set the instrumentation mode to Sift::ModeStop so that trace generation is reliably stopped.

if (m_in_roi && roi_inst_count == m_fast_forward_target + m_detailed_target) {
   std::cout << "[FRONTEND] Detail Mode End\n";
   FrontendCallbacks<QemuFrontend>::handleMagic (threadid, SIM_CMD_ROI_END, 0, 0);
   m_control->setInstrumentationMode(Sift::ModeStop);
   m_control->endROI(threadid);
   m_in_roi = false;
}

This is an English translation of the original Japanese post: GitHub ActionsでSPEC CPU2006の実行を自動化する (6. SIFT生成用のフロントエンドプラグイン修正)