changeset 790a214be1f4 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=790a214be1f4
description:
        cpu: Add O3 CPU width checks

        O3CPU has a compile-time maximum width set in o3/impl.hh, but checking
        the configuration against this limit was not implemented anywhere
        except for fetch. Configuring a wider pipe than the limit can silently
        cause various issues during the simulation. This patch adds the proper
        checking in the constructor of the various pipeline stages.

diffstat:

 src/cpu/o3/commit_impl.hh |   5 +++++
 src/cpu/o3/decode_impl.hh |   5 +++++
 src/cpu/o3/iew_impl.hh    |  13 +++++++++++++
 src/cpu/o3/rename_impl.hh |   5 +++++
 4 files changed, 28 insertions(+), 0 deletions(-)

diffs (68 lines):

diff -r a9be596271b7 -r 790a214be1f4 src/cpu/o3/commit_impl.hh
--- a/src/cpu/o3/commit_impl.hh Wed Apr 23 05:17:59 2014 -0400
+++ b/src/cpu/o3/commit_impl.hh Wed Apr 23 05:18:18 2014 -0400
@@ -108,6 +108,11 @@
       canHandleInterrupts(true),
       avoidQuiesceLiveLock(false)
 {
+    if (commitWidth > Impl::MaxWidth)
+        fatal("commitWidth (%d) is larger than compiled limit (%d),\n"
+             "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
+             commitWidth, static_cast<int>(Impl::MaxWidth));
+
     _status = Active;
     _nextStatus = Inactive;
     std::string policy = params->smtCommitPolicy;
diff -r a9be596271b7 -r 790a214be1f4 src/cpu/o3/decode_impl.hh
--- a/src/cpu/o3/decode_impl.hh Wed Apr 23 05:17:59 2014 -0400
+++ b/src/cpu/o3/decode_impl.hh Wed Apr 23 05:18:18 2014 -0400
@@ -68,6 +68,11 @@
       decodeWidth(params->decodeWidth),
       numThreads(params->numThreads)
 {
+    if (decodeWidth > Impl::MaxWidth)
+        fatal("decodeWidth (%d) is larger than compiled limit (%d),\n"
+             "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
+             decodeWidth, static_cast<int>(Impl::MaxWidth));
+
     // @todo: Make into a parameter
     skidBufferMax = (fetchToDecodeDelay + 1) *  params->fetchWidth;
 }
diff -r a9be596271b7 -r 790a214be1f4 src/cpu/o3/iew_impl.hh
--- a/src/cpu/o3/iew_impl.hh    Wed Apr 23 05:17:59 2014 -0400
+++ b/src/cpu/o3/iew_impl.hh    Wed Apr 23 05:18:18 2014 -0400
@@ -79,6 +79,19 @@
       wbWidth(params->wbWidth),
       numThreads(params->numThreads)
 {
+    if (dispatchWidth > Impl::MaxWidth)
+        fatal("dispatchWidth (%d) is larger than compiled limit (%d),\n"
+             "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
+             dispatchWidth, static_cast<int>(Impl::MaxWidth));
+    if (issueWidth > Impl::MaxWidth)
+        fatal("issueWidth (%d) is larger than compiled limit (%d),\n"
+             "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
+             issueWidth, static_cast<int>(Impl::MaxWidth));
+    if (wbWidth > Impl::MaxWidth)
+        fatal("wbWidth (%d) is larger than compiled limit (%d),\n"
+             "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
+             wbWidth, static_cast<int>(Impl::MaxWidth));
+
     _status = Active;
     exeStatus = Running;
     wbStatus = Idle;
diff -r a9be596271b7 -r 790a214be1f4 src/cpu/o3/rename_impl.hh
--- a/src/cpu/o3/rename_impl.hh Wed Apr 23 05:17:59 2014 -0400
+++ b/src/cpu/o3/rename_impl.hh Wed Apr 23 05:18:18 2014 -0400
@@ -71,6 +71,11 @@
       maxPhysicalRegs(params->numPhysIntRegs + params->numPhysFloatRegs
                       + params->numPhysCCRegs)
 {
+    if (renameWidth > Impl::MaxWidth)
+        fatal("renameWidth (%d) is larger than compiled limit (%d),\n"
+             "\tincrease MaxWidth in src/cpu/o3/impl.hh\n",
+             renameWidth, static_cast<int>(Impl::MaxWidth));
+
     // @todo: Make into a parameter.
     skidBufferMax = (2 * (decodeToRenameDelay * params->decodeWidth)) + 
renameWidth;
 }
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to