stdlib: Add the LooppointCsvResource resource

This resource wraps the LooppointCsvLoader class so it may be obtained
as a specialized resource via gem5 resources.

Relevant tests and config scripts have been updated.

Change-Id: Ib8e5ff5500fb1560951c9c0110e3c3aec8ca3c42
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67857
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Bobby R. Bruce
2023-02-10 15:15:42 +00:00
committed by Bobby Bruce
parent 29b19530ce
commit 4ad1150372
4 changed files with 54 additions and 10 deletions

View File

@@ -29,6 +29,7 @@ import unittest
from pathlib import Path
from gem5.resources.resource import *
from gem5.resources.looppoint import LooppointCsvLoader
from gem5.isas import ISA
@@ -235,3 +236,23 @@ class ResourceSpecializationSuite(unittest.TestCase):
"directory-example documentation.", resource.get_documentation()
)
self.assertIsNone(resource.get_source())
def test_looppoint_pinpoints_resource(self) -> None:
"""Tests the creation of LooppointCreatorCSVResource via a Looppoint
pinpoints csv file."""
resource = obtain_resource(
resource_name="looppoint-pinpoint-csv-resource",
resource_directory=self.get_resource_dir(),
)
self.assertIsInstance(resource, LooppointCsvResource)
# The LooppointCreatorCSVResource should be a subtype of
# LooppointCsvLoader.
self.assertIsInstance(resource, LooppointCsvLoader)
self.assertEquals(
"A looppoint pinpoints csv file.", resource.get_documentation()
)
self.assertIsNone(resource.get_source())

View File

@@ -108,6 +108,15 @@
"warmup_interval": 23445,
"simpoint_list" : [2,3,4,15],
"weight_list" : [0.1, 0.2, 0.4, 0.3]
},
{
"type": "looppoint-pinpoint-csv",
"name": "looppoint-pinpoint-csv-resource",
"documentation" : "A looppoint pinpoints csv file.",
"is_zipped" : false,
"md5sum" : "199ab22dd463dc70ee2d034bfe045082",
"url": "http://dist.gem5.org/dist/develop/pinpoints/x86-matrix-multiply-omp-100-8-global-pinpoints-20230127",
"source" : null
}
]
}