Bobby R. Bruce has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/38278 )
Change subject: tests: Standardized used of the ISA constants tags
......................................................................
tests: Standardized used of the ISA constants tags
Change-Id: I4a3966168a1d159bf4ac4cc3148e9c7a43c880e3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38278
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M tests/gem5/asmtest/tests.py
M tests/gem5/cpu_tests/test.py
M tests/gem5/dram-lowp/test_dram_lowp.py
M tests/gem5/hello_se/test_hello_se.py
M tests/gem5/insttest_se/test.py
M tests/gem5/learning_gem5/part1_test.py
M tests/gem5/learning_gem5/part2_test.py
M tests/gem5/learning_gem5/part3_test.py
M tests/gem5/m5_util/test_exit.py
M tests/gem5/m5threads_test_atomic/test.py
M tests/gem5/memory/test.py
M tests/gem5/x86-boot-tests/test_linux_boot.py
12 files changed, 61 insertions(+), 54 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/tests/gem5/asmtest/tests.py b/tests/gem5/asmtest/tests.py
index 026b230..f267b91 100755
--- a/tests/gem5/asmtest/tests.py
+++ b/tests/gem5/asmtest/tests.py
@@ -83,7 +83,7 @@
gem5_args = gem5_args,
config = config_file,
config_args = config_args,
- valid_isas = ('RISCV',),
+ valid_isas = (constants.riscv_tag,),
valid_hosts = constants.supported_hosts
)
diff --git a/tests/gem5/cpu_tests/test.py b/tests/gem5/cpu_tests/test.py
index 44f0574..33a9c12 100644
--- a/tests/gem5/cpu_tests/test.py
+++ b/tests/gem5/cpu_tests/test.py
@@ -46,23 +46,25 @@
workloads = ('Bubblesort','FloatMM')
valid_isas = {
- 'x86': ('AtomicSimpleCPU', 'TimingSimpleCPU', 'DerivO3CPU'),
- 'arm':
('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'),
- 'riscv':
('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'),
+ constants.x86_tag :
('AtomicSimpleCPU', 'TimingSimpleCPU', 'DerivO3CPU'),
+ constants.arm_tag:
+ ('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'),
+ constants.riscv_tag:
+ ('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'),
}
base_path = joinpath(config.bin_path, 'cpu_tests')
base_url = config.resource_url + '/gem5/cpu_tests/benchmarks/bin/'
for isa in valid_isas:
- path = joinpath(base_path, isa)
+ path = joinpath(base_path, isa.lower())
for workload in workloads:
ref_path = joinpath(getcwd(), 'ref', workload)
verifiers = (
verifier.MatchStdout(ref_path),
)
- url = base_url + isa + '/' + workload
+ url = base_url + isa.lower() + '/' + workload
workload_binary = DownloadedProgram(url, path, workload)
binary = joinpath(workload_binary.path, workload)
@@ -72,6 +74,6 @@
verifiers=verifiers,
config=joinpath(getcwd(), 'run.py'),
config_args=['--cpu={}'.format(cpu), binary],
- valid_isas=(isa.upper(),),
+ valid_isas=(isa,),
fixtures=[workload_binary]
)
diff --git a/tests/gem5/dram-lowp/test_dram_lowp.py
b/tests/gem5/dram-lowp/test_dram_lowp.py
index 7a065f0..b90fca4 100644
--- a/tests/gem5/dram-lowp/test_dram_lowp.py
+++ b/tests/gem5/dram-lowp/test_dram_lowp.py
@@ -36,7 +36,7 @@
verifiers=verifiers,
config=joinpath(config.base_dir, 'configs', 'dram','low_power_sweep.py'),
config_args=['-p', 'close_adaptive', '-r', '2'],
- valid_isas=('NULL',),
+ valid_isas=(constants.null_tag,),
valid_hosts=constants.supported_hosts,
)
@@ -46,6 +46,6 @@
verifiers=verifiers,
config=joinpath(config.base_dir, 'configs', 'dram','low_power_sweep.py'),
config_args=['-p', 'open_adaptive', '-r', '2'],
- valid_isas=('NULL',),
+ valid_isas=(constants.null_tag,),
valid_hosts=constants.supported_hosts,
)
diff --git a/tests/gem5/hello_se/test_hello_se.py
b/tests/gem5/hello_se/test_hello_se.py
index abae3cf..5ebdd0c 100644
--- a/tests/gem5/hello_se/test_hello_se.py
+++ b/tests/gem5/hello_se/test_hello_se.py
@@ -45,41 +45,42 @@
from testlib import *
static_progs = {
- 'x86': ('hello64-static', 'hello32-static'),
- 'arm': ('hello64-static', 'hello32-static'),
- 'mips': ('hello',),
- 'riscv': ('hello',),
- 'sparc': ('hello',)
+ constants.x86_tag : ('hello64-static', 'hello32-static'),
+ constants.arm_tag : ('hello64-static', 'hello32-static'),
+ constants.mips_tag : ('hello',),
+ constants.riscv_tag : ('hello',),
+ constants.sparc_tag : ('hello',)
}
dynamic_progs = {
- 'x86': ('hello64-dynamic',)
+ constants.x86_tag : ('hello64-dynamic',)
}
cpu_types = {
- 'x86': ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'),
- 'arm' : ('TimingSimpleCPU', 'AtomicSimpleCPU','DerivO3CPU'),
- 'mips' : ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'),
- 'riscv' :
('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU', 'MinorCPU'),
- 'sparc' : ('TimingSimpleCPU', 'AtomicSimpleCPU')
+ constants.x86_tag :
('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'),
+ constants.arm_tag :
('TimingSimpleCPU', 'AtomicSimpleCPU','DerivO3CPU'),
+ constants.mips_tag :
('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'),
+ constants.riscv_tag :
+ ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU', 'MinorCPU'),
+ constants.sparc_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU')
}
supported_os = {
- 'x86': ('linux',),
- 'arm' : ('linux',),
- 'mips' : ('linux',),
- 'riscv' : ('linux',),
- 'sparc' : ('linux',)
+ constants.x86_tag : ('linux',),
+ constants.arm_tag : ('linux',),
+ constants.mips_tag : ('linux',),
+ constants.riscv_tag : ('linux',),
+ constants.sparc_tag : ('linux',)
}
# We only want to test x86, arm, and riscv on quick. Mips and sparc will be
# left for long.
os_length = {
- 'x86': constants.quick_tag,
- 'arm' : constants.quick_tag,
- 'mips' : constants.long_tag,
- 'riscv' : constants.quick_tag,
- 'sparc' : constants.long_tag,
+ constants.x86_tag : constants.quick_tag,
+ constants.arm_tag : constants.quick_tag,
+ constants.mips_tag : constants.long_tag,
+ constants.riscv_tag : constants.quick_tag,
+ constants.sparc_tag : constants.long_tag,
}
base_path = joinpath(config.bin_path, 'hello')
@@ -92,8 +93,8 @@
)
def verify_config(isa, binary, operating_s, cpu, hosts):
- url = urlbase + isa + '/' + operating_s + '/' + binary
- path = joinpath(base_path, isa, operating_s)
+ url = urlbase + isa.lower() + '/' + operating_s + '/' + binary
+ path = joinpath(base_path, isa.lower(), operating_s)
hello_program = DownloadedProgram(url, path, binary)
gem5_verify_config(
@@ -103,7 +104,7 @@
config=joinpath(config.base_dir, 'configs', 'example','se.py'),
config_args=['--cmd', joinpath(path, binary), '--cpu-type', cpu,
'--caches'],
- valid_isas=(isa.upper(),),
+ valid_isas=(isa,),
valid_hosts=hosts,
length = os_length[isa],
)
@@ -122,4 +123,4 @@
for operating_s in supported_os[isa]:
for cpu in cpu_types[isa]:
verify_config(isa, binary, operating_s, cpu,
- constants.target_host[isa.upper()])
+ constants.target_host[isa])
diff --git a/tests/gem5/insttest_se/test.py b/tests/gem5/insttest_se/test.py
index c58a42b..0d86f47 100644
--- a/tests/gem5/insttest_se/test.py
+++ b/tests/gem5/insttest_se/test.py
@@ -30,15 +30,15 @@
from testlib import *
test_progs = {
- 'sparc': ('insttest',)
+ constants.sparc_tag : ('insttest',)
}
cpu_types = {
- 'sparc' : ('AtomicSimpleCPU', 'TimingSimpleCPU')
+ constants.sparc_tag : ('AtomicSimpleCPU', 'TimingSimpleCPU')
}
supported_os = {
- 'sparc' : ('linux',)
+ constants.sparc_tag : ('linux',)
}
base_path = joinpath(config.bin_path, 'insttest')
@@ -48,15 +48,17 @@
for binary in test_progs[isa]:
for operating_s in supported_os[isa]:
import os
- url = urlbase + isa + '/' + operating_s + '/' + binary
- path = joinpath(base_path, isa, operating_s, binary)
+ url = urlbase + isa.lower() + '/' + operating_s + '/' + binary
+ path = joinpath(base_path, isa.lower(), operating_s, binary)
try:
program = DownloadedProgram(url, path, binary)
except:
continue
- ref_path = joinpath(getcwd(), 'ref', isa, operating_s, binary)
+ ref_path = joinpath(
+ getcwd(), 'ref', isa.lower(), operating_s, binary
+ )
verifiers = (
verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')),
)
@@ -71,6 +73,6 @@
'example','se.py'),
config_args=['--cmd', joinpath(path, binary),
'--cpu-type', cpu, '--caches'],
- valid_isas=(isa.upper(),),
+ valid_isas=(isa,),
length = constants.long_tag,
)
diff --git a/tests/gem5/learning_gem5/part1_test.py
b/tests/gem5/learning_gem5/part1_test.py
index f8363ac..4ca8442 100644
--- a/tests/gem5/learning_gem5/part1_test.py
+++ b/tests/gem5/learning_gem5/part1_test.py
@@ -35,7 +35,7 @@
config=joinpath(config_path, 'simple.py'),
config_args = [],
length = constants.quick_tag,
- valid_isas=('X86', 'RISCV', 'ARM'),
+ valid_isas=(constants.x86_tag, constants.riscv_tag, constants.arm_tag),
)
# The "quick" two level tests.
@@ -45,5 +45,5 @@
config=joinpath(config_path, 'two_level.py'),
config_args = [],
length = constants.quick_tag,
- valid_isas=('X86', 'RISCV', 'ARM'),
+ valid_isas=(constants.x86_tag, constants.riscv_tag, constants.arm_tag),
)
diff --git a/tests/gem5/learning_gem5/part2_test.py
b/tests/gem5/learning_gem5/part2_test.py
index 4209a9f..d487f80 100644
--- a/tests/gem5/learning_gem5/part2_test.py
+++ b/tests/gem5/learning_gem5/part2_test.py
@@ -35,7 +35,7 @@
verifiers = (get_verifier('simple'),),
config=joinpath(config_path, 'run_simple.py'),
config_args = [],
- valid_isas=("NULL",),
+ valid_isas=(constants.null_tag,),
)
gem5_verify_config(
@@ -43,7 +43,7 @@
verifiers =(get_verifier('hello_goodbye'),),
config=joinpath(config_path, 'hello_goodbye.py'),
config_args = [],
- valid_isas=("NULL",),
+ valid_isas=(constants.null_tag,),
)
gem5_verify_config(
@@ -51,7 +51,8 @@
verifiers =(verifier.MatchStdoutNoPerf(joinpath(ref_path, 'hello')),),
config=joinpath(config_path, 'simple_memobj.py'),
config_args = [],
- valid_isas=("X86",), # note: by default the above script uses x86
+ # note: by default the above script uses x86
+ valid_isas=(constants.x86_tag,),
)
gem5_verify_config(
@@ -59,7 +60,8 @@
verifiers =(verifier.MatchStdoutNoPerf(joinpath(ref_path, 'hello')),),
config=joinpath(config_path, 'simple_cache.py'),
config_args = [],
- valid_isas=("X86",), # note: by default the above script uses x86
+ # note: by default the above script uses x86
+ valid_isas=(constants.x86_tag,),
)
# Note: for simple memobj and simple cache I want to use the traffic
generator
diff --git a/tests/gem5/learning_gem5/part3_test.py
b/tests/gem5/learning_gem5/part3_test.py
index 9847ab7..e8ca351 100644
--- a/tests/gem5/learning_gem5/part3_test.py
+++ b/tests/gem5/learning_gem5/part3_test.py
@@ -39,8 +39,8 @@
config=joinpath(config_path, 'simple_ruby.py'),
config_args = [],
protocol = 'MSI',
- valid_isas=("X86",), # Currently only x86 has the threads test
- valid_hosts=constants.target_host["X86"], # dynamically linked
+ valid_isas=(constants.x86_tag,), # Currently only x86 has the threads
test
+ valid_hosts=constants.target_host[constants.x86_tag], # dynamically
linked
)
gem5_verify_config(
@@ -49,5 +49,5 @@
config=joinpath(config_path, 'ruby_test.py'),
config_args = [],
protocol = 'MSI',
- valid_isas=("X86",), # Currently only x86 has the threads test
+ valid_isas=(constants.x86_tag,), # Currently only x86 has the threads
test
)
diff --git a/tests/gem5/m5_util/test_exit.py
b/tests/gem5/m5_util/test_exit.py
index 98c3fbd..ff900b8 100644
--- a/tests/gem5/m5_util/test_exit.py
+++ b/tests/gem5/m5_util/test_exit.py
@@ -59,5 +59,5 @@
fixtures=(test_program,),
config=os.path.join(config.base_dir, 'configs', 'example','se.py'),
config_args=['--cmd', joinpath(test_program.path, filename)],
- valid_isas=('X86',)
+ valid_isas=(constants.x86_tag,)
)
diff --git a/tests/gem5/m5threads_test_atomic/test.py
b/tests/gem5/m5threads_test_atomic/test.py
index 6bb4eaf..9596d2f 100644
--- a/tests/gem5/m5threads_test_atomic/test.py
+++ b/tests/gem5/m5threads_test_atomic/test.py
@@ -57,7 +57,7 @@
config_args=['--cpu-type', cpu,
'--num-cores', '8',
'--cmd', joinpath(base_path, binary)],
- valid_isas=('SPARC',),
+ valid_isas=(constants.sparc_tag,),
valid_hosts=constants.supported_hosts,
length = constants.long_tag,
)
diff --git a/tests/gem5/memory/test.py b/tests/gem5/memory/test.py
index beed084..7b839f2 100644
--- a/tests/gem5/memory/test.py
+++ b/tests/gem5/memory/test.py
@@ -85,6 +85,6 @@
config=joinpath(config.base_dir, 'configs',
'example', basename_noext + '.py'),
config_args=args,
- valid_isas=('NULL',),
+ valid_isas=(constants.null_tag,),
valid_hosts=constants.supported_hosts,
)
diff --git a/tests/gem5/x86-boot-tests/test_linux_boot.py
b/tests/gem5/x86-boot-tests/test_linux_boot.py
index 3140595..5422425 100644
--- a/tests/gem5/x86-boot-tests/test_linux_boot.py
+++ b/tests/gem5/x86-boot-tests/test_linux_boot.py
@@ -60,7 +60,7 @@
'--num-cpus', num_cpus,
'--boot-type', boot_type,
],
- valid_isas = ('X86',),
+ valid_isas = (constants.x86_tag,),
valid_hosts = host,
length = constants.long_tag,
)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38278
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I4a3966168a1d159bf4ac4cc3148e9c7a43c880e3
Gerrit-Change-Number: 38278
Gerrit-PatchSet: 2
Gerrit-Owner: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Hoa Nguyen <hoangu...@ucdavis.edu>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s