diff options
author | Andreas Hansson <Andreas.Hansson@ARM.com> | 2014-01-24 15:29:30 -0600 |
---|---|---|
committer | Andreas Hansson <Andreas.Hansson@ARM.com> | 2014-01-24 15:29:30 -0600 |
commit | 4de69821e630576f40c55a26355ed1064c6a233c (patch) | |
tree | af3ffe39108110079b16667f51c5611182addf42 /src/sim | |
parent | 1d85e914a6b7a9b3550e84d2006ba775a27a0a44 (diff) | |
download | gem5-4de69821e630576f40c55a26355ed1064c6a233c.tar.xz |
sim: Expose the current voltage for each object as a stat
Diffstat (limited to 'src/sim')
-rw-r--r-- | src/sim/voltage_domain.cc | 12 | ||||
-rw-r--r-- | src/sim/voltage_domain.hh | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/sim/voltage_domain.cc b/src/sim/voltage_domain.cc index 43848d68a..461e672ea 100644 --- a/src/sim/voltage_domain.cc +++ b/src/sim/voltage_domain.cc @@ -61,6 +61,18 @@ VoltageDomain::voltage(double voltage) "Setting voltage to %f for domain %s\n", _voltage, name()); } +void +VoltageDomain::regStats() +{ + using namespace Stats; + + currentVoltage + .scalar(_voltage) + .name(params()->name + ".voltage") + .desc("Voltage in Volts") + ; +} + VoltageDomain * VoltageDomainParams::create() { diff --git a/src/sim/voltage_domain.hh b/src/sim/voltage_domain.hh index 585ec8d66..b2f6715cf 100644 --- a/src/sim/voltage_domain.hh +++ b/src/sim/voltage_domain.hh @@ -60,6 +60,11 @@ class VoltageDomain : public SimObject */ double _voltage; + /** + * Stat for reporting voltage of the domain + */ + Stats::Value currentVoltage; + public: typedef VoltageDomainParams Params; @@ -79,6 +84,8 @@ class VoltageDomain : public SimObject */ void voltage(double voltage); + void regStats(); + }; #endif |