Go to the documentation of this file.
40 #include "params/MemDelay.hh"
41 #include "params/SimpleMemDelay.hh"
45 requestPort(
name() +
"-mem_side_port", *this),
46 responsePort(
name() +
"-cpu_side_port", *this),
47 reqQueue(*this, requestPort),
48 respQueue(*this, responsePort),
49 snoopRespQueue(*this, requestPort)
57 fatal(
"Memory delay is not connected on both sides.\n");
64 if (if_name ==
"mem_side_port") {
66 }
else if (if_name ==
"cpu_side_port") {
82 _parent.reqQueue, _parent.snoopRespQueue),
95 const Tick when =
curTick() + parent.delayResp(pkt) + receive_delay;
97 parent.responsePort.schedTimingResp(pkt, when);
105 if (parent.trySatisfyFunctional(pkt)) {
108 parent.responsePort.sendFunctionalSnoop(pkt);
115 const Tick delay = parent.delaySnoopResp(pkt);
117 return delay + parent.responsePort.sendAtomicSnoop(pkt);
123 parent.responsePort.sendTimingSnoopReq(pkt);
137 const Tick delay = parent.delayReq(pkt) + parent.delayResp(pkt);
139 return delay + parent.requestPort.sendAtomic(pkt);
151 const Tick when =
curTick() + parent.delayReq(pkt) + receive_delay;
153 parent.requestPort.schedTimingReq(pkt, when);
161 if (parent.trySatisfyFunctional(pkt)) {
164 parent.requestPort.sendFunctional(pkt);
171 const Tick when =
curTick() + parent.delaySnoopResp(pkt);
173 parent.requestPort.schedTimingSnoopResp(pkt, when);
182 readReqDelay(
p->read_req),
183 readRespDelay(
p->read_resp),
184 writeReqDelay(
p->write_req),
185 writeRespDelay(
p->write_resp)
215 SimpleMemDelayParams::create()
const Tick writeRespDelay
#define fatal(...)
This implements a cprintf based fatal() function.
RequestPort(const std::string &_name, MemDelay &_parent)
Delay packets by a constant time.
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
Tick recvAtomic(PacketPtr pkt) override
Receive an atomic request packet from the peer.
uint64_t Tick
Tick count type.
RespPacketQueue respQueue
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
bool recvTimingSnoopResp(PacketPtr pkt) override
Receive a timing snoop response from the peer.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void recvFunctional(PacketPtr pkt) override
Receive a functional request packet from the peer.
bool recvTimingReq(PacketPtr pkt) override
Receive a timing request from the peer.
MemDelay(const MemDelayParams *params)
SimpleMemDelay(const SimpleMemDelayParams *params)
The QueuedRequestPort combines two queues, a request queue and a snoop response queue,...
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Ports are used to interface objects to each other.
A queued port is a port that has an infinite queue for outgoing packets and thus decouples the module...
Tick delayResp(PacketPtr pkt) override
Delay a response by some number of ticks.
void recvFunctionalSnoop(PacketPtr pkt) override
Receive a functional snoop request packet from the peer.
This abstract component provides a mechanism to delay packets.
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
const std::string & name()
Tick recvAtomicSnoop(PacketPtr pkt) override
Receive an atomic snoop request packet from our peer.
bool trySatisfyFunctional(PacketPtr pkt)
Check the list of buffered packets against the supplied functional request.
void recvTimingSnoopReq(PacketPtr pkt) override
Receive a timing snoop request from the peer.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
bool trySatisfyFunctional(PacketPtr pkt)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
bool isConnected() const
Is this port currently connected to a peer?
bool trySatisfyFunctional(PacketPtr pkt)
Check the list of buffered packets against the supplied functional request.
ResponsePort responsePort
ResponsePort(const std::string &_name, MemDelay &_parent)
Tick delayReq(PacketPtr pkt) override
Delay a request by some number of ticks.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17