gem5.resources.downloader.html
gem5.resources.downloader module¶
- gem5.resources.downloader.get_resource(resource_name: str, to_path: str, unzip: bool = True, untar: bool = True, download_md5_mismatch: bool = True, resource_version: str | None = None, clients: List | None = None, gem5_version: str | None = '25.0.0.1', quiet: bool = False) None¶
Obtains a gem5 resource and stored it to a specified location. If the specified resource is already at the location, no action is taken.
- Parameters:
resource_name – The resource to be obtained.
to_path – The location in the file system the resource is to be stored. The filename should be included.
unzip – If
True, gzipped resources will be unzipped prior to saving toto_path.Trueby default.untar – If
True, tar achieve resource will be unpacked prior to saving toto_path.Trueby default.download_md5_mismatch – If a resource is present with an incorrect hash (e.g., an outdated version of the resource is present),
get_resourcewill delete this local resource and re-download it if this parameter isTrue.Trueby default.resource_version – The version of the resource to be obtained. If
None, the latest version of the resource compatible with the working directory’s gem5 version will be obtained.Noneby default.clients – A list of clients to use when obtaining the resource. If
None, all clients will be used.Noneby default.gem5_version – The gem5 version to use when obtaining the resource. By default, the version of gem5 being used is used. This is used primarily for testing purposes.
quiet – If
True, no output will be printed to the console (baring exceptions).Falseby default.
- Raises:
Exception – An exception is thrown if a file is already present at
to_pathbut it does not have the correct md5 sum. An exception will also be thrown is a directory is present atto_path.
- gem5.resources.downloader.list_resources(clients: List | None = None, gem5_version: str | None = None) Dict[str, List[str]]¶
Lists all available resources. Returns a dictionary where the key is the id of the resources and the value is a list of that resource’s versions.
- Parameters:
clients – A list of clients to use when listing resources. If
None, all clients will be used.Noneby default.gem5_version – The gem5 version to which all resources should be compatible with. If
None, compatibility of resources is not considered and all resources will be returned.
Note
This function is here for legacy reasons. The
list_resourcesfunction was originally stored here. In order to remain backwards compatible, this function will call theclient_list_resourcesfunction.