* Authors: Andreas Hansson
*/
+#include "mem/dramsim2.hh"
+
#include "DRAMSim2/Callback.h"
#include "base/callback.hh"
#include "base/trace.hh"
#include "debug/DRAMSim2.hh"
#include "debug/Drain.hh"
-#include "mem/dramsim2.hh"
#include "sim/system.hh"
DRAMSim2::DRAMSim2(const Params* p) :
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",
access(pkt);
// 50 ns is just an arbitrary value at this point
- return pkt->memInhibitAsserted() ? 0 : 50000;
+ return pkt->cacheResponding() ? 0 : 50000;
}
void
// potentially update the packets in our response queue as well
for (auto i = responseQueue.begin(); i != responseQueue.end(); ++i)
- pkt->checkFunctional(*i);
+ pkt->trySatisfyFunctional(*i);
pkt->popLabel();
}
bool
DRAMSim2::recvTimingReq(PacketPtr pkt)
{
- // sink inhibited packets without further action
- if (pkt->memInhibitAsserted()) {
+ // if a cache is responding, sink the packet without further action
+ if (pkt->cacheResponding()) {
pendingDelete.reset(pkt);
return true;
}
signalDrainDone();
}
-BaseSlavePort&
-DRAMSim2::getSlavePort(const std::string &if_name, PortID idx)
+Port &
+DRAMSim2::getPort(const std::string &if_name, PortID idx)
{
if (if_name != "port") {
- return MemObject::getSlavePort(if_name, idx);
+ return AbstractMemory::getPort(if_name, idx);
} else {
return port;
}