Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/35936 )

Change subject: cpu: Change how O3 handles requests for SMT in full system.
......................................................................

cpu: Change how O3 handles requests for SMT in full system.

Currently, when the numThreads parameter is set to something larger than
1 in full system mode, the O3 CPU will just silently change it back down
again to 1. This could be confusing to the user since it won't be
immediately apparent, even when looking at config.ini, that their config
isn't being respected.

This change moves that check into the CPU constructor, where CPU
behavior probably should be rather than the create() method which should
just build the object, and also turns it into an error.

Change-Id: I627ff8702b5e8aaad8839aa8d52524690be25619
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35936
Reviewed-by: Gabe Black <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/o3/cpu.cc
M src/cpu/o3/deriv.cc
2 files changed, 5 insertions(+), 8 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc
index 11fac25..20274e0 100644
--- a/src/cpu/o3/cpu.cc
+++ b/src/cpu/o3/cpu.cc
@@ -129,6 +129,9 @@
       system(params->system),
       lastRunningCycle(curCycle())
 {
+    fatal_if(FullSystem && params->numThreads > 1,
+            "SMT is not supported in O3 in full system mode currently.");
+
     if (!params->switched_out) {
         _status = Running;
     } else {
diff --git a/src/cpu/o3/deriv.cc b/src/cpu/o3/deriv.cc
index 757af6f..68baae4 100644
--- a/src/cpu/o3/deriv.cc
+++ b/src/cpu/o3/deriv.cc
@@ -35,11 +35,7 @@
 DerivO3CPU *
 DerivO3CPUParams::create()
 {
-    ThreadID actual_num_threads;
-    if (FullSystem) {
-        // Full-system only supports a single thread for the moment.
-        actual_num_threads = 1;
-    } else {
+    if (!FullSystem) {
         if (workload.size() > numThreads) {
fatal("Workload Size (%i) > Max Supported Threads (%i) on This CPU",
                   workload.size(), numThreads);
@@ -49,11 +45,9 @@

         // In non-full-system mode, we infer the number of threads from
         // the workload if it's not explicitly specified.
-        actual_num_threads =
+        numThreads =
             (numThreads >= workload.size()) ? numThreads : workload.size();
     }

-    numThreads = actual_num_threads;
-
     return new DerivO3CPU(this);
 }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/35936
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I627ff8702b5e8aaad8839aa8d52524690be25619
Gerrit-Change-Number: 35936
Gerrit-PatchSet: 4
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to