This patch modifies the SimpleTimingCPU drain check to also consider
the fetch event. Previously, there was an assumption that there is
never a fetch event scheduled if the CPU is not executing
microcode. However, when a context is activated, a fetch even is
scheduled, and microPC() is zero.
if (_status == Idle ||
(_status == BaseSimpleCPU::Running && isDrained())) {
- assert(!fetchEvent.scheduled());
DPRINTF(Drain, "No need to drain.\n");
return 0;
} else {
* of a gem5 microcode sequence.
*
* <li>Stay at PC is true.
+ *
+ * <li>A fetch event is scheduled. Normally this would never be the
+ case with microPC() == 0, but right after a context is
+ activated it can happen.
* </ul>
*/
bool isDrained() {
- return microPC() == 0 &&
- !stayAtPC;
+ return microPC() == 0 && !stayAtPC && !fetchEvent.scheduled();
}
/**