Resetting stats #338
-
Hi, Is there an easy way to reset the stats that belong to the Unit's statistic set? I am trying to find a solution to a problem where stats are being incremented in the "warmup" phase of my simulation, but I want to clear the stats when I reach the end of my warmup phase and before I start real timing simulation where the stats collection matters. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Yes... and no. 😃 How are you getting statistical reports from the simulator? Are you using the end-of-simulation stats (auto-summary)? If so, you can't "reset" those stats. But you can generate a statistical report that "starts" after your warmup period has elapsed. This is only supported using the
command line option. Using this option, you can create customized reports, in different formats using a custom definition file. As an example of what you want to do... let's say you're running the
Then, create a yaml file detailing what stats you want collected for that report:
The keywords are documented in the online documentation for reports. Now, run the simulator:
Now, if you look at the generated report, you'll notice that only 100 instructions worth of stats were collected:
What the report mechanism does is collect a baseline of the stats at each starting trigger point for each report requested. Behind the scenes, the report mechanism "resets" the stats at the beginning point of the warmup. But the actual stats are not touched. This is important because you might want multiple reports starting at different locations. |
Beta Was this translation helpful? Give feedback.
-
To make this more interesting, the framework supports "yaml replacements" in case you have different warmup periods for different workloads. This allows you to use 1 report definition file for multiple disparate runs. To use yaml replacements:
First, in your report definition file, add a yaml replacement. This is a variable that begins and ends with '%':
Now, run the simulator with the variable "swapped out":
You should get the same report as in the example above. |
Beta Was this translation helpful? Give feedback.
Yes... and no. 😃
How are you getting statistical reports from the simulator? Are you using the end-of-simulation stats (auto-summary)? If so, you can't "reset" those stats.
But you can generate a statistical report that "starts" after your warmup period has elapsed. This is only supported using the
command line option.
Using this option, you can create customized reports, in different formats using a custom definition file.
As an example of what you want to do... let's say you're running the
sparta_core_example
and you want to start a report after 100 instructions have elapsed (a warmup). First, create the report definition file: