{
if (!alreadyScheduled(evt_time)) {
// This wakeup is not redundant
- ConsumerEvent *evt = new ConsumerEvent(this);
+ auto *evt = new EventFunctionWrapper(
+ [this]{ wakeup(); }, "Consumer Event", true);
+
em->schedule(evt, evt_time);
insertScheduledWakeupTime(evt_time);
}
private:
std::set<Tick> m_scheduled_wakeups;
ClockedObject *em;
-
- class ConsumerEvent : public Event
- {
- public:
- ConsumerEvent(Consumer* _consumer)
- : Event(Default_Pri, AutoDelete), m_consumer_ptr(_consumer)
- {
- }
-
- void process() { m_consumer_ptr->wakeup(); }
-
- private:
- Consumer* m_consumer_ptr;
- };
};
inline std::ostream&
}
GPUCoalescer::GPUCoalescer(const Params *p)
- : RubyPort(p), issueEvent(this), deadlockCheckEvent(this)
+ : RubyPort(p),
+ issueEvent([this]{ completeIssue(); }, "Issue coalesced request",
+ false, Event::Progress_Event_Pri),
+ deadlockCheckEvent([this]{ wakeup(); }, "GPUCoalescer deadlock check")
{
m_store_waiting_on_load_cycles = 0;
m_store_waiting_on_store_cycles = 0;
SequencerRequestType_to_string(requestType));
}
-GPUCoalescer::IssueEvent::IssueEvent(GPUCoalescer* _seq)
- : Event(Progress_Event_Pri), seq(_seq)
-{
-}
-
void
GPUCoalescer::completeIssue()
newKernelEnds.clear();
}
-void
-GPUCoalescer::IssueEvent::process()
-{
- seq->completeIssue();
-}
-
-const char *
-GPUCoalescer::IssueEvent::description() const
-{
- return "Issue coalesced request";
-}
-
void
GPUCoalescer::evictionCallback(Addr address)
{
bool handleLlsc(Addr address, GPUCoalescerRequest* request);
- class IssueEvent : public Event
- {
- private:
- GPUCoalescer *seq;
- public:
- IssueEvent(GPUCoalescer *_seq);
- void process();
- const char *description() const;
- };
-
- IssueEvent issueEvent;
+ EventFunctionWrapper issueEvent;
// Changed to protected to enable inheritance by VIPER Coalescer
bool m_runningGarnetStandalone;
- class GPUCoalescerWakeupEvent : public Event
- {
- private:
- GPUCoalescer *m_GPUCoalescer_ptr;
-
- public:
- GPUCoalescerWakeupEvent(GPUCoalescer *_seq) :
- m_GPUCoalescer_ptr(_seq) {}
- void process() { m_GPUCoalescer_ptr->wakeup(); }
- const char *description() const
- {
- return "GPUCoalescer deadlock check";
- }
- };
-
- GPUCoalescerWakeupEvent deadlockCheckEvent;
+ EventFunctionWrapper deadlockCheckEvent;
bool assumingRfOCoherence;
// m5 style stats for TCP hit/miss counts
}
#endif // __MEM_RUBY_SYSTEM_GPU_COALESCER_HH__
-
}
void
-RubySystem::RubyEvent::process()
+RubySystem::processRubyEvent()
{
- if (RubySystem::getWarmupEnabled()) {
- m_ruby_system->m_cache_recorder->enqueueNextFetchRequest();
- } else if (RubySystem::getCooldownEnabled()) {
- m_ruby_system->m_cache_recorder->enqueueNextFlushRequest();
+ if (getWarmupEnabled()) {
+ m_cache_recorder->enqueueNextFetchRequest();
+ } else if (getCooldownEnabled()) {
+ m_cache_recorder->enqueueNextFlushRequest();
}
}
class RubySystem : public ClockedObject
{
public:
- class RubyEvent : public Event
- {
- public:
- RubyEvent(RubySystem* _ruby_system)
- {
- m_ruby_system = _ruby_system;
- }
- private:
- void process();
-
- RubySystem* m_ruby_system;
- };
-
- friend class RubyEvent;
-
typedef RubySystemParams Params;
RubySystem(const Params *p);
~RubySystem();
bool eventQueueEmpty() { return eventq->empty(); }
void enqueueRubyEvent(Tick tick)
{
- RubyEvent* e = new RubyEvent(this);
+ auto e = new EventFunctionWrapper(
+ [this]{ processRubyEvent(); }, "RubyEvent");
schedule(e, tick);
}
static void writeCompressedTrace(uint8_t *raw_data, std::string file,
uint64_t uncompressed_trace_size);
+ void processRubyEvent();
private:
// configuration parameters
static bool m_randomization;
}
Sequencer::Sequencer(const Params *p)
- : RubyPort(p), m_IncompleteTimes(MachineType_NUM), deadlockCheckEvent(this)
+ : RubyPort(p), m_IncompleteTimes(MachineType_NUM),
+ deadlockCheckEvent([this]{ wakeup(); }, "Sequencer deadlock check")
{
m_outstanding_count = 0;
std::vector<Stats::Histogram *> m_FirstResponseToCompletionDelayHist;
std::vector<Stats::Counter> m_IncompleteTimes;
-
- class SequencerWakeupEvent : public Event
- {
- private:
- Sequencer *m_sequencer_ptr;
-
- public:
- SequencerWakeupEvent(Sequencer *_seq) : m_sequencer_ptr(_seq) {}
- void process() { m_sequencer_ptr->wakeup(); }
- const char *description() const { return "Sequencer deadlock check"; }
- };
-
- SequencerWakeupEvent deadlockCheckEvent;
+ EventFunctionWrapper deadlockCheckEvent;
};
inline std::ostream&