#include "sim/sim_exit.hh"
RubyDirectedTester::RubyDirectedTester(const Params *p)
- : MemObject(p), directedStartEvent(this),
+ : MemObject(p),
+ directedStartEvent([this]{ wakeup(); }, "Directed tick",
+ false, Event::CPU_Tick_Pri),
m_requests_to_complete(p->requests_to_complete),
generator(p->generator)
{
void print(std::ostream& out) const;
protected:
- class DirectedStartEvent : public Event
- {
- private:
- RubyDirectedTester *tester;
-
- public:
- DirectedStartEvent(RubyDirectedTester *_tester)
- : Event(CPU_Tick_Pri), tester(_tester)
- {}
- void process() { tester->wakeup(); }
- virtual const char *description() const { return "Directed tick"; }
- };
-
- DirectedStartEvent directedStartEvent;
+ EventFunctionWrapper directedStartEvent;
private:
void hitCallback(NodeID proc, Addr addr);
GarnetSyntheticTraffic::GarnetSyntheticTraffic(const Params *p)
: MemObject(p),
- tickEvent(this),
+ tickEvent([this]{ tick(); }, "GarnetSyntheticTraffic tick",
+ false, Event::CPU_Tick_Pri),
cachePort("GarnetSyntheticTraffic", this),
retryPkt(NULL),
size(p->memory_size),
void printAddr(Addr a);
protected:
- class TickEvent : public Event
- {
- private:
- GarnetSyntheticTraffic *cpu;
-
- public:
- TickEvent(GarnetSyntheticTraffic *c) : Event(CPU_Tick_Pri), cpu(c) {}
- void process() { cpu->tick(); }
- virtual const char *description() const
- {
- return "GarnetSyntheticTraffic tick";
- }
- };
-
- TickEvent tickEvent;
+ EventFunctionWrapper tickEvent;
class CpuPort : public MasterPort
{
};
#endif // __CPU_GARNET_SYNTHETIC_TRAFFIC_HH__
-
-
-
#include "sim/system.hh"
RubyTester::RubyTester(const Params *p)
- : MemObject(p), checkStartEvent(this),
+ : MemObject(p),
+ checkStartEvent([this]{ wakeup(); }, "RubyTester tick",
+ false, Event::CPU_Tick_Pri),
_masterId(p->system->getMasterId(name())),
m_checkTable_ptr(nullptr),
m_num_cpus(p->num_cpus),
MasterID masterId() { return _masterId; }
protected:
- class CheckStartEvent : public Event
- {
- private:
- RubyTester *tester;
-
- public:
- CheckStartEvent(RubyTester *_tester)
- : Event(CPU_Tick_Pri), tester(_tester)
- {}
- void process() { tester->wakeup(); }
- virtual const char *description() const { return "RubyTester tick"; }
- };
-
- CheckStartEvent checkStartEvent;
+ EventFunctionWrapper checkStartEvent;
MasterID _masterId;