sim, x86: Replace EventWrapper use with EventFunctionWrapper
authorSean Wilson <spwilson2@wisc.edu>
Thu, 8 Jun 2017 16:35:45 +0000 (11:35 -0500)
committerSean Wilson <spwilson2@wisc.edu>
Tue, 20 Jun 2017 18:03:21 +0000 (18:03 +0000)
Change-Id: Ie1df07b70776208fc3631a73d403024636fc05a9
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3749
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Anthony Gutierrez <anthony.gutierrez@amd.com>

src/arch/x86/pagetable_walker.hh
src/sim/power/thermal_model.cc
src/sim/power/thermal_model.hh
src/sim/root.cc
src/sim/root.hh

index 9be35e6ccd0b1f45c3ef6f4d64dfb81bd60cc505..d71db7ea349fb4d7457e0e02c16d89170ccb8039 100644 (file)
@@ -178,7 +178,7 @@ namespace X86ISA
         /**
          * Event used to call startWalkWrapper.
          **/
-        EventWrapper<Walker, &Walker::startWalkWrapper> startWalkWrapperEvent;
+        EventFunctionWrapper startWalkWrapperEvent;
 
         // Functions for dealing with packets.
         bool recvTimingResp(PacketPtr pkt);
@@ -205,7 +205,7 @@ namespace X86ISA
             funcState(this, NULL, NULL, true), tlb(NULL), sys(params->system),
             masterId(sys->getMasterId(name())),
             numSquashable(params->num_squash_per_cycle),
-            startWalkWrapperEvent(this)
+            startWalkWrapperEvent([this]{ startWalkWrapper(); }, name())
         {
         }
     };
index 05ce42bc90de0f21e9abe1231e3558ead7eabb7e..d362da6806f806e70f469ab75ec4d630c255a842 100644 (file)
@@ -194,7 +194,7 @@ ThermalCapacitor::getEquation(ThermalNode * n, unsigned nnodes,
  * ThermalModel
  */
 ThermalModel::ThermalModel(const Params *p)
-    : ClockedObject(p), stepEvent(this), _step(p->step)
+    : ClockedObject(p), stepEvent([this]{ doStep(); }, name()), _step(p->step)
 {
 }
 
index 7ee4ffdc3ce5ee630fa102d19a488b5bf0de2ef3..b47061dbf2c61bf17796bedc32c94a176dc2b287 100644 (file)
@@ -179,7 +179,7 @@ class ThermalModel : public ClockedObject
     std::vector <ThermalNode*> eq_nodes;
 
     /** Stepping event to update the model values */
-    EventWrapper<ThermalModel, &ThermalModel::doStep> stepEvent;
+    EventFunctionWrapper stepEvent;
 
     /** Step in seconds for thermal updates */
     double _step;
index 752632b5eed94967e62c7b77ec35aa8c0f8f1a25..f4aabad2e5151b23a98978fdb1973bfe8d64373d 100644 (file)
@@ -104,8 +104,9 @@ Root::timeSyncSpinThreshold(Time newThreshold)
     timeSyncEnable(en);
 }
 
-Root::Root(RootParams *p) : SimObject(p), _enabled(false),
-    _periodTick(p->time_sync_period), syncEvent(this)
+Root::Root(RootParams *p)
+    : SimObject(p), _enabled(false), _periodTick(p->time_sync_period),
+      syncEvent([this]{ timeSync(); }, name())
 {
     _period.setTick(p->time_sync_period);
     _spinThreshold.setTick(p->time_sync_spin_threshold);
index 7273a077b256185ecc882b34a23ca504aefe2548..db207a77b87edb4072e87f8a699ab3a3cf5ea581 100644 (file)
@@ -60,8 +60,7 @@ class Root : public SimObject
     Time lastTime;
 
     void timeSync();
-    EventWrapper<Root, &Root::timeSync> syncEvent;
-    friend class EventWrapper<Root, &Root::timeSync>;
+    EventFunctionWrapper syncEvent;
 
   public:
     /**