Fix for squashing during a serializing instruction.
--HG-- extra : convert_revision : 04f9131258bfb7cca1654e00273edb29bde2366b
This commit is contained in:
parent
41051f35ac
commit
0f8fd5fd68
2 changed files with 37 additions and 7 deletions
|
@ -411,6 +411,10 @@ class DefaultRename
|
||||||
/** Whether or not rename needs to block this cycle. */
|
/** Whether or not rename needs to block this cycle. */
|
||||||
bool blockThisCycle;
|
bool blockThisCycle;
|
||||||
|
|
||||||
|
/** Whether or not rename needs to resume a serialize instruction
|
||||||
|
* after squashing. */
|
||||||
|
bool resumeSerialize;
|
||||||
|
|
||||||
/** The number of threads active in rename. */
|
/** The number of threads active in rename. */
|
||||||
unsigned numThreads;
|
unsigned numThreads;
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ DefaultRename<Impl>::DefaultRename(Params *params)
|
||||||
commitToRenameDelay(params->commitToRenameDelay),
|
commitToRenameDelay(params->commitToRenameDelay),
|
||||||
renameWidth(params->renameWidth),
|
renameWidth(params->renameWidth),
|
||||||
commitWidth(params->commitWidth),
|
commitWidth(params->commitWidth),
|
||||||
|
resumeSerialize(false),
|
||||||
numThreads(params->numberOfThreads),
|
numThreads(params->numberOfThreads),
|
||||||
maxPhysicalRegs(params->numPhysIntRegs + params->numPhysFloatRegs)
|
maxPhysicalRegs(params->numPhysIntRegs + params->numPhysFloatRegs)
|
||||||
{
|
{
|
||||||
|
@ -334,12 +335,22 @@ DefaultRename<Impl>::squash(const InstSeqNum &squash_seq_num, unsigned tid)
|
||||||
// If it still needs to block, the blocking should happen the next
|
// If it still needs to block, the blocking should happen the next
|
||||||
// cycle and there should be space to hold everything due to the squash.
|
// cycle and there should be space to hold everything due to the squash.
|
||||||
if (renameStatus[tid] == Blocked ||
|
if (renameStatus[tid] == Blocked ||
|
||||||
renameStatus[tid] == Unblocking ||
|
renameStatus[tid] == Unblocking) {
|
||||||
renameStatus[tid] == SerializeStall) {
|
|
||||||
|
|
||||||
toDecode->renameUnblock[tid] = 1;
|
toDecode->renameUnblock[tid] = 1;
|
||||||
|
|
||||||
|
resumeSerialize = false;
|
||||||
serializeInst[tid] = NULL;
|
serializeInst[tid] = NULL;
|
||||||
|
} else if (renameStatus[tid] == SerializeStall) {
|
||||||
|
if (serializeInst[tid]->seqNum <= squash_seq_num) {
|
||||||
|
DPRINTF(Rename, "Rename will resume serializing after squash\n");
|
||||||
|
resumeSerialize = true;
|
||||||
|
assert(serializeInst[tid]);
|
||||||
|
} else {
|
||||||
|
resumeSerialize = false;
|
||||||
|
toDecode->renameUnblock[tid] = 1;
|
||||||
|
|
||||||
|
serializeInst[tid] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the status to Squashing.
|
// Set the status to Squashing.
|
||||||
|
@ -477,6 +488,14 @@ DefaultRename<Impl>::rename(bool &status_change, unsigned tid)
|
||||||
++renameSquashCycles;
|
++renameSquashCycles;
|
||||||
} else if (renameStatus[tid] == SerializeStall) {
|
} else if (renameStatus[tid] == SerializeStall) {
|
||||||
++renameSerializeStallCycles;
|
++renameSerializeStallCycles;
|
||||||
|
// If we are currently in SerializeStall and resumeSerialize
|
||||||
|
// was set, then that means that we are resuming serializing
|
||||||
|
// this cycle. Tell the previous stages to block.
|
||||||
|
if (resumeSerialize) {
|
||||||
|
resumeSerialize = false;
|
||||||
|
block(tid);
|
||||||
|
toDecode->renameUnblock[tid] = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renameStatus[tid] == Running ||
|
if (renameStatus[tid] == Running ||
|
||||||
|
@ -1245,12 +1264,19 @@ DefaultRename<Impl>::checkSignalsAndUpdate(unsigned tid)
|
||||||
if (renameStatus[tid] == Squashing) {
|
if (renameStatus[tid] == Squashing) {
|
||||||
// Switch status to running if rename isn't being told to block or
|
// Switch status to running if rename isn't being told to block or
|
||||||
// squash this cycle.
|
// squash this cycle.
|
||||||
DPRINTF(Rename, "[tid:%u]: Done squashing, switching to running.\n",
|
if (!resumeSerialize) {
|
||||||
tid);
|
DPRINTF(Rename, "[tid:%u]: Done squashing, switching to running.\n",
|
||||||
|
tid);
|
||||||
|
|
||||||
renameStatus[tid] = Running;
|
renameStatus[tid] = Running;
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
DPRINTF(Rename, "[tid:%u]: Done squashing, switching to serialize.\n",
|
||||||
|
tid);
|
||||||
|
|
||||||
return false;
|
renameStatus[tid] = SerializeStall;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renameStatus[tid] == SerializeStall) {
|
if (renameStatus[tid] == SerializeStall) {
|
||||||
|
|
Loading…
Reference in a new issue