cpu: o3: remove member variable squashCounter

The variable is used in only one place and a whole new function setNextStatus()
has been defined just to compute the value of the variable.  Instead of calling
the function, the value is now computed in the loop that preceded the function
call.
This commit is contained in:
Nilay Vaish
2015-03-09 09:39:07 -05:00
parent f69a74fda6
commit 61edd5ac97
2 changed files with 11 additions and 38 deletions

View File

@@ -96,7 +96,6 @@ DefaultCommit<Impl>::TrapEvent::description() const
template <class Impl>
DefaultCommit<Impl>::DefaultCommit(O3CPU *_cpu, DerivO3CPUParams *params)
: cpu(_cpu),
squashCounter(0),
iewToCommitDelay(params->iewToCommitDelay),
commitToIEWDelay(params->commitToIEWDelay),
renameToROBDelay(params->renameToROBDelay),
@@ -460,7 +459,6 @@ DefaultCommit<Impl>::takeOverFrom()
tcSquash[tid] = false;
squashAfterInst[tid] = NULL;
}
squashCounter = 0;
rob->takeOverFrom();
}
@@ -508,32 +506,6 @@ DefaultCommit<Impl>::updateStatus()
_status = _nextStatus;
}
template <class Impl>
void
DefaultCommit<Impl>::setNextStatus()
{
int squashes = 0;
list<ThreadID>::iterator threads = activeThreads->begin();
list<ThreadID>::iterator end = activeThreads->end();
while (threads != end) {
ThreadID tid = *threads++;
if (commitStatus[tid] == ROBSquashing) {
squashes++;
}
}
squashCounter = squashes;
// If commit is currently squashing, then it will have activity for the
// next cycle. Set its next status as active.
if (squashCounter) {
_nextStatus = Active;
}
}
template <class Impl>
bool
DefaultCommit<Impl>::changedROBEntries()
@@ -856,6 +828,8 @@ DefaultCommit<Impl>::commit()
list<ThreadID>::iterator threads = activeThreads->begin();
list<ThreadID>::iterator end = activeThreads->end();
int num_squashing_threads = 0;
while (threads != end) {
ThreadID tid = *threads++;
@@ -941,11 +915,18 @@ DefaultCommit<Impl>::commit()
}
}
if (commitStatus[tid] == ROBSquashing) {
num_squashing_threads++;
}
}
setNextStatus();
// If commit is currently squashing, then it will have activity for the
// next cycle. Set its next status as active.
if (num_squashing_threads) {
_nextStatus = Active;
}
if (squashCounter != numThreads) {
if (num_squashing_threads != numThreads) {
// If we're not currently squashing, then get instructions.
getInsts();