gem5.resources.looppoint module

class gem5.resources.looppoint.Looppoint(regions: Dict[str | int, LooppointRegion])

Bases: object

Stores all the LoopPoint information for a gem5 workload.

get_current_pair() PcCountPair

This function returns the current PC Count pair.

get_current_region() str | int | None

Returns the region id if the current PC Count pair if significant (e.g. beginning of the checkpoint), otherwise, it returns None to indicate the current PC Count pair is not significant.

get_manager() PcCountTrackerManager

Returns the PcCountTrackerManager for this LoopPoint data structure.

get_region_start_id_map() Dict[PcCountPair, int | str]

Returns the starting PcCountPairs mapped to the corresponding region IDs. This is a helper function for quick mapping of PcCountPairs to region IDs.

get_regions() Dict[str | int, LooppointRegion]

Returns the regions for this Looppoint data structure.

get_targets() List[PcCountPair]

Returns the complete list of target PcCountPairs. That is, the PcCountPairs each region starts with as well as the relevant warmup intervals.

output_json_file(input_indent: int = 4, filepath: str = 'm5out/looppoint.json') Dict[int, Dict]

This function is used to output the _json_file into a json file.

Parameters:
  • input_indent – The indent value of the json file.

  • filepath – The path of the output json file.

set_target_region_id(region_id: str | int) None

There are use-cases where we want to obtain a LoopPoint data structure containing a single target region via its ID. This function will remove all irrelevant regions.

setup_processor(processor: AbstractProcessor) None

A function is used to setup a PC tracker in all the cores and connect all the tracker to the PC tracker manager to perform multithread PC tracking.

Parameters:

processor – The processor used in the simulation configuration.

to_json() Dict[int | str, Dict]

Returns this data-structure as a dictionary for serialization via the output_json_file function.

update_relatives_counts() None

Updates the relative count for restore usage. The new relative count will be stored in relevant data structures.

class gem5.resources.looppoint.LooppointCsvLoader(pinpoints_file: Path | str, region_id: str | int | None = None)

Bases: Looppoint

This class will create a LoopPoint data structure from data extracted from a LoopPoint pinpoints file.

class gem5.resources.looppoint.LooppointJsonLoader(looppoint_file: str | Path, region_id: str | int | None = None)

Bases: Looppoint

This class will create a generate a LoopPoint data structure from data extracted from a LoopPoint json file.

class gem5.resources.looppoint.LooppointRegion(simulation: LooppointSimulation, multiplier: float, warmup: LooppointRegionWarmup | None = None)

Bases: object

A data structure to store Looppoint region information.

Note

This is not intended to be a user-facing class. The classes LooppointJsonLoader and LooppointCSVLoader can be used to load and restore SimPoint data.

get_multiplier() float

Returns the multiplier.

get_pc_count_pairs() List[PcCountPair]

Returns the PC count pairs for this LoopPoint region.

get_simulation() LooppointSimulation

Returns the simulation region information.

get_start() PcCountPair

Returns the correct starting PcCountPair for this LoopPoint region.

get_warmup() LooppointRegionWarmup | None

If set, returns the warmup region information. Otherwise None.

to_json() Dict

Returns this class in a JSON structure which can then be serialized and later be restored from.

update_relatives_counts(manager: PcCountTrackerManager) None

Updates the relative counds of this LoopPoint region.

class gem5.resources.looppoint.LooppointRegionPC(pc: int, globl: int, relative: int | None = None)

Bases: object

A data structure for storing the Looppoint region’s PC information.

Note

This is not intended to be a user-facing class. The classes LooppointJsonLoader and LooppointCSVLoader can be used to load and restore Simpoint data.

get_global() int

Returns the global value.

get_pc() int

Returns the Program counter value.

get_pc_count_pair() PcCountPair

Returns the PcCountPair for this Region PC value.

get_relative() int | None

If specified, returns the relative Program counter value, otherwise returns None.

to_json() Dict[str, int]

Returns this class in a JSON structure which can then be serialized and later be restored from.

update_relative_count(manager: PcCountTrackerManager) None

Updates the relative count.

class gem5.resources.looppoint.LooppointRegionWarmup(start: PcCountPair, end: PcCountPair)

Bases: object

A data structure for storing a Looppoint region’s warmup data.

Note

This is not intended to be a user-facing class. The classes LooppointJsonLoader and LooppointCSVLoader can be used to load and restore SimPoint data.

get_end() PcCountPair

Returns the PcCountPair for the end of the region warmup.

get_pc_count_pairs() List[PcCountPair]

Returns the start and end PC count pairs.

get_start() PcCountPair

Returns the PcCountPair for the start of the region warmup.

to_json() Dict[str, Dict[str, int]]

Returns this class in a JSON structure which can then be serialized.

class gem5.resources.looppoint.LooppointSimulation(start: LooppointRegionPC, end: LooppointRegionPC)

Bases: object

A data structure to store the simulation region start and end region.

Note

This is not intended to be a user-facing class. The classes LooppointJsonLoader and LooppointCSVLoader can be used to load and restore Simpoint data.

get_end() LooppointRegionPC

Returns the ending LooppointRegionPC data structure.

get_pc_count_pairs() List[PcCountPair]

Returns the PC count pairs for the start and end LoopointRegionPCs.

get_start() LooppointRegionPC

Returns the starting LooppointRegionPC data structure.

to_json() Dict

Returns this class in a JSON structure which can then be serialized and later be restored from.

update_relatives_counts(manager: PcCountTrackerManager, include_start: bool = False) None

Updates the relative counts for this simulation region.