changeset 8d327ffdba62 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=8d327ffdba62
description:
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:
src/cpu/o3/fu_pool.cc | 12 +++++++-----
src/cpu/o3/fu_pool.hh | 6 +++---
src/cpu/o3/iew_impl.hh | 11 +++++++++--
3 files changed, 19 insertions(+), 10 deletions(-)
diffs (83 lines):
diff -r 285458078a09 -r 8d327ffdba62 src/cpu/o3/fu_pool.cc
--- a/src/cpu/o3/fu_pool.cc Thu Jun 27 05:49:49 2013 -0400
+++ b/src/cpu/o3/fu_pool.cc Thu Jun 27 05:49:49 2013 -0400
@@ -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 @@
}
}
-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 -r 285458078a09 -r 8d327ffdba62 src/cpu/o3/fu_pool.hh
--- a/src/cpu/o3/fu_pool.hh Thu Jun 27 05:49:49 2013 -0400
+++ b/src/cpu/o3/fu_pool.hh Thu Jun 27 05:49:49 2013 -0400
@@ -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 @@
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 -r 285458078a09 -r 8d327ffdba62 src/cpu/o3/iew_impl.hh
--- a/src/cpu/o3/iew_impl.hh Thu Jun 27 05:49:49 2013 -0400
+++ b/src/cpu/o3/iew_impl.hh Thu Jun 27 05:49:49 2013 -0400
@@ -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 @@
}
}
+ // 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 @@
instQueue.drainSanityCheck();
ldstQueue.drainSanityCheck();
- fuPool->drainSanityCheck();
}
template <class Impl>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev