stdlib, resources: Update JSON data in workload (#532)

- resources field in workload now supports a dict with resources id and
version.

- Older workload JSON are still supported but added a deprecation waring
This commit is contained in:
Bobby R. Bruce
2023-11-16 10:11:13 -08:00
committed by GitHub

View File

@@ -964,10 +964,23 @@ def obtain_resource(
for key in resource_json["resources"].keys():
assert isinstance(key, str)
value = resource_json["resources"][key]
assert isinstance(value, str)
params[key] = obtain_resource(
value,
)
if isinstance(value, str):
warn(
"Deprecation warning: resources field in workloads has changed"
"from { category: id } to"
"{ category: { id: id, resource_version: resource_version } }"
"The current develop branch of gem5 supports both formats"
"but this will be removed in the 23.1 release."
)
params[key] = obtain_resource(
value,
)
elif isinstance(value, dict):
params[key] = obtain_resource(
value["id"],
resource_version=value["resource_version"],
)
if "additional_params" in resource_json:
for key in resource_json["additional_params"].keys():
assert isinstance(key, str)