From d8cc5305979edcf6bd90effbcf6307f654d3f149 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 12 Dec 2023 14:28:11 -0800 Subject: [PATCH] stdlib: Add `get_local_path()` call to Looppoint resources Due to a change introduced in https://github.com/gem5/gem5/pull/625, a gem5 resource will not download any external files until `get_local_path()` is called. In the construction of the Looppoint Resources this function was not called, the `local_path` variable was called directly. As such, an error occured. The downside of this fix is the Looppoint resources external files are downloaded when `obtain_resource` is called, thus the bandwidth savings introduced with https://github.com/gem5/gem5/pull/625 will not occur for Looppoint resources. However, https://github.com/gem5/gem5/issues/644 proposes a fix which would supercede the https://github.com/gem5/gem5/pull/625 solution. Change-Id: I52181382a03e492ec1cb58b01e71bc4820af9ccc --- src/python/gem5/resources/resource.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/python/gem5/resources/resource.py b/src/python/gem5/resources/resource.py index d6746487ff..591515a6b9 100644 --- a/src/python/gem5/resources/resource.py +++ b/src/python/gem5/resources/resource.py @@ -578,7 +578,9 @@ class LooppointCsvResource(FileResource, LooppointCsvLoader): resource_version=resource_version, downloader=downloader, ) - LooppointCsvLoader.__init__(self, pinpoints_file=Path(local_path)) + LooppointCsvLoader.__init__( + self, pinpoints_file=Path(self.get_local_path()) + ) def get_category_name(cls) -> str: return "LooppointCsvResource" @@ -606,7 +608,7 @@ class LooppointJsonResource(FileResource, LooppointJsonLoader): downloader=downloader, ) LooppointJsonLoader.__init__( - self, looppoint_file=local_path, region_id=region_id + self, looppoint_file=self.get_local_path(), region_id=region_id ) def get_category_name(cls) -> str: