X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fsim%2Fticked_object.hh;h=ad7d6e93b1930fda46ddc3d02fea3a2fe018f5c1;hb=200281b08ca21f0d2678e23063f088960d3c0819;hp=d8b69a3208b6fcd85352703ebac1b12741201750;hpb=a928a438b8a005e5b6059bc5db0687bf64abcfa6;p=gem5.git diff --git a/src/sim/ticked_object.hh b/src/sim/ticked_object.hh index d8b69a320..ad7d6e93b 100644 --- a/src/sim/ticked_object.hh +++ b/src/sim/ticked_object.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 ARM Limited + * Copyright (c) 2013-2014, 2017 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -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; @@ -190,7 +165,7 @@ class Ticked : public Serializable class TickedObject : public ClockedObject, public Ticked { public: - TickedObject(TickedObjectParams *params, + TickedObject(const TickedObjectParams *params, Event::Priority priority = Event::CPU_Tick_Pri); /** Disambiguate to make these functions overload correctly */