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 <mattdsinclair@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Bobby R. Bruce
2020-12-03 13:12:21 -08:00
parent 9e03d3bb5d
commit 350cd7bb89
9 changed files with 56 additions and 36 deletions

View File

@@ -233,6 +233,7 @@ def define_constants(constants):
constants.isa_tag_type = 'isa' constants.isa_tag_type = 'isa'
constants.x86_tag = 'X86' constants.x86_tag = 'X86'
constants.gcn3_x86_tag = 'GCN3_X86'
constants.sparc_tag = 'SPARC' constants.sparc_tag = 'SPARC'
constants.riscv_tag = 'RISCV' constants.riscv_tag = 'RISCV'
constants.arm_tag = 'ARM' constants.arm_tag = 'ARM'
@@ -256,6 +257,7 @@ def define_constants(constants):
constants.supported_tags = { constants.supported_tags = {
constants.isa_tag_type : ( constants.isa_tag_type : (
constants.x86_tag, constants.x86_tag,
constants.gcn3_x86_tag,
constants.sparc_tag, constants.sparc_tag,
constants.riscv_tag, constants.riscv_tag,
constants.arm_tag, constants.arm_tag,
@@ -283,6 +285,7 @@ def define_constants(constants):
constants.target_host = { constants.target_host = {
constants.arm_tag : (constants.host_arm_tag,), constants.arm_tag : (constants.host_arm_tag,),
constants.x86_tag : (constants.host_x86_64_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.sparc_tag : (constants.host_x86_64_tag,),
constants.riscv_tag : (constants.host_x86_64_tag,), constants.riscv_tag : (constants.host_x86_64_tag,),
constants.mips_tag : (constants.host_x86_64_tag,), constants.mips_tag : (constants.host_x86_64_tag,),

View File

@@ -46,16 +46,25 @@ from testlib import *
workloads = ('Bubblesort','FloatMM') workloads = ('Bubblesort','FloatMM')
valid_isas = { valid_isas = {
constants.x86_tag : ('AtomicSimpleCPU', 'TimingSimpleCPU', 'DerivO3CPU'), constants.gcn3_x86_tag :
('AtomicSimpleCPU', 'TimingSimpleCPU', 'DerivO3CPU'),
constants.arm_tag: constants.arm_tag:
('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'), ('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'),
constants.riscv_tag: constants.riscv_tag:
('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'), ('AtomicSimpleCPU', 'TimingSimpleCPU', 'MinorCPU', 'DerivO3CPU'),
} }
base_path = joinpath(config.bin_path, 'cpu_tests') base_path = joinpath(config.bin_path, 'cpu_tests')
base_url = config.resource_url + '/gem5/cpu_tests/benchmarks/bin/' 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: for isa in valid_isas:
path = joinpath(base_path, isa.lower()) path = joinpath(base_path, isa.lower())
for workload in workloads: for workload in workloads:
@@ -64,7 +73,7 @@ for isa in valid_isas:
verifier.MatchStdout(ref_path), verifier.MatchStdout(ref_path),
) )
url = base_url + isa.lower() + '/' + workload url = isa_url[isa] + '/' + workload
workload_binary = DownloadedProgram(url, path, workload) workload_binary = DownloadedProgram(url, path, workload)
binary = joinpath(workload_binary.path, workload) binary = joinpath(workload_binary.path, workload)

View File

@@ -45,7 +45,7 @@ Test file for the util m5 exit assembly instruction.
from testlib import * from testlib import *
static_progs = { 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.arm_tag : ('hello64-static', 'hello32-static'),
constants.mips_tag : ('hello',), constants.mips_tag : ('hello',),
constants.riscv_tag : ('hello',), constants.riscv_tag : ('hello',),
@@ -53,11 +53,12 @@ static_progs = {
} }
dynamic_progs = { dynamic_progs = {
constants.x86_tag : ('hello64-dynamic',) constants.gcn3_x86_tag : ('hello64-dynamic',)
} }
cpu_types = { cpu_types = {
constants.x86_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'), constants.gcn3_x86_tag :
('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'),
constants.arm_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU','DerivO3CPU'), constants.arm_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU','DerivO3CPU'),
constants.mips_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'), constants.mips_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'),
constants.riscv_tag : constants.riscv_tag :
@@ -65,18 +66,10 @@ cpu_types = {
constants.sparc_tag : ('TimingSimpleCPU', 'AtomicSimpleCPU') 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 # We only want to test x86, arm, and riscv on quick. Mips and sparc will be
# left for long. # left for long.
os_length = { os_length = {
constants.x86_tag : constants.quick_tag, constants.gcn3_x86_tag : constants.quick_tag,
constants.arm_tag : constants.quick_tag, constants.arm_tag : constants.quick_tag,
constants.mips_tag : constants.long_tag, constants.mips_tag : constants.long_tag,
constants.riscv_tag : constants.quick_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/' 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') ref_path = joinpath(getcwd(), 'ref')
verifiers = ( verifiers = (
verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')), verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')),
) )
def verify_config(isa, binary, operating_s, cpu, hosts): def verify_config(isa, binary, cpu, hosts):
url = urlbase + isa.lower() + '/' + operating_s + '/' + binary url = isa_urls[isa] + '/' + binary
path = joinpath(base_path, isa.lower(), operating_s) path = joinpath(base_path, isa.lower())
hello_program = DownloadedProgram(url, path, binary) hello_program = DownloadedProgram(url, path, binary)
gem5_verify_config( gem5_verify_config(
name='test-' + binary + '-' + operating_s + "-" + cpu, name='test-' + binary + '-' + cpu,
fixtures=(hello_program,), fixtures=(hello_program,),
verifiers=verifiers, verifiers=verifiers,
config=joinpath(config.base_dir, 'configs', 'example','se.py'), 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 # Run statically linked hello worlds
for isa in static_progs: for isa in static_progs:
for binary in static_progs[isa]: for binary in static_progs[isa]:
for operating_s in supported_os[isa]: for cpu in cpu_types[isa]:
for cpu in cpu_types[isa]: verify_config(isa, binary, cpu, constants.supported_hosts)
verify_config(isa, binary, operating_s, cpu,
constants.supported_hosts)
# Run dynamically linked hello worlds # Run dynamically linked hello worlds
for isa in dynamic_progs: for isa in dynamic_progs:
for binary in dynamic_progs[isa]: for binary in dynamic_progs[isa]:
for operating_s in supported_os[isa]: for cpu in cpu_types[isa]:
for cpu in cpu_types[isa]: verify_config(isa, binary, cpu, constants.target_host[isa])
verify_config(isa, binary, operating_s, cpu,
constants.target_host[isa])

View File

@@ -35,7 +35,11 @@ gem5_verify_config(
config=joinpath(config_path, 'simple.py'), config=joinpath(config_path, 'simple.py'),
config_args = [], config_args = [],
length = constants.quick_tag, 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. # The "quick" two level tests.
@@ -45,5 +49,9 @@ gem5_verify_config(
config=joinpath(config_path, 'two_level.py'), config=joinpath(config_path, 'two_level.py'),
config_args = [], config_args = [],
length = constants.quick_tag, 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
),
) )

View File

@@ -52,7 +52,7 @@ gem5_verify_config(
config=joinpath(config_path, 'simple_memobj.py'), config=joinpath(config_path, 'simple_memobj.py'),
config_args = [], config_args = [],
# note: by default the above script uses x86 # note: by default the above script uses x86
valid_isas=(constants.x86_tag,), valid_isas=(constants.gcn3_x86_tag,),
) )
gem5_verify_config( gem5_verify_config(
@@ -61,7 +61,7 @@ gem5_verify_config(
config=joinpath(config_path, 'simple_cache.py'), config=joinpath(config_path, 'simple_cache.py'),
config_args = [], config_args = [],
# note: by default the above script uses x86 # 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 # Note: for simple memobj and simple cache I want to use the traffic generator

View File

@@ -39,8 +39,10 @@ gem5_verify_config(
config=joinpath(config_path, 'simple_ruby.py'), config=joinpath(config_path, 'simple_ruby.py'),
config_args = [], config_args = [],
protocol = 'MSI', protocol = 'MSI',
valid_isas=(constants.x86_tag,), # Currently only x86 has the threads test # Currently only x86 has the threads test
valid_hosts=constants.target_host[constants.x86_tag], # dynamically linked valid_isas=(constants.gcn3_x86_tag,),
# dynamically linked
valid_hosts=constants.target_host[constants.gcn3_x86_tag],
) )
gem5_verify_config( gem5_verify_config(
@@ -49,5 +51,6 @@ gem5_verify_config(
config=joinpath(config_path, 'ruby_test.py'), config=joinpath(config_path, 'ruby_test.py'),
config_args = [], config_args = [],
protocol = 'MSI', 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,),
) )

View File

@@ -59,5 +59,5 @@ gem5_verify_config(
fixtures=(test_program,), fixtures=(test_program,),
config=os.path.join(config.base_dir, 'configs', 'example','se.py'), config=os.path.join(config.base_dir, 'configs', 'example','se.py'),
config_args=['--cmd', joinpath(test_program.path, filename)], config_args=['--cmd', joinpath(test_program.path, filename)],
valid_isas=(constants.x86_tag,) valid_isas=(constants.gcn3_x86_tag,)
) )

View File

@@ -31,7 +31,7 @@ import re
import os import os
from testlib import * 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: for isa in constants.supported_isas:
if isa is constants.null_tag: continue if isa is constants.null_tag: continue

View File

@@ -60,7 +60,7 @@ def test_boot(cpu_type, num_cpus, boot_type, host):
'--num-cpus', num_cpus, '--num-cpus', num_cpus,
'--boot-type', boot_type, '--boot-type', boot_type,
], ],
valid_isas = (constants.x86_tag,), valid_isas = (constants.gcn3_x86_tag,),
valid_hosts = host, valid_hosts = host,
length = constants.long_tag, length = constants.long_tag,
) )