From: Gabe Black Date: Mon, 12 Oct 2020 00:19:51 +0000 (-0700) Subject: cpu: Change how O3 handles requests for SMT in full system. X-Git-Tag: develop-gem5-snapshot~627 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df6269b63425d98a1c4ef289b41a09772b67d6f2;p=gem5.git 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 Reviewed-by: Jason Lowe-Power Maintainer: Gabe Black Tested-by: kokoro --- diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 11fac25a0..20274e010 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -129,6 +129,9 @@ FullO3CPU::FullO3CPU(DerivO3CPUParams *params) 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 757af6f4e..68baae421 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 @@ DerivO3CPUParams::create() // 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); }