gem5.resources.client_api.abstract_client module

class gem5.resources.client_api.abstract_client.AbstractClient

Bases: ABC

filter_incompatible_resources(resources_to_filter: List[Dict[str, Any]], gem5_version: str | None = None) List[Dict[str, Any]]

Returns a filtered list resources based on gem5 version compatibility.

This function assumes if the minor component of a resource’s gem5_version is not specified, the resource is compatible with all minor versions of the same major version.

Likewise, if no hot-fix component is specified, it is assumed that the resource is compatible with all hot-fix versions of the same minor version.

  • ‘20.1’ would be compatible with gem5 ‘20.1.1.0’ and ‘20.1.2.0’.

  • ‘21.5.2’ would be compatible with gem5 ‘21.5.2.0’ and ‘21.5.2.0’.

  • ‘22.3.2.4’ would only be compatible with gem5 ‘22.3.2.4’.

Parameters:
  • resources_to_filter – The list of resources to filter.

  • gem5_version – The gem5 version in which the filtered resources should be compatible. If None, no filtering will be done.

abstract get_resources(client_queries: List[ClientQuery]) List[Dict[str, Any]]
Parameters:
  • client_queries – A list of client queries containing the information to query the resources. Each ClientQuery object can contain the following information: - resource_id: The ID of the Resource. - resource_version: The version of the Resource. - gem5_version: The version of gem5.

  • resource_version – The version of the Resource. Optional, if not set, all resource versions will be returned. Note: If resource_id is not set, this parameter will be ignored.

  • gem5_version – The version of gem5. Optional, if not set, all versions will be returned.

Returns:

A list of all the Resources with the given ID.

get_resources_by_id(client_queries: List[ClientQuery]) List[Dict[str, Any]]
Parameters:

client_queries – A list of ClientQuery objects containing the information to query the resources. Each ClientQuery object can contain the following information: - resource_id: The ID of the Resource. - resource_version: The version of the Resource. - gem5_version: The version of gem5.

Returns:

A list of all the Resources with the given ID.

sort_resources(resources: List) List

Sorts the resources by ID.

If the IDs are the same, the resources are sorted by version.

Parameters:

resources – A list of resources to sort.

Returns:

A list of sorted resources.