Bobby R. Bruce has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/49554 )
20 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
Change subject: tests: Update hello_se to use simple_binary_run.py
......................................................................
tests: Update hello_se to use simple_binary_run.py
Additionally: test_hello_se.py has been formatted with Python black.
Change-Id: I14235c74dae2d98be78aadfe4bf825ea881c5300
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49554
Tested-by: kokoro <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
D tests/gem5/hello_se/ref/simout
M tests/gem5/hello_se/test_hello_se.py
2 files changed, 53 insertions(+), 48 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/tests/gem5/hello_se/ref/simout b/tests/gem5/hello_se/ref/simout
deleted file mode 100644
index 9e8cf27..0000000
--- a/tests/gem5/hello_se/ref/simout
+++ /dev/null
@@ -1,3 +0,0 @@
-Global frequency set at 1000000000000 ticks per second
-**** REAL SIMULATION ****
-Hello world!
diff --git a/tests/gem5/hello_se/test_hello_se.py
b/tests/gem5/hello_se/test_hello_se.py
index 77fd18f..979a48a 100644
--- a/tests/gem5/hello_se/test_hello_se.py
+++ b/tests/gem5/hello_se/test_hello_se.py
@@ -39,75 +39,83 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-'''
+"""
Test file for the util m5 exit assembly instruction.
-'''
+"""
from testlib import *
+import re
+
static_progs = {
- constants.gcn3_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',)
+ constants.gcn3_x86_tag: (
+ "x86-hello64-static",
+ # "x86-hello32-static", # Running 32-bit binaries on gem5 is
broken:
+ #
https://gem5.atlassian.net/browse/GEM5-1074
+ ),
+ constants.arm_tag: (
+ "arm-hello64-static",
+ # "arm-hello32-static", # Running 32-bit binaries on gem5 is
broken.
+ #
https://gem5.atlassian.net/browse/GEM5-1074
+ ),
+ constants.mips_tag: ("mips-hello",),
+ constants.riscv_tag: ("riscv-hello",),
+ constants.sparc_tag: ("sparc-hello",),
}
-dynamic_progs = {
- constants.gcn3_x86_tag : ('hello64-dynamic',)
-}
+dynamic_progs = {constants.gcn3_x86_tag: ("x86-hello64-dynamic",)}
cpu_types = {
- constants.gcn3_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')
+ constants.gcn3_x86_tag: ("timing", "atomic", "o3"),
+ constants.arm_tag: ("timing", "atomic", "o3"),
+ constants.mips_tag: ("timing", "atomic", "o3"),
+ constants.riscv_tag: ("timing", "atomic", "o3"),
+ constants.sparc_tag: ("timing", "atomic"),
}
# We only want to test x86, arm, and riscv on quick. Mips and sparc will be
# left for long.
os_length = {
- 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,
- constants.sparc_tag : constants.long_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,
+ constants.sparc_tag: constants.long_tag,
}
-base_path = joinpath(config.bin_path, 'hello')
-urlbase = config.resource_url + '/test-progs/hello/bin/'
+if config.bin_path:
+ resource_path = config.bin_path
+else:
+ resource_path = joinpath(absdirpath(__file__), "..", "resources")
-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')),
-)
+regex = re.compile(r"Hello world!")
+stdout_verifier = verifier.MatchRegex(regex)
+
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 + '-' + 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'],
+ name="test-" + binary + "-" + cpu,
+ fixtures=(),
+ verifiers=(stdout_verifier,),
+ config=joinpath(
+ config.base_dir,
+ "configs",
+ "example",
+ "components-library",
+ "simple_binary_run.py",
+ ),
+ config_args=[
+ binary,
+ cpu,
+ "--override-download",
+ "--resource-directory",
+ resource_path,
+ ],
valid_isas=(isa,),
valid_hosts=hosts,
- length = os_length[isa],
+ length=os_length[isa],
)
# Run statically linked hello worlds
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49554
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: I14235c74dae2d98be78aadfe4bf825ea881c5300
Gerrit-Change-Number: 49554
Gerrit-PatchSet: 26
Gerrit-Owner: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s