summaryrefslogtreecommitdiff
path: root/src/sim/ticked_object.hh
diff options
context:
space:
mode:
authorSean Wilson <spwilson2@wisc.edu>2017-06-27 13:07:51 -0500
committerSean Wilson <spwilson2@wisc.edu>2017-07-12 20:07:05 +0000
commit55f70760de9cf9d16905372d885b7925722721a8 (patch)
tree1c80dc85a693aa06172602866c5bd641caee6407 /src/sim/ticked_object.hh
parent1b7bf4ed75b55fdfc55d901775c837377268b661 (diff)
downloadgem5-55f70760de9cf9d16905372d885b7925722721a8.tar.xz
sim, gdb: Refactor some Event subclasses into lambdas
Change-Id: If3e4329204f27eda96b50ec6ac279ebc6ef23d99 Signed-off-by: Sean Wilson <spwilson2@wisc.edu> Reviewed-on: https://gem5-review.googlesource.com/3921 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/sim/ticked_object.hh')
-rw-r--r--src/sim/ticked_object.hh35
1 files changed, 5 insertions, 30 deletions
diff --git a/src/sim/ticked_object.hh b/src/sim/ticked_object.hh
index 3ba0045fc..ad7d6e93b 100644
--- a/src/sim/ticked_object.hh
+++ b/src/sim/ticked_object.hh
@@ -60,39 +60,14 @@ class TickedObjectParams;
class Ticked : public Serializable
{
protected:
- /** An event to call process periodically */
- class ClockEvent : public Event
- {
- public:
- Ticked &owner;
-
- ClockEvent(Ticked &owner_, Priority priority) :
- Event(priority),
- owner(owner_)
- { }
-
- /** Evaluate and reschedule */
- void
- process()
- {
- ++owner.tickCycles;
- ++owner.numCycles;
- owner.countCycles(Cycles(1));
- owner.evaluate();
- if (owner.running) {
- owner.object.schedule(this,
- owner.object.clockEdge(Cycles(1)));
- }
- }
- };
-
- friend class ClockEvent;
-
/** ClockedObject who is responsible for this Ticked's actions/stats */
ClockedObject &object;
- /** The single instance of ClockEvent used */
- ClockEvent event;
+ /** The wrapper for processClockEvent */
+ EventFunctionWrapper event;
+
+ /** Evaluate and reschedule */
+ void processClockEvent();
/** Have I been started? and am not stopped */
bool running;