tests: Update RISCV boot tests to use Ubuntu resource

This ubuntu disk image will execute an 'm5 exit' after boot and can
therefore be used to execute "boot exit" tests as part of our
long/nightly tests. These are included in this patch.

Change-Id: Ia5bdb1bfc3d9100b2ea15e23bddb49f7c4faf32d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52089
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Bobby R. Bruce
2021-10-26 19:42:59 -07:00
parent b504398df8
commit 6c68745818
2 changed files with 66 additions and 22 deletions

View File

@@ -80,7 +80,7 @@ parser.add_argument(
"-t",
"--tick-exit",
type=int,
required=True,
required=False,
help="The tick to exit the simulation.",
)
@@ -152,7 +152,7 @@ board.set_kernel_disk_workload(
resource_directory=args.resource_directory,
),
disk_image=Resource(
"riscv-disk-img",
"riscv-ubuntu-20.04-img",
resource_directory=args.resource_directory,
),
)

View File

@@ -26,6 +26,8 @@
import re
from typing import Optional
from testlib import *
if config.bin_path:
@@ -38,10 +40,11 @@ def test_boot(
cpu: str,
num_cpus: int,
cache_type: str,
to_tick: int,
length: str,
to_tick: Optional[int] = None,
):
name = "{}-cpu_{}-{}-cores_riscv-boot-test_to-tick".format(
name = "{}-cpu_{}-{}-cores_riscv-boot-test".format(
cpu, str(num_cpus), cache_type)
verifiers = []
@@ -52,6 +55,21 @@ def test_boot(
)
verifiers.append(verifier.MatchRegex(exit_regex))
config_args=[
"--cpu",
cpu,
"--num-cpus",
str(num_cpus),
"--mem-system",
cache_type,
"--resource-directory",
resource_path,
]
if to_tick:
name += "_to-tick"
config_args += ["--tick-exit", str(to_tick)]
gem5_verify_config(
name=name,
verifiers=verifiers,
@@ -63,18 +81,7 @@ def test_boot(
"configs",
"riscv_boot_exit_run.py",
),
config_args=[
"--cpu",
cpu,
"--num-cpus",
str(num_cpus),
"--mem-system",
cache_type,
"--tick-exit",
str(to_tick),
"--resource-directory",
resource_path,
],
config_args=config_args,
valid_isas=(constants.riscv_tag,),
valid_hosts=constants.supported_hosts,
length=length,
@@ -87,46 +94,83 @@ test_boot(
cpu="atomic",
num_cpus=1,
cache_type="classic",
to_tick=10000000000, # Simulates 1/100th of a second.
length=constants.quick_tag,
to_tick=10000000000, # Simulates 1/100th of a second.
)
test_boot(
cpu="timing",
num_cpus=1,
cache_type="classic",
to_tick=10000000000,
length=constants.quick_tag,
to_tick=10000000000,
)
test_boot(
cpu="timing",
num_cpus=1,
cache_type="mi_example",
to_tick=10000000000,
length=constants.quick_tag,
to_tick=10000000000,
)
test_boot(
cpu="o3",
num_cpus=1,
cache_type="classic",
to_tick=10000000000,
length=constants.quick_tag,
to_tick=10000000000,
)
test_boot(
cpu="timing",
num_cpus=4,
cache_type="classic",
to_tick=10000000000,
length=constants.quick_tag,
to_tick=10000000000,
)
test_boot(
cpu="timing",
num_cpus=4,
cache_type="mi_example",
to_tick=10000000000,
length=constants.quick_tag,
to_tick=10000000000,
)
#### The long (Nightly) tests ####
test_boot(
cpu="atomic",
num_cpus=1,
cache_type="classic",
length=constants.long_tag,
)
test_boot(
cpu="timing",
num_cpus=1,
cache_type="mi_example",
length=constants.long_tag,
)
test_boot(
cpu="timing",
num_cpus=4,
cache_type="mi_example",
length=constants.long_tag,
)
test_boot(
cpu="atomic",
num_cpus=4,
cache_type="classic",
length=constants.long_tag,
)
test_boot(
cpu="o3",
num_cpus=8,
cache_type="mi_example",
length=constants.long_tag,
)