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 <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2020-10-11 17:19:51 -07:00
parent 539247a4c7
commit df6269b634
2 changed files with 5 additions and 8 deletions

View File

@@ -129,6 +129,9 @@ FullO3CPU<Impl>::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 {

View File

@@ -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);
}