changeset db307bac42fc in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=db307bac42fc
description:
sim: Expose the current voltage for each object as a stat
diffstat:
src/sim/voltage_domain.cc | 12 ++++++++++++
src/sim/voltage_domain.hh | 7 +++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diffs (46 lines):
diff -r 9d6d630f830e -r db307bac42fc src/sim/voltage_domain.cc
--- a/src/sim/voltage_domain.cc Fri Jan 24 15:29:30 2014 -0600
+++ b/src/sim/voltage_domain.cc Fri Jan 24 15:29:30 2014 -0600
@@ -61,6 +61,18 @@
"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 -r 9d6d630f830e -r db307bac42fc src/sim/voltage_domain.hh
--- a/src/sim/voltage_domain.hh Fri Jan 24 15:29:30 2014 -0600
+++ b/src/sim/voltage_domain.hh Fri Jan 24 15:29:30 2014 -0600
@@ -60,6 +60,11 @@
*/
double _voltage;
+ /**
+ * Stat for reporting voltage of the domain
+ */
+ Stats::Value currentVoltage;
+
public:
typedef VoltageDomainParams Params;
@@ -79,6 +84,8 @@
*/
void voltage(double voltage);
+ void regStats();
+
};
#endif
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev