configs,stdlib,tests: Remove get_runtime_isa() (#241)

`get_runtime_isa()` has been deprecated for some time. It is a leftover
piece of code from when gem5 was compiled to a single ISA and that ISA
used to configure the simulated system to use that ISA. Since multi-ISA
compilations are possible, `get_runtime_isa()` should not be used.
Unless the gem5 binary is compiled to a single ISA, a failure will
occur.

The new proceedure for specify which ISA to use is by the setting of the
correct `BaseCPU` implementation. E.g., `X86SimpleTimingCPU` of
`ArmO3CPU`.

This patch removes the remaining `get_runtime_isa()` instances and
removes the function itself. The `SimpleCore` class has been updated to
allow for it's CPU factory to return a class, needed by scripts in
"configs/common".

The deprecated functionality in the standard library, which allowed for
the specifying of an ISA when setting up a processor and/or core has
also been removed. Setting an ISA is now manditory.

Fixes #216.
This commit is contained in:
Bobby R. Bruce
2023-12-04 09:53:35 -08:00
committed by GitHub
parent 7b98641953
commit 569e21f798
20 changed files with 125 additions and 178 deletions

View File

@@ -53,7 +53,6 @@ from m5.util import (
from m5.util.fdthelper import *
from gem5.isas import ISA
from gem5.runtime import get_runtime_isa
addToPath("../../")
@@ -86,9 +85,8 @@ def cmd_line_template():
return None
def build_test_system(np):
def build_test_system(np, isa: ISA):
cmdline = cmd_line_template()
isa = get_runtime_isa()
if isa == ISA.MIPS:
test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0], cmdline=cmdline)
elif isa == ISA.SPARC:
@@ -384,7 +382,8 @@ else:
np = args.num_cpus
test_sys = build_test_system(np)
isa = ObjectList.CPUList.get_isa(args.cpu_type)
test_sys = build_test_system(np, isa)
if len(bm) == 2:
drive_sys = build_drive_system(np)

View File

@@ -55,7 +55,6 @@ from m5.util import (
)
from gem5.isas import ISA
from gem5.runtime import get_runtime_isa
addToPath("../../")
@@ -119,7 +118,7 @@ def get_processes(args):
idx += 1
if args.smt:
assert args.cpu_type == "DerivO3CPU"
assert isinstance(args.cpu_type, DerivO3CPU)
return multiprocesses, idx
else:
return multiprocesses, 1
@@ -150,7 +149,7 @@ if args.bench:
for app in apps:
try:
if get_runtime_isa() == ISA.ARM:
if ObjectList.CPUList().get_isa(args.cpu_type) == ISA.ARM:
exec(
"workload = %s('arm_%s', 'linux', '%s')"
% (app, args.arm_iset, args.spec_input)
@@ -165,7 +164,7 @@ if args.bench:
multiprocesses.append(workload.makeProcess())
except:
print(
f"Unable to find workload for {get_runtime_isa().name()}: {app}",
f"Unable to find workload for ISA: {app}",
file=sys.stderr,
)
sys.exit(1)