summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-06-27 05:49:49 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2013-06-27 05:49:49 -0400
commit10650fc5257c2351e95292747ad6099cea9dfb1f (patch)
tree58f9ab1301cfb8b75ae4f7865fa30c7f6f607422 /src
parent368f50a0a1caaddf84ef35a5597f5eee75495cbb (diff)
downloadgem5-10650fc5257c2351e95292747ad6099cea9dfb1f.tar.xz
cpu: Consider instructions waiting for FU completion in draining
This patch changes the IEW drain check to include the FU pool as there can be instructions that are "stored" in FU completion events and thus not covered by the existing checks. With this patch, we simply include a check to see if all the FUs are considered non-busy in the next tick. Without this patch, the pc-switcheroo-full regression fails after minor changes to the cache timing (aligning to clock edge).
Diffstat (limited to 'src')
-rw-r--r--src/cpu/o3/fu_pool.cc12
-rw-r--r--src/cpu/o3/fu_pool.hh6
-rw-r--r--src/cpu/o3/iew_impl.hh11
3 files changed, 19 insertions, 10 deletions
diff --git a/src/cpu/o3/fu_pool.cc b/src/cpu/o3/fu_pool.cc
index 78af428db..3edc2c35b 100644
--- a/src/cpu/o3/fu_pool.cc
+++ b/src/cpu/o3/fu_pool.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 ARM Limited
+ * Copyright (c) 2012-2013 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -255,12 +255,14 @@ FUPool::dump()
}
}
-void
-FUPool::drainSanityCheck() const
+bool
+FUPool::isDrained() const
{
- assert(unitsToBeFreed.empty());
+ bool is_drained = true;
for (int i = 0; i < numFU; i++)
- assert(!unitBusy[i]);
+ is_drained = is_drained && !unitBusy[i];
+
+ return is_drained;
}
//
diff --git a/src/cpu/o3/fu_pool.hh b/src/cpu/o3/fu_pool.hh
index 85912af3a..79b2adf83 100644
--- a/src/cpu/o3/fu_pool.hh
+++ b/src/cpu/o3/fu_pool.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012 ARM Limited
+ * Copyright (c) 2012-2013 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -169,8 +169,8 @@ class FUPool : public SimObject
return maxIssueLatencies[capability];
}
- /** Perform sanity checks after a drain. */
- void drainSanityCheck() const;
+ /** Have all the FUs drained? */
+ bool isDrained() const;
/** Takes over from another CPU's thread. */
void takeOverFrom() {};
diff --git a/src/cpu/o3/iew_impl.hh b/src/cpu/o3/iew_impl.hh
index 5bd5f6ae9..5d18789c3 100644
--- a/src/cpu/o3/iew_impl.hh
+++ b/src/cpu/o3/iew_impl.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010-2012 ARM Limited
+ * Copyright (c) 2010-2013 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
@@ -376,6 +376,14 @@ DefaultIEW<Impl>::isDrained() const
}
}
+ // Also check the FU pool as instructions are "stored" in FU
+ // completion events until they are done and not accounted for
+ // above
+ if (drained && !fuPool->isDrained()) {
+ DPRINTF(Drain, "FU pool still busy.\n");
+ drained = false;
+ }
+
return drained;
}
@@ -387,7 +395,6 @@ DefaultIEW<Impl>::drainSanityCheck() const
instQueue.drainSanityCheck();
ldstQueue.drainSanityCheck();
- fuPool->drainSanityCheck();
}
template <class Impl>