Daniel Gerzhoy has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/37676 )

Change subject: cpu-o3: Fixed halt assertion failure
......................................................................

cpu-o3: Fixed halt assertion failure

Halting the O3 CPU would cause an assertion failure because
instructions were not finished being squashed in the ROB.

Change-Id: I8b8c375d0e520861af3657249de987de2451b6f1
---
M src/cpu/SConscript
M src/cpu/o3/cpu.cc
M src/cpu/o3/rob_impl.hh
3 files changed, 30 insertions(+), 1 deletion(-)



diff --git a/src/cpu/SConscript b/src/cpu/SConscript
index 391d592..6421250 100644
--- a/src/cpu/SConscript
+++ b/src/cpu/SConscript
@@ -70,6 +70,7 @@
 DebugFlag('Quiesce')
 DebugFlag('Mwait')

+
 CompoundFlag('ExecAll', [ 'ExecEnable', 'ExecCPSeq', 'ExecEffAddr',
     'ExecFaulting', 'ExecFetchSeq', 'ExecOpClass', 'ExecRegDelta',
     'ExecResult', 'ExecSymbol', 'ExecThread',
diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index 1ef8154..dd4e2af 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -743,6 +743,15 @@
     deactivateThread(tid);
     removeThread(tid);

+    // If this was the last thread then unschedule the tick event.
+    if (activeThreads.size() == 0) {
+        if (tickEvent.scheduled())
+        {
+            unscheduleTickEvent();
+        }
+        lastRunningCycle = curCycle();
+        _status = Idle;
+    }
     updateCycleCounters(BaseCPU::CPU_STATE_SLEEP);
 }

@@ -821,6 +830,15 @@
     rename.clearStates(tid);
     iew.clearStates(tid);

+    // Flush out any old data from the time buffers.
+    for (int i = 0; i < timeBuffer.getSize(); ++i) {
+        timeBuffer.advance();
+        fetchQueue.advance();
+        decodeQueue.advance();
+        renameQueue.advance();
+        iewQueue.advance();
+    }
+
     // at this step, all instructions in the pipeline should be already
     // either committed successfully or squashed. All thread-specific
     // queues in the pipeline must be empty.
diff --git a/src/cpu/o3/rob_impl.hh b/src/cpu/o3/rob_impl.hh
index d4a02b5..73c8a4b 100644
--- a/src/cpu/o3/rob_impl.hh
+++ b/src/cpu/o3/rob_impl.hh
@@ -338,8 +338,18 @@

     bool robTailUpdate = false;

+    unsigned int numInstsToSquash = squashWidth;
+
+    // If the CPU is exiting, squash all of the instructions
+    // it is told to, even if that exceeds the squashWidth.
+    // Set the number to the number of entries (the max).
+    if (cpu->isThreadExiting(tid))
+    {
+        numInstsToSquash = numEntries;
+    }
+
     for (int numSquashed = 0;
-         numSquashed < squashWidth &&
+         numSquashed < numInstsToSquash &&
          squashIt[tid] != instList[tid].end() &&
          (*squashIt[tid])->seqNum > squashedSeqNum[tid];
          ++numSquashed)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/37676
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I8b8c375d0e520861af3657249de987de2451b6f1
Gerrit-Change-Number: 37676
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Gerzhoy <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to