tests: Add Simpoints example scripts as tests
These both ensure these example scripts still work as intended and provides tests for the stdlib Simpoint API. Change-Id: I549c3d22458a5013a335857c83a4e78dc425e37d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/63931 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
committed by
Bobby Bruce
parent
cc3c15f1e0
commit
3e51091806
@@ -107,12 +107,13 @@ board.set_se_binary_workload(
|
||||
binary=Resource("x86-print-this"), arguments=["print this", 15000]
|
||||
)
|
||||
|
||||
# configs/example/gem5_library/checkpoints/simpoints-se-checkpoint.py has to
|
||||
# run before running this script.
|
||||
# In here, it will get the path of the first SimPoint checkpoint taken by the
|
||||
# simpoints-se-checkpoint.py
|
||||
dir = Path("se_checkpoint_folder")
|
||||
subfolder = [int(str(name).split(".")[1]) for name in dir.iterdir()]
|
||||
# Here we obtain the checkpoints from gem5 resources, but these are generated
|
||||
# from `configs/example/gem5_library/checkpoints/simpoints-se-checkpoint.py`.If
|
||||
# run prior to this script the `dir = Path("se_checkpoint_folder")` line may be
|
||||
# used. The resource is pulled so we may run this script as a test.
|
||||
# dir = Path("se_checkpoint_folder")
|
||||
dir = Path(Resource("simpoints-se-checkpoints-v22-1").get_local_path())
|
||||
subfolder = [int(str(name).rsplit(".", 1)[1]) for name in dir.iterdir()]
|
||||
dir = Path(dir / f"cpt.{min(subfolder)}").as_posix()
|
||||
|
||||
|
||||
|
||||
@@ -86,6 +86,42 @@ gem5_verify_config(
|
||||
length=constants.quick_tag,
|
||||
)
|
||||
|
||||
gem5_verify_config(
|
||||
name="test-simpoints-se-checkpoint",
|
||||
fixtures=(),
|
||||
verifiers=(),
|
||||
config=joinpath(
|
||||
config.base_dir,
|
||||
"configs",
|
||||
"example",
|
||||
"gem5_library",
|
||||
"checkpoints",
|
||||
"simpoints-se-checkpoint.py",
|
||||
),
|
||||
config_args=[],
|
||||
valid_isas=(constants.all_compiled_tag,),
|
||||
valid_hosts=constants.supported_hosts,
|
||||
length=constants.quick_tag,
|
||||
)
|
||||
|
||||
gem5_verify_config(
|
||||
name="test-simpoints-se-restore",
|
||||
fixtures=(),
|
||||
verifiers=(),
|
||||
config=joinpath(
|
||||
config.base_dir,
|
||||
"configs",
|
||||
"example",
|
||||
"gem5_library",
|
||||
"checkpoints",
|
||||
"simpoints-se-restore.py",
|
||||
),
|
||||
config_args=[],
|
||||
valid_isas=(constants.all_compiled_tag,),
|
||||
valid_hosts=constants.supported_hosts,
|
||||
length=constants.quick_tag,
|
||||
)
|
||||
|
||||
if os.access("/dev/kvm", mode=os.R_OK | os.W_OK):
|
||||
# The x86-ubuntu-run uses KVM cores, this test will therefore only be run
|
||||
# on systems that support KVM.
|
||||
|
||||
Reference in New Issue
Block a user