cpu: Add drain check functionality to IEW
IEW did not check the instQueue and memDepUnit to ensure they were drained. This caused issues when drainSanityCheck() did check those structures after asserting IEW was drained.
This commit is contained in:
parent
b31d9e93e2
commit
6847bbf7ce
5 changed files with 31 additions and 1 deletions
|
@ -381,7 +381,7 @@ template <class Impl>
|
|||
bool
|
||||
DefaultIEW<Impl>::isDrained() const
|
||||
{
|
||||
bool drained(ldstQueue.isDrained());
|
||||
bool drained = ldstQueue.isDrained() && instQueue.isDrained();
|
||||
|
||||
for (ThreadID tid = 0; tid < numThreads; tid++) {
|
||||
if (!insts[tid].empty()) {
|
||||
|
|
|
@ -145,6 +145,9 @@ class InstructionQueue
|
|||
/** Sets the global time buffer. */
|
||||
void setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr);
|
||||
|
||||
/** Determine if we are drained. */
|
||||
bool isDrained() const;
|
||||
|
||||
/** Perform sanity checks after a drain. */
|
||||
void drainSanityCheck() const;
|
||||
|
||||
|
|
|
@ -440,6 +440,17 @@ InstructionQueue<Impl>::setTimeBuffer(TimeBuffer<TimeStruct> *tb_ptr)
|
|||
fromCommit = timeBuffer->getWire(-commitToIEWDelay);
|
||||
}
|
||||
|
||||
template <class Impl>
|
||||
bool
|
||||
InstructionQueue<Impl>::isDrained() const
|
||||
{
|
||||
bool drained = dependGraph.empty() && instsToExecute.empty();
|
||||
for (ThreadID tid = 0; tid < numThreads; ++tid)
|
||||
drained = drained && memDepUnit[tid].isDrained();
|
||||
|
||||
return drained;
|
||||
}
|
||||
|
||||
template <class Impl>
|
||||
void
|
||||
InstructionQueue<Impl>::drainSanityCheck() const
|
||||
|
|
|
@ -104,6 +104,9 @@ class MemDepUnit
|
|||
/** Registers statistics. */
|
||||
void regStats();
|
||||
|
||||
/** Determine if we are drained. */
|
||||
bool isDrained() const;
|
||||
|
||||
/** Perform sanity checks after a drain. */
|
||||
void drainSanityCheck() const;
|
||||
|
||||
|
|
|
@ -127,6 +127,19 @@ MemDepUnit<MemDepPred, Impl>::regStats()
|
|||
.desc("Number of conflicting stores.");
|
||||
}
|
||||
|
||||
template <class MemDepPred, class Impl>
|
||||
bool
|
||||
MemDepUnit<MemDepPred, Impl>::isDrained() const
|
||||
{
|
||||
bool drained = instsToReplay.empty()
|
||||
&& memDepHash.empty()
|
||||
&& instsToReplay.empty();
|
||||
for (int i = 0; i < Impl::MaxThreads; ++i)
|
||||
drained = drained && instList[i].empty();
|
||||
|
||||
return drained;
|
||||
}
|
||||
|
||||
template <class MemDepPred, class Impl>
|
||||
void
|
||||
MemDepUnit<MemDepPred, Impl>::drainSanityCheck() const
|
||||
|
|
Loading…
Reference in a new issue