sim, stats: Move global stats to Root
authorAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 5 Oct 2020 14:21:59 +0000 (15:21 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 9 Oct 2020 09:56:52 +0000 (09:56 +0000)
commitb9c7dae41f3bac65042fba4ca1b6ec0a1e4f0780
treee18ad416a517df4e52cb4c5a3213733d10b78edb
parentbf0b292829e4ba4ff4f2825dfc7fecb9d95c2a08
sim, stats: Move global stats to Root

Global stats are currently exposed using the legacy stat system (i.e.,
without a parent group). This change moves global stats from
stat_control.cc to a group that gets exported from the Root object.

The implementation adds the Root::Stats class which has a single
global instance. This instance is exposed to the rest of the simulator
using the global rootStats symbol. The intention is that objects that
need global statistics in formulas access them through the rootStats
object.

The global names simSeconds, simTicks, simFreq, and hostSeconds are
now references to their respective members in the rootStats object.

Change-Id: I267b5244a0bcca93dd2dcf03388e7085bdd79c9e
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35616
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/sim/SConscript
src/sim/root.cc
src/sim/root.hh
src/sim/stat_control.cc
src/sim/stat_control.hh
src/sim/stats.cc [new file with mode: 0644]
src/sim/stats.hh