From 044d20f75cfe316dc909d750a2393e0f13dc31ab Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 5 Feb 2020 14:01:02 -0800 Subject: [PATCH] tests: Updated 'hello_se' to include other CPU types Some tests are ignored due to bugs in the test executables. This has been logged in the Jira issue here: https://gem5.atlassian.net/browse/GEM5-356 Jira: https://gem5.atlassian.net/browse/GEM5-109 Change-Id: Idd2db04175333d1c24604e736df7833c1e441480 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25063 Tested-by: kokoro Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce --- tests/gem5/.testignore | 126 +++++++++++++++++++-------- tests/gem5/hello_se/test_hello_se.py | 55 +++++++++--- 2 files changed, 132 insertions(+), 49 deletions(-) diff --git a/tests/gem5/.testignore b/tests/gem5/.testignore index 3a1514484..6d52d3fe7 100644 --- a/tests/gem5/.testignore +++ b/tests/gem5/.testignore @@ -1,39 +1,3 @@ -test-hello-RISCV-x86_64-opt -test-hello-RISCV-x86_64-debug -test-hello-RISCV-x86_64-fast -test-hello-RISCV-i386-opt -test-hello-RISCV-i386-debug -test-hello-RISCV-i386-fast -test-hello-RISCV-aarch64-opt -test-hello-RISCV-aarch64-debug -test-hello-RISCV-aarch64-fast -test-hello-SPARC-x86_64-opt -test-hello-SPARC-x86_64-debug -test-hello-SPARC-x86_64-fast -test-hello-SPARC-i386-opt -test-hello-SPARC-i386-debug -test-hello-SPARC-i386-fast -test-hello-SPARC-aarch64-opt -test-hello-SPARC-aarch64-debug -test-hello-SPARC-aarch64-fast -test-hello-MIPS-x86_64-opt -test-hello-MIPS-x86_64-debug -test-hello-MIPS-x86_64-fast -test-hello-MIPS-i386-opt -test-hello-MIPS-i386-debug -test-hello-MIPS-i386-fast -test-hello-MIPS-aarch64-opt -test-hello-MIPS-aarch64-debug -test-hello-MIPS-aarch64-fast -test-hello-ALPHA-x86_64-opt -test-hello-ALPHA-x86_64-debug -test-hello-ALPHA-x86_64-fast -test-hello-ALPHA-i386-opt -test-hello-ALPHA-i386-debug -test-hello-ALPHA-i386-fast -test-hello-ALPHA-aarch64-opt -test-hello-ALPHA-aarch64-debug -test-hello-ALPHA-aarch64-fast test-insttest-rv64a-linux-MinorCPU-RISCV-x86_64-opt test-insttest-rv64c-linux-MinorCPU-RISCV-x86_64-opt test-insttest-rv64d-linux-MinorCPU-RISCV-x86_64-opt @@ -133,3 +97,93 @@ test-insttest-rv64i-linux-TimingSimpleCPU-RISCV-i386-fast test-insttest-rv64i-linux-DerivO3CPU-RISCV-i386-fast test-insttest-linux-AtomicSimpleCPU-SPARC-i386-fast test-insttest-linux-TimingSimpleCPU-SPARC-i386-fast +test-hello-linux-MinorCPU-RISCV-x86_64-debug +test-hello-linux-MinorCPU-ALPHA-x86_64-debug +test-hello-linux-TimingSimpleCPU-SPARC-x86_64-debug +test-hello-linux-AtomicSimpleCPU-SPARC-x86_64-debug +test-hello-linux-TimingSimpleCPU-MIPS-x86_64-debug +test-hello-linux-AtomicSimpleCPU-MIPS-x86_64-debug +test-hello-linux-DerivO3CPU-MIPS-x86_64-debug +test-hello-linux-TimingSimpleCPU-ALPHA-x86_64-debug +test-hello-linux-AtomicSimpleCPU-ALPHA-x86_64-debug +test-hello-linux-DerivO3CPU-ALPHA-x86_64-debug +test-hello-linux-MinorCPU-RISCV-x86_64-fast +test-hello-linux-MinorCPU-ALPHA-x86_64-fast +test-hello-linux-TimingSimpleCPU-SPARC-x86_64-fast +test-hello-linux-AtomicSimpleCPU-SPARC-x86_64-fast +test-hello-linux-TimingSimpleCPU-MIPS-x86_64-fast +test-hello-linux-AtomicSimpleCPU-MIPS-x86_64-fast +test-hello-linux-DerivO3CPU-MIPS-x86_64-fast +test-hello-linux-TimingSimpleCPU-ALPHA-x86_64-fast +test-hello-linux-AtomicSimpleCPU-ALPHA-x86_64-fast +test-hello-linux-DerivO3CPU-ALPHA-x86_64-fast +test-hello-linux-MinorCPU-RISCV-x86_64-opt +test-hello-linux-MinorCPU-ALPHA-x86_64-opt +test-hello-linux-TimingSimpleCPU-SPARC-x86_64-opt +test-hello-linux-AtomicSimpleCPU-SPARC-x86_64-opt +test-hello-linux-TimingSimpleCPU-MIPS-x86_64-opt +test-hello-linux-AtomicSimpleCPU-MIPS-x86_64-opt +test-hello-linux-DerivO3CPU-MIPS-x86_64-opt +test-hello-linux-TimingSimpleCPU-ALPHA-x86_64-opt +test-hello-linux-AtomicSimpleCPU-ALPHA-x86_64-opt +test-hello-linux-DerivO3CPU-ALPHA-x86_64-opt +test-hello-linux-MinorCPU-RISCV-arch64-debug +test-hello-linux-MinorCPU-ALPHA-arch64-debug +test-hello-linux-TimingSimpleCPU-SPARC-arch64-debug +test-hello-linux-AtomicSimpleCPU-SPARC-arch64-debug +test-hello-linux-TimingSimpleCPU-MIPS-arch64-debug +test-hello-linux-AtomicSimpleCPU-MIPS-arch64-debug +test-hello-linux-DerivO3CPU-MIPS-arch64-debug +test-hello-linux-TimingSimpleCPU-ALPHA-arch64-debug +test-hello-linux-AtomicSimpleCPU-ALPHA-arch64-debug +test-hello-linux-DerivO3CPU-ALPHA-arch64-debug +test-hello-linux-MinorCPU-RISCV-arch64-fast +test-hello-linux-MinorCPU-ALPHA-arch64-fast +test-hello-linux-TimingSimpleCPU-SPARC-arch64-fast +test-hello-linux-AtomicSimpleCPU-SPARC-arch64-fast +test-hello-linux-TimingSimpleCPU-MIPS-arch64-fast +test-hello-linux-AtomicSimpleCPU-MIPS-arch64-fast +test-hello-linux-DerivO3CPU-MIPS-arch64-fast +test-hello-linux-TimingSimpleCPU-ALPHA-arch64-fast +test-hello-linux-AtomicSimpleCPU-ALPHA-arch64-fast +test-hello-linux-DerivO3CPU-ALPHA-arch64-fast +test-hello-linux-MinorCPU-RISCV-arch64-opt +test-hello-linux-MinorCPU-ALPHA-arch64-opt +test-hello-linux-TimingSimpleCPU-SPARC-arch64-opt +test-hello-linux-AtomicSimpleCPU-SPARC-arch64-opt +test-hello-linux-TimingSimpleCPU-MIPS-arch64-opt +test-hello-linux-AtomicSimpleCPU-MIPS-arch64-opt +test-hello-linux-DerivO3CPU-MIPS-arch64-opt +test-hello-linux-TimingSimpleCPU-ALPHA-arch64-opt +test-hello-linux-AtomicSimpleCPU-ALPHA-arch64-opt +test-hello-linux-DerivO3CPU-ALPHA-arch64-opt +test-hello-linux-MinorCPU-RISCV-i386-debug +test-hello-linux-MinorCPU-ALPHA-i386-debug +test-hello-linux-TimingSimpleCPU-SPARC-i386-debug +test-hello-linux-AtomicSimpleCPU-SPARC-i386-debug +test-hello-linux-TimingSimpleCPU-MIPS-i386-debug +test-hello-linux-AtomicSimpleCPU-MIPS-i386-debug +test-hello-linux-DerivO3CPU-MIPS-i386-debug +test-hello-linux-TimingSimpleCPU-ALPHA-i386-debug +test-hello-linux-AtomicSimpleCPU-ALPHA-i386-debug +test-hello-linux-DerivO3CPU-ALPHA-i386-debug +test-hello-linux-MinorCPU-RISCV-i386-fast +test-hello-linux-MinorCPU-ALPHA-i386-fast +test-hello-linux-TimingSimpleCPU-SPARC-i386-fast +test-hello-linux-AtomicSimpleCPU-SPARC-i386-fast +test-hello-linux-TimingSimpleCPU-MIPS-i386-fast +test-hello-linux-AtomicSimpleCPU-MIPS-i386-fast +test-hello-linux-DerivO3CPU-MIPS-i386-fast +test-hello-linux-TimingSimpleCPU-ALPHA-i386-fast +test-hello-linux-AtomicSimpleCPU-ALPHA-i386-fast +test-hello-linux-DerivO3CPU-ALPHA-i386-fast +test-hello-linux-MinorCPU-RISCV-i386-opt +test-hello-linux-MinorCPU-ALPHA-i386-opt +test-hello-linux-TimingSimpleCPU-SPARC-i386-opt +test-hello-linux-AtomicSimpleCPU-SPARC-i386-opt +test-hello-linux-TimingSimpleCPU-MIPS-i386-opt +test-hello-linux-AtomicSimpleCPU-MIPS-i386-opt +test-hello-linux-DerivO3CPU-MIPS-i386-opt +test-hello-linux-TimingSimpleCPU-ALPHA-i386-opt +test-hello-linux-AtomicSimpleCPU-ALPHA-i386-opt +test-hello-linux-DerivO3CPU-ALPHA-i386-opt diff --git a/tests/gem5/hello_se/test_hello_se.py b/tests/gem5/hello_se/test_hello_se.py index 07a083570..75043b91f 100644 --- a/tests/gem5/hello_se/test_hello_se.py +++ b/tests/gem5/hello_se/test_hello_se.py @@ -1,3 +1,6 @@ +# Copyright (c) 2020 The Regents of the University of California +# All Rights Reserved. +# # Copyright (c) 2020 ARM Limited # All rights reserved # @@ -54,6 +57,24 @@ dynamic_progs = { 'x86': ('hello64-dynamic',) } +cpu_types = { + 'x86': ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'), + 'arm' : ('TimingSimpleCPU', 'AtomicSimpleCPU','DerivO3CPU'), + 'alpha': ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU', 'MinorCPU'), + 'mips' : ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU'), + 'riscv' : ('TimingSimpleCPU', 'AtomicSimpleCPU', 'DerivO3CPU', 'MinorCPU'), + 'sparc' : ('TimingSimpleCPU', 'AtomicSimpleCPU') +} + +supported_os = { + 'x86': ('linux',), + 'arm' : ('linux',), + 'alpha' : ('linux',), + 'mips' : ('linux',), + 'riscv' : ('linux',), + 'sparc' : ('linux',) +} + if config.bin_path: base_path = config.bin_path else: @@ -61,32 +82,40 @@ else: 'bin') urlbase = 'http://dist.gem5.org/dist/current/test-progs/hello/bin/' + ref_path = joinpath(getcwd(), 'ref') verifiers = ( - verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')), + verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')), ) -def verify_config(isa, binary, hosts): - url = urlbase + isa + '/linux/' + binary - path = joinpath(base_path, isa, 'linux') +def verify_config(isa, binary, operating_s, cpu, hosts): + url = urlbase + isa + '/' + operating_s + '/' + binary + path = joinpath(base_path, isa, operating_s) hello_program = DownloadedProgram(url, path, binary) gem5_verify_config( - name='test-'+binary, - fixtures=(hello_program,), - verifiers=verifiers, - config=joinpath(config.base_dir, 'configs', 'example','se.py'), - config_args=['--cmd', joinpath(path, binary)], - valid_isas=(isa.upper(),), - valid_hosts=hosts, + name='test-' + binary + '-' + operating_s + "-" + cpu, + fixtures=(hello_program,), + verifiers=verifiers, + config=joinpath(config.base_dir, 'configs', 'example','se.py'), + config_args=['--cmd', joinpath(path, binary), '--cpu-type', cpu, + '--caches'], + valid_isas=(isa.upper(),), + valid_hosts=hosts, ) # Run statically linked hello worlds for isa in static_progs: for binary in static_progs[isa]: - verify_config(isa, binary, constants.supported_hosts) + for operating_s in supported_os[isa]: + for cpu in cpu_types[isa]: + verify_config(isa, binary, operating_s, cpu, + constants.supported_hosts) # Run dynamically linked hello worlds for isa in dynamic_progs: for binary in dynamic_progs[isa]: - verify_config(isa, binary, constants.target_host[isa.upper()]) + 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()]) -- 2.30.2