From: Bobby R. Bruce Date: Thu, 3 Dec 2020 21:12:21 +0000 (-0800) Subject: tests,arch-gcn3,arch-x86: Changed X86 testlib tests to GCN3_X86 X-Git-Tag: develop-gem5-snapshot~375 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=350cd7bb89319fa2185437f899ca061d0a16f56f;p=gem5.git tests,arch-gcn3,arch-x86: Changed X86 testlib tests to GCN3_X86 In an effort to get better test coverage, we've changed all X86 tests to use GCN3_X86. This will, as a minimum, ensure that GCN3 is regularly compiled. GCN3_X86 is a superset of X86 and all X86 tests should pass on GCN3_X86. Change-Id: I2684edfc4e48c3e311a400231293a9e04c701130 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38279 Reviewed-by: Matt Sinclair Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/ext/testlib/configuration.py b/ext/testlib/configuration.py index c9c10ead4..e5b75980d 100644 --- a/ext/testlib/configuration.py +++ b/ext/testlib/configuration.py @@ -233,6 +233,7 @@ def define_constants(constants): constants.isa_tag_type = 'isa' constants.x86_tag = 'X86' + constants.gcn3_x86_tag = 'GCN3_X86' constants.sparc_tag = 'SPARC' constants.riscv_tag = 'RISCV' constants.arm_tag = 'ARM' @@ -256,6 +257,7 @@ def define_constants(constants): constants.supported_tags = { constants.isa_tag_type : ( constants.x86_tag, + constants.gcn3_x86_tag, constants.sparc_tag, constants.riscv_tag, constants.arm_tag, @@ -283,6 +285,7 @@ def define_constants(constants): constants.target_host = { constants.arm_tag : (constants.host_arm_tag,), constants.x86_tag : (constants.host_x86_64_tag,), + constants.gcn3_x86_tag : (constants.host_x86_64_tag,), constants.sparc_tag : (constants.host_x86_64_tag,), constants.riscv_tag : (constants.host_x86_64_tag,), constants.mips_tag : (constants.host_x86_64_tag,), diff --git a/tests/gem5/cpu_tests/test.py b/tests/gem5/cpu_tests/test.py index 33a9c1278..393ff266f 100644 --- a/tests/gem5/cpu_tests/test.py +++ b/tests/gem5/cpu_tests/test.py @@ -46,16 +46,25 @@ from testlib import * workloads = ('Bubblesort','FloatMM') valid_isas = { - constants.x86_tag : ('AtomicSimpleCPU', 'TimingSimpleCPU', 'DerivO3CPU'), + constants.gcn3_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/' + +isa_url = { + constants.gcn3_x86_tag : base_url + "x86" + constants.arm_tag : base_url + "arm" + constants.riscv_tag : base_url + "riscv" +} + for isa in valid_isas: path = joinpath(base_path, isa.lower()) for workload in workloads: @@ -64,7 +73,7 @@ for isa in valid_isas: verifier.MatchStdout(ref_path), ) - url = base_url + isa.lower() + '/' + workload + url = isa_url[isa] + '/' + workload workload_binary = DownloadedProgram(url, path, workload) binary = joinpath(workload_binary.path, workload) diff --git a/tests/gem5/hello_se/test_hello_se.py b/tests/gem5/hello_se/test_hello_se.py index 5ebdd0cd9..77fd18f19 100644 --- a/tests/gem5/hello_se/test_hello_se.py +++ b/tests/gem5/hello_se/test_hello_se.py @@ -45,7 +45,7 @@ Test file for the util m5 exit assembly instruction. from testlib import * static_progs = { - constants.x86_tag : ('hello64-static', 'hello32-static'), + constants.gcn3_x86_tag : ('hello64-static', 'hello32-static'), constants.arm_tag : ('hello64-static', 'hello32-static'), constants.mips_tag : ('hello',), constants.riscv_tag : ('hello',), @@ -53,11 +53,12 @@ static_progs = { } dynamic_progs = { - constants.x86_tag : ('hello64-dynamic',) + constants.gcn3_x86_tag : ('hello64-dynamic',) } cpu_types = { - constants.x86_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'), + constants.gcn3_x86_tag : + ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'), constants.arm_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU','DerivO3CPU'), constants.mips_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'), constants.riscv_tag : @@ -65,18 +66,10 @@ cpu_types = { constants.sparc_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU') } -supported_os = { - 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 = { - constants.x86_tag : constants.quick_tag, + constants.gcn3_x86_tag : constants.quick_tag, constants.arm_tag : constants.quick_tag, constants.mips_tag : constants.long_tag, constants.riscv_tag : constants.quick_tag, @@ -87,18 +80,26 @@ base_path = joinpath(config.bin_path, 'hello') urlbase = config.resource_url + '/test-progs/hello/bin/' +isa_urls = { + constants.gcn3_x86_tag : urlbase + "x86/linux", + constants.arm_tag : urlbase + "arm/linux", + constants.mips_tag : urlbase + "mips/linux", + constants.riscv_tag : urlbase + "riscv/linux", + constants.sparc_tag : urlbase + "sparc/linux", +} + ref_path = joinpath(getcwd(), 'ref') verifiers = ( verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')), ) -def verify_config(isa, binary, operating_s, cpu, hosts): - url = urlbase + isa.lower() + '/' + operating_s + '/' + binary - path = joinpath(base_path, isa.lower(), operating_s) +def verify_config(isa, binary, cpu, hosts): + url = isa_urls[isa] + '/' + binary + path = joinpath(base_path, isa.lower()) hello_program = DownloadedProgram(url, path, binary) gem5_verify_config( - name='test-' + binary + '-' + operating_s + "-" + cpu, + name='test-' + binary + '-' + cpu, fixtures=(hello_program,), verifiers=verifiers, config=joinpath(config.base_dir, 'configs', 'example','se.py'), @@ -112,15 +113,11 @@ def verify_config(isa, binary, operating_s, cpu, hosts): # Run statically linked hello worlds for isa in static_progs: for binary in static_progs[isa]: - for operating_s in supported_os[isa]: - for cpu in cpu_types[isa]: - verify_config(isa, binary, operating_s, cpu, - constants.supported_hosts) + for cpu in cpu_types[isa]: + verify_config(isa, binary, cpu, constants.supported_hosts) # Run dynamically linked hello worlds for isa in dynamic_progs: for binary in dynamic_progs[isa]: - for operating_s in supported_os[isa]: - for cpu in cpu_types[isa]: - verify_config(isa, binary, operating_s, cpu, - constants.target_host[isa]) + for cpu in cpu_types[isa]: + verify_config(isa, binary, cpu, constants.target_host[isa]) diff --git a/tests/gem5/learning_gem5/part1_test.py b/tests/gem5/learning_gem5/part1_test.py index 4ca844295..4153165ec 100644 --- a/tests/gem5/learning_gem5/part1_test.py +++ b/tests/gem5/learning_gem5/part1_test.py @@ -35,7 +35,11 @@ gem5_verify_config( config=joinpath(config_path, 'simple.py'), config_args = [], length = constants.quick_tag, - valid_isas=(constants.x86_tag, constants.riscv_tag, constants.arm_tag), + valid_isas=( + constants.gcn3_x86_tag, + constants.riscv_tag, + constants.arm_tag, + ), ) # The "quick" two level tests. @@ -45,5 +49,9 @@ gem5_verify_config( config=joinpath(config_path, 'two_level.py'), config_args = [], length = constants.quick_tag, - valid_isas=(constants.x86_tag, constants.riscv_tag, constants.arm_tag), + valid_isas=( + constants.gcn3_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 d487f8096..24d623c3c 100644 --- a/tests/gem5/learning_gem5/part2_test.py +++ b/tests/gem5/learning_gem5/part2_test.py @@ -52,7 +52,7 @@ gem5_verify_config( config=joinpath(config_path, 'simple_memobj.py'), config_args = [], # note: by default the above script uses x86 - valid_isas=(constants.x86_tag,), + valid_isas=(constants.gcn3_x86_tag,), ) gem5_verify_config( @@ -61,7 +61,7 @@ gem5_verify_config( config=joinpath(config_path, 'simple_cache.py'), config_args = [], # note: by default the above script uses x86 - valid_isas=(constants.x86_tag,), + valid_isas=(constants.gcn3_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 e8ca35190..eb758afe5 100644 --- a/tests/gem5/learning_gem5/part3_test.py +++ b/tests/gem5/learning_gem5/part3_test.py @@ -39,8 +39,10 @@ gem5_verify_config( config=joinpath(config_path, 'simple_ruby.py'), config_args = [], protocol = 'MSI', - valid_isas=(constants.x86_tag,), # Currently only x86 has the threads test - valid_hosts=constants.target_host[constants.x86_tag], # dynamically linked + # Currently only x86 has the threads test + valid_isas=(constants.gcn3_x86_tag,), + # dynamically linked + valid_hosts=constants.target_host[constants.gcn3_x86_tag], ) gem5_verify_config( @@ -49,5 +51,6 @@ gem5_verify_config( config=joinpath(config_path, 'ruby_test.py'), config_args = [], protocol = 'MSI', - valid_isas=(constants.x86_tag,), # Currently only x86 has the threads test + # Currently only x86 has the threads test + valid_isas=(constants.gcn3_x86_tag,), ) diff --git a/tests/gem5/m5_util/test_exit.py b/tests/gem5/m5_util/test_exit.py index ff900b87b..1bc6e6f46 100644 --- a/tests/gem5/m5_util/test_exit.py +++ b/tests/gem5/m5_util/test_exit.py @@ -59,5 +59,5 @@ gem5_verify_config( fixtures=(test_program,), config=os.path.join(config.base_dir, 'configs', 'example','se.py'), config_args=['--cmd', joinpath(test_program.path, filename)], - valid_isas=(constants.x86_tag,) + valid_isas=(constants.gcn3_x86_tag,) ) diff --git a/tests/gem5/test_build/test_build.py b/tests/gem5/test_build/test_build.py index 07d8035ef..3a6a53460 100644 --- a/tests/gem5/test_build/test_build.py +++ b/tests/gem5/test_build/test_build.py @@ -31,7 +31,7 @@ import re import os from testlib import * -common_isas = [constants.x86_tag, constants.arm_tag, constants.riscv_tag] +common_isas = [constants.gcn3_x86_tag, constants.arm_tag, constants.riscv_tag] for isa in constants.supported_isas: if isa is constants.null_tag: continue diff --git a/tests/gem5/x86-boot-tests/test_linux_boot.py b/tests/gem5/x86-boot-tests/test_linux_boot.py index 542242514..62f82f916 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 @@ def test_boot(cpu_type, num_cpus, boot_type, host): '--num-cpus', num_cpus, '--boot-type', boot_type, ], - valid_isas = (constants.x86_tag,), + valid_isas = (constants.gcn3_x86_tag,), valid_hosts = host, length = constants.long_tag, )