From bb5251a27e72d5f8e1a0826eb79c2225a95a69d0 Mon Sep 17 00:00:00 2001 From: Tom Rollet Date: Tue, 1 Jun 2021 15:35:34 +0200 Subject: [PATCH] cpu-o3: fix dispatch assert triggering on debug mode On configs with renameWidth > dispatchWidth, on receiving renameWidth number of only squashed instructions: the dispatch stage will not be able to treat all instructions. Some squashed instructions will then remain in the 'inst' buffer after the dispatch stage. 'validInstsFromRename' function don't take into account squashed instructions, thus the remaining squashed instructions are not moved to the skid buffer. The cycle after, the assert in sortInsts will trigger(on debug mode) because the 'inst' buffer is not empty. Change-Id: I1a1ed5a7f040041363bd1b2c7bf10c85eb7febaf Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46600 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/cpu/o3/iew.cc | 15 +-------------- src/cpu/o3/iew.hh | 5 ----- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/cpu/o3/iew.cc b/src/cpu/o3/iew.cc index b53e389807..a3985ab297 100644 --- a/src/cpu/o3/iew.cc +++ b/src/cpu/o3/iew.cc @@ -590,19 +590,6 @@ IEW::instToCommit(const DynInstPtr& inst) (*iewQueue)[wbCycle].size++; } -unsigned -IEW::validInstsFromRename() -{ - unsigned inst_count = 0; - - for (int i=0; isize; i++) { - if (!fromRename->insts[i]->isSquashed()) - inst_count++; - } - - return inst_count; -} - void IEW::skidInsert(ThreadID tid) { @@ -875,7 +862,7 @@ IEW::dispatch(ThreadID tid) ++iewStats.unblockCycles; - if (validInstsFromRename()) { + if (fromRename->size != 0) { // Add the current inputs to the skid buffer so they can be // reprocessed when this stage unblocks. skidInsert(tid); diff --git a/src/cpu/o3/iew.hh b/src/cpu/o3/iew.hh index 5049eb4808..b1667df725 100644 --- a/src/cpu/o3/iew.hh +++ b/src/cpu/o3/iew.hh @@ -271,11 +271,6 @@ class IEW */ void writebackInsts(); - /** Returns the number of valid, non-squashed instructions coming from - * rename to dispatch. - */ - unsigned validInstsFromRename(); - /** Checks if any of the stall conditions are currently true. */ bool checkStall(ThreadID tid);