std::vector<AddrRange> _ranges)
: SlavePort(_name, &_bridge), bridge(_bridge), masterPort(_masterPort),
delay(_delay), ranges(_ranges.begin(), _ranges.end()),
- outstandingResponses(0), retryReq(false),
- respQueueLimit(_resp_limit), sendEvent(*this)
+ outstandingResponses(0), retryReq(false), respQueueLimit(_resp_limit),
+ sendEvent([this]{ trySendTiming(); }, _name)
{
}
BridgeSlavePort& _slavePort,
Cycles _delay, int _req_limit)
: MasterPort(_name, &_bridge), bridge(_bridge), slavePort(_slavePort),
- delay(_delay), reqQueueLimit(_req_limit), sendEvent(*this)
+ delay(_delay), reqQueueLimit(_req_limit),
+ sendEvent([this]{ trySendTiming(); }, _name)
{
}
void trySendTiming();
/** Send event for the response queue. */
- EventWrapper<BridgeSlavePort,
- &BridgeSlavePort::trySendTiming> sendEvent;
+ EventFunctionWrapper sendEvent;
public:
void trySendTiming();
/** Send event for the request queue. */
- EventWrapper<BridgeMasterPort,
- &BridgeMasterPort::trySendTiming> sendEvent;
+ EventFunctionWrapper sendEvent;
public:
BaseCache *_cache,
const std::string &_label)
: QueuedSlavePort(_name, _cache, queue), queue(*_cache, *this, _label),
- blocked(false), mustSendRetry(false), sendRetryEvent(this)
+ blocked(false), mustSendRetry(false),
+ sendRetryEvent([this]{ processSendRetry(); }, _name)
{
}
void processSendRetry();
- EventWrapper<CacheSlavePort,
- &CacheSlavePort::processSendRetry> sendRetryEvent;
+ EventFunctionWrapper sendRetryEvent;
};
clusivity(p->clusivity),
writebackClean(p->writeback_clean),
tempBlockWriteback(nullptr),
- writebackTempBlockAtomicEvent(this, false,
+ writebackTempBlockAtomicEvent([this]{ writebackTempBlockAtomic(); },
+ name(), false,
EventBase::Delayed_Writeback_Pri)
{
tempBlock = new CacheBlk();
* finishes. To avoid other calls to recvAtomic getting in
* between, we create this event with a higher priority.
*/
- EventWrapper<Cache, &Cache::writebackTempBlockAtomic> \
- writebackTempBlockAtomicEvent;
+ EventFunctionWrapper writebackTempBlockAtomicEvent;
/**
* Store the outstanding requests that we are expecting snoop
: MemObject(params),
masterPort(name() + "-master", *this),
slavePort(name() + "-slave", *this),
- samplePeriodicEvent(this),
+ samplePeriodicEvent([this]{ samplePeriodic(); }, name()),
samplePeriodTicks(params->sample_period),
samplePeriod(params->sample_period / SimClock::Float::s),
stats(params)
void samplePeriodic();
/** Periodic event called at the end of each simulation time bin */
- EventWrapper<CommMonitor, &CommMonitor::samplePeriodic> samplePeriodicEvent;
+ EventFunctionWrapper samplePeriodicEvent;
/**
*@{
retryRdReq(false), retryWrReq(false),
busState(READ),
busStateNext(READ),
- nextReqEvent(this), respondEvent(this),
+ nextReqEvent([this]{ processNextReqEvent(); }, name()),
+ respondEvent([this]{ processRespondEvent(); }, name()),
deviceSize(p->device_size),
deviceBusWidth(p->device_bus_width), burstLength(p->burst_length),
deviceRowBufferSize(p->device_rowbuffer_size),
readEntries(0), writeEntries(0), outstandingEvents(0),
wakeUpAllowedAt(0), power(_p, false), banks(_p->banks_per_rank),
numBanksActive(0), actTicks(_p->activation_limit, 0),
- writeDoneEvent(*this), activateEvent(*this), prechargeEvent(*this),
- refreshEvent(*this), powerEvent(*this), wakeUpEvent(*this)
+ writeDoneEvent([this]{ processWriteDoneEvent(); }, name()),
+ activateEvent([this]{ processActivateEvent(); }, name()),
+ prechargeEvent([this]{ processPrechargeEvent(); }, name()),
+ refreshEvent([this]{ processRefreshEvent(); }, name()),
+ powerEvent([this]{ processPowerEvent(); }, name()),
+ wakeUpEvent([this]{ processWakeUpEvent(); }, name())
{
for (int b = 0; b < _p->banks_per_rank; b++) {
banks[b].bank = b;
void scheduleWakeUpEvent(Tick exit_delay);
void processWriteDoneEvent();
- EventWrapper<Rank, &Rank::processWriteDoneEvent>
- writeDoneEvent;
+ EventFunctionWrapper writeDoneEvent;
void processActivateEvent();
- EventWrapper<Rank, &Rank::processActivateEvent>
- activateEvent;
+ EventFunctionWrapper activateEvent;
void processPrechargeEvent();
- EventWrapper<Rank, &Rank::processPrechargeEvent>
- prechargeEvent;
+ EventFunctionWrapper prechargeEvent;
void processRefreshEvent();
- EventWrapper<Rank, &Rank::processRefreshEvent>
- refreshEvent;
+ EventFunctionWrapper refreshEvent;
void processPowerEvent();
- EventWrapper<Rank, &Rank::processPowerEvent>
- powerEvent;
+ EventFunctionWrapper powerEvent;
void processWakeUpEvent();
- EventWrapper<Rank, &Rank::processWakeUpEvent>
- wakeUpEvent;
+ EventFunctionWrapper wakeUpEvent;
};
* in these methods
*/
void processNextReqEvent();
- EventWrapper<DRAMCtrl,&DRAMCtrl::processNextReqEvent> nextReqEvent;
+ EventFunctionWrapper nextReqEvent;
void processRespondEvent();
- EventWrapper<DRAMCtrl, &DRAMCtrl::processRespondEvent> respondEvent;
+ EventFunctionWrapper respondEvent;
/**
* Check if the read queue has room for more entries
p->traceFile, p->range.size() / 1024 / 1024, p->enableDebug),
retryReq(false), retryResp(false), startTick(0),
nbrOutstandingReads(0), nbrOutstandingWrites(0),
- sendResponseEvent(this), tickEvent(this)
+ sendResponseEvent([this]{ sendResponse(); }, name()),
+ tickEvent([this]{ tick(); }, name())
{
DPRINTF(DRAMSim2,
"Instantiated DRAMSim2 with clock %d ns and queue size %d\n",
/**
* Event to schedule sending of responses
*/
- EventWrapper<DRAMSim2, &DRAMSim2::sendResponse> sendResponseEvent;
+ EventFunctionWrapper sendResponseEvent;
/**
* Progress the controller one clock cycle.
/**
* Event to schedule clock ticks
*/
- EventWrapper<DRAMSim2, &DRAMSim2::tick> tickEvent;
+ EventFunctionWrapper tickEvent;
/**
* Upstream caches need this packet until true is returned, so
masterPort(_masterPort), delay(_delay),
ranges(_ranges.begin(), _ranges.end()),
outstandingResponses(0), retryReq(false),
- respQueueLimit(_resp_limit), sendEvent(*this)
+ respQueueLimit(_resp_limit),
+ sendEvent([this]{ trySendTiming(); }, _name)
{
}
Cycles _delay, int _req_limit)
: MasterPort(_name, &_serial_link), serial_link(_serial_link),
slavePort(_slavePort), delay(_delay), reqQueueLimit(_req_limit),
- sendEvent(*this)
+ sendEvent([this]{ trySendTiming(); }, _name)
{
}
void trySendTiming();
/** Send event for the response queue. */
- EventWrapper<SerialLinkSlavePort,
- &SerialLinkSlavePort::trySendTiming> sendEvent;
+ EventFunctionWrapper sendEvent;
public:
void trySendTiming();
/** Send event for the request queue. */
- EventWrapper<SerialLinkMasterPort,
- &SerialLinkMasterPort::trySendTiming> sendEvent;
+ EventFunctionWrapper sendEvent;
public:
port(name() + ".port", *this), latency(p->latency),
latency_var(p->latency_var), bandwidth(p->bandwidth), isBusy(false),
retryReq(false), retryResp(false),
- releaseEvent(this), dequeueEvent(this)
+ releaseEvent([this]{ release(); }, name()),
+ dequeueEvent([this]{ dequeue(); }, name())
{
}
*/
void release();
- EventWrapper<SimpleMemory, &SimpleMemory::release> releaseEvent;
+ EventFunctionWrapper releaseEvent;
/**
* Dequeue a packet from our internal packet queue and move it to
*/
void dequeue();
- EventWrapper<SimpleMemory, &SimpleMemory::dequeue> dequeueEvent;
+ EventFunctionWrapper dequeueEvent;
/**
* Detemine the latency.
BaseXBar::Layer<SrcType,DstType>::Layer(DstType& _port, BaseXBar& _xbar,
const std::string& _name) :
port(_port), xbar(_xbar), _name(_name), state(IDLE),
- waitingForPeer(NULL), releaseEvent(this)
+ waitingForPeer(NULL), releaseEvent([this]{ releaseLayer(); }, name())
{
}
void releaseLayer();
/** event used to schedule a release of the layer */
- EventWrapper<Layer, &Layer::releaseLayer> releaseEvent;
+ EventFunctionWrapper releaseEvent;
/**
* Stats for occupancy and utilization. These stats capture