From 3af3c1121b2bfead7d9a6a3893fe27cedb93238a Mon Sep 17 00:00:00 2001 From: Harshil Patel Date: Mon, 2 Oct 2023 23:27:32 -0700 Subject: [PATCH] stdlib, resources: Addressed requested changes Change-Id: I22abdc3bdcdde52301ed10cb3113e8925159c245 Co-authored-by: Kunal Pai --- .../riscvmatched-microbenchmark-suite.py | 12 +++--------- src/python/gem5/resources/resource.py | 1 - .../test_gem5_library_examples.py | 17 +++++++++++++++++ .../stdlib/resources/pyunit_suite_checks.py | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/configs/example/gem5_library/riscvmatched-microbenchmark-suite.py b/configs/example/gem5_library/riscvmatched-microbenchmark-suite.py index 2d189717e2..7e08355e31 100644 --- a/configs/example/gem5_library/riscvmatched-microbenchmark-suite.py +++ b/configs/example/gem5_library/riscvmatched-microbenchmark-suite.py @@ -50,15 +50,9 @@ microbenchmarks = obtain_resource("riscv-vertical-microbenchmarks") # list all the microbenchmarks present in the suite print("Microbenchmarks present in the suite:") print("====================================") -for ( - id, - resource_version, - input_group, - workload, -) in microbenchmarks.get_all_workloads(): - print(f"Workload ID: {id}") - print(f"Workload Version: {resource_version}") - print(f"Workload Input Groups: {input_group}") +for workload in microbenchmarks: + print(f"Workload ID: {workload.get_id()}") + print(f"Workload Version: {workload.get_resource_version()}") print(f"WorkloadResource Object: {workload}") print("====================================") diff --git a/src/python/gem5/resources/resource.py b/src/python/gem5/resources/resource.py index ac7769b83f..af8a8d9acd 100644 --- a/src/python/gem5/resources/resource.py +++ b/src/python/gem5/resources/resource.py @@ -980,7 +980,6 @@ def obtain_resource( # Once we know what AbstractResource subclass we are using, we create it. # The fields in the JSON object are assumed to map like-for-like to the # subclass contructor, so we can pass the resource_json map directly. - return resource_class(local_path=to_path, **resource_json) 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 0882fb0dfd..1967560d99 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 @@ -334,6 +334,23 @@ gem5_verify_config( length=constants.very_long_tag, ) +gem5_verify_config( + name="test-gem5-library-example-riscvmatched-microbenchmark-suite", + fixtures=(), + verifiers=(), + config=joinpath( + config.base_dir, + "configs", + "example", + "gem5_library", + "riscvmatched-microbenchmark-suite.py", + ), + config_args=[], + valid_isas=(constants.all_compiled_tag,), + valid_hosts=constants.supported_hosts, + length=constants.long_tag, +) + # The LoopPoint-Checkpointing feature is still under development, therefore # these tests are temporarily disabled until this feature is complete.# diff --git a/tests/pyunit/stdlib/resources/pyunit_suite_checks.py b/tests/pyunit/stdlib/resources/pyunit_suite_checks.py index 5de68a6b1a..480ba9f024 100644 --- a/tests/pyunit/stdlib/resources/pyunit_suite_checks.py +++ b/tests/pyunit/stdlib/resources/pyunit_suite_checks.py @@ -59,7 +59,7 @@ class CustomSuiteResourceTestSuite(unittest.TestCase): cls.workload1 = obtain_resource("simple-workload-1") cls.workload2 = obtain_resource("simple-workload-2") cls.SuiteResource = SuiteResource( - workload_obj_list={cls.workload1: set(), cls.workload2: set()} + workloads={cls.workload1: set(), cls.workload2: set()} ) @patch(