configs: Port CPUConfig to use the common object list

Factor out ObjectList functionality from CPUConfig.

Change-Id: I34ca55142e14559e584d38b6cca3aa5c20923521
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20589
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Daniel R. Carvalho
2019-09-03 12:22:59 +02:00
committed by Daniel Carvalho
parent 3fee716f56
commit c957d00dfe
8 changed files with 78 additions and 104 deletions

View File

@@ -46,14 +46,14 @@ from m5.defines import buildEnv
from m5.objects import *
from .Benchmarks import *
from . import CpuConfig
from . import ObjectList
from . import BPConfig
from . import HWPConfig
from . import MemConfig
from . import PlatformConfig
def _listCpuTypes(option, opt, value, parser):
CpuConfig.print_cpu_list()
ObjectList.cpu_list.print()
sys.exit(0)
def _listBPTypes(option, opt, value, parser):
@@ -163,7 +163,7 @@ def addCommonOptions(parser):
action="callback", callback=_listCpuTypes,
help="List available CPU types")
parser.add_option("--cpu-type", type="choice", default="AtomicSimpleCPU",
choices=CpuConfig.cpu_names(),
choices=ObjectList.cpu_list.get_names(),
help = "type of cpu to run with")
parser.add_option("--list-bp-types",
action="callback", callback=_listBPTypes,
@@ -317,7 +317,8 @@ def addCommonOptions(parser):
parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
help="checkpoint and exit when active cpu count is reached")
parser.add_option("--restore-with-cpu", action="store", type="choice",
default="AtomicSimpleCPU", choices=CpuConfig.cpu_names(),
default="AtomicSimpleCPU",
choices=ObjectList.cpu_list.get_names(),
help = "cpu type for restoring from a checkpoint")