Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/63931?usp=email )

Change subject: tests: Add Simpoints example scripts as tests
......................................................................

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+kok...@google.com>
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Bobby Bruce <bbr...@ucdavis.edu>
---
M configs/example/gem5_library/checkpoints/simpoints-se-restore.py
M tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
2 files changed, 59 insertions(+), 6 deletions(-)

Approvals:
  Bobby Bruce: Looks good to me, approved
  Jason Lowe-Power: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/configs/example/gem5_library/checkpoints/simpoints-se-restore.py b/configs/example/gem5_library/checkpoints/simpoints-se-restore.py
index 1a1bb05..4d49d9d 100644
--- a/configs/example/gem5_library/checkpoints/simpoints-se-restore.py
+++ b/configs/example/gem5_library/checkpoints/simpoints-se-restore.py
@@ -107,12 +107,13 @@
     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()


diff --git a/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py b/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
index 0acc1ae..ee212ae 100644
--- a/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
+++ b/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
@@ -86,6 +86,42 @@
     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.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/63931?usp=email 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: I549c3d22458a5013a335857c83a4e78dc425e37d
Gerrit-Change-Number: 63931
Gerrit-PatchSet: 3
Gerrit-Owner: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to