arch,cpu,mem,sim: Reimplement the SE translating proxy using the FS one.
[gem5.git] / src / sim / voltage_domain.cc
index 6f32dc7c009efe246fa4972943bbdde0c561c24f..5a973fa5f359877abc6d86d5ebfc32d28cd6549e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2014 ARM Limited
+ * Copyright (c) 2012-2014, 2019 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -33,9 +33,6 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Authors: Vasileios Spiliopoulos
- *          Akash Bagdia
  */
 
 #include "sim/voltage_domain.hh"
@@ -49,7 +46,7 @@
 #include "sim/sim_object.hh"
 
 VoltageDomain::VoltageDomain(const Params *p)
-    : SimObject(p), voltageOpPoints(p->voltage), _perfLevel(0)
+    : SimObject(p), voltageOpPoints(p->voltage), _perfLevel(0), stats(*this)
 {
     fatal_if(voltageOpPoints.empty(), "DVFS: Empty set of voltages for "\
              "voltage domain %s\n", name());
@@ -127,18 +124,6 @@ VoltageDomain::startup() {
     }
 }
 
-void
-VoltageDomain::regStats()
-{
-    SimObject::regStats();
-
-    currentVoltage
-        .method(this, &VoltageDomain::voltage)
-        .name(params()->name + ".voltage")
-        .desc("Voltage in Volts")
-        ;
-}
-
 VoltageDomain *
 VoltageDomainParams::create()
 {
@@ -157,3 +142,10 @@ VoltageDomain::unserialize(CheckpointIn &cp)
     UNSERIALIZE_SCALAR(_perfLevel);
     perfLevel(_perfLevel);
 }
+
+VoltageDomain::VoltageDomainStats::VoltageDomainStats(VoltageDomain &vd)
+    : Stats::Group(&vd),
+    ADD_STAT(voltage, "Voltage in Volts")
+{
+    voltage.method(&vd, &VoltageDomain::voltage);
+}