gem5 / gem5

The official repository for the gem5 computer-system architecture simulator.
http://www.gem5.org
BSD 3-Clause "New" or "Revised" License
1.72k stars 1.26k forks source link

stdlib: fix LoopPoint module not getting relative counts #1766

Open studyztp opened 3 weeks ago

studyztp commented 3 weeks ago

When restoring a checkpoint for a LoopPoint, we need to use the relative count for the marker instead of the global count because the checkpoint does not record the PC count map at where the checkpoint was taken. However, the current LoopPoint stdlib module does not have a method to access the relative count information for the markers. This patch adds a method to use the relative count for the target PC count pairs when we have a target region id. We also offer a param to overwrite this default behavior as use_global_count.

Beside the above fix, this patch also ensure the region id is an integer to prevent unable to find the region id due to type difference. This patch also make sure the PcCountPair object return from the backend has the same type as the Python PcCountPair object to prevent unable to find the PcCountPair due to type difference.

studyztp commented 1 week ago

@BobbyRBruce this is the bug fix that I was mentioning. This should not change the user interface of the current module since it is hidden under the set_se_looppoint_workload.