diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2013-02-15 17:40:08 -0500 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2013-02-15 17:40:08 -0500 |
commit | e9f66dceac5ce2665001f9f74222964ef0aef74b (patch) | |
tree | 0c7ac355e9cfe1772676a76f2db8a8a61a59ec95 /configs/common/Simulation.py | |
parent | 7f1263f1446b789e9f88685ae763ba575e81e454 (diff) | |
download | gem5-e9f66dceac5ce2665001f9f74222964ef0aef74b.tar.xz |
config: Cleanup CPU configuration
The CPUs supported by the configuration scripts used to be
hard-coded. This was not ideal for several reasons. For example, the
configuration scripts depend on all CPU models even though only a
subset might have been compiled.
This changeset adds a new module to the configuration scripts that
automatically discovers the available CPU models from the compiled
SimObjects. As a nice bonus, the use of introspection allows us to
automatically generate a list of available CPU models suitable for
printing. This list is augmented with the Python doc string from the
underlying class if available.
Diffstat (limited to 'configs/common/Simulation.py')
-rw-r--r-- | configs/common/Simulation.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py index 70b21980e..d678c57a0 100644 --- a/configs/common/Simulation.py +++ b/configs/common/Simulation.py @@ -43,28 +43,19 @@ import sys from os import getcwd from os.path import join as joinpath +import CpuConfig + import m5 from m5.defines import buildEnv from m5.objects import * from m5.util import * -from O3_ARM_v7a import * addToPath('../common') def getCPUClass(cpu_type): - """Returns the required cpu class and the mode of operation. - """ - - if cpu_type == "timing": - return TimingSimpleCPU, 'timing' - elif cpu_type == "detailed": - return DerivO3CPU, 'timing' - elif cpu_type == "arm_detailed": - return O3_ARM_v7a_3, 'timing' - elif cpu_type == "inorder": - return InOrderCPU, 'timing' - else: - return AtomicSimpleCPU, 'atomic' + """Returns the required cpu class and the mode of operation.""" + cls = CpuConfig.get(cpu_type) + return cls, cls.memory_mode() def setCPUClass(options): """Returns two cpu classes and the initial mode of operation. |