Go to the documentation of this file.
50 #include "debug/Bridge.hh"
51 #include "params/Bridge.hh"
56 Cycles _delay,
int _resp_limit,
59 memSidePort(_memSidePort), delay(_delay),
60 ranges(_ranges.begin(), _ranges.end()),
61 outstandingResponses(0), retryReq(false), respQueueLimit(_resp_limit),
69 Cycles _delay,
int _req_limit)
72 delay(_delay), reqQueueLimit(_req_limit),
89 if (if_name ==
"mem_side_port")
91 else if (if_name ==
"cpu_side_port")
103 fatal(
"Both ports of a bridge must be connected.\n");
118 return transmitList.size() == reqQueueLimit;
129 DPRINTF(
Bridge,
"Request queue size: %d\n", transmitList.size());
159 transmitList.size(), outstandingResponses);
168 if (expects_response) {
169 if (respQueueFull()) {
175 assert(outstandingResponses != respQueueLimit);
176 ++outstandingResponses;
207 DPRINTF(
Bridge,
"Request waiting for retry, now retrying\n");
220 if (transmitList.empty()) {
224 assert(transmitList.size() != reqQueueLimit);
226 transmitList.emplace_back(pkt, when);
237 if (transmitList.empty()) {
241 transmitList.emplace_back(pkt, when);
247 assert(!transmitList.empty());
255 DPRINTF(
Bridge,
"trySend request addr 0x%x, queue size %d\n",
256 pkt->
getAddr(), transmitList.size());
258 if (sendTimingReq(pkt)) {
260 transmitList.pop_front();
264 if (!transmitList.empty()) {
268 bridge.clockEdge()));
285 assert(!transmitList.empty());
293 DPRINTF(
Bridge,
"trySend response addr 0x%x, outstanding %d\n",
294 pkt->
getAddr(), outstandingResponses);
296 if (sendTimingResp(pkt)) {
298 transmitList.pop_front();
301 assert(outstandingResponses != 0);
302 --outstandingResponses;
305 if (!transmitList.empty()) {
309 bridge.clockEdge()));
316 DPRINTF(
Bridge,
"Request waiting for retry, now retrying\n");
353 for (
auto i = transmitList.begin();
i != transmitList.end(); ++
i) {
375 auto i = transmitList.begin();
377 while (
i != transmitList.end() && !found) {
395 BridgeParams::create()
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
#define fatal(...)
This implements a cprintf based fatal() function.
void recvReqRetry()
When receiving a retry request from the peer port, pass it to the bridge.
A ResponsePort is a specialization of a port.
bool cacheResponding() const
bool respQueueFull() const
Is this side blocked from accepting new response packets.
uint32_t payloadDelay
The extra pipelining delay from seeing the packet until the end of payload is transmitted by the comp...
void schedTimingReq(PacketPtr pkt, Tick when)
Queue a request packet to be sent out later and also schedule a send if necessary.
uint64_t Tick
Tick count type.
BridgeRequestPort(const std::string &_name, Bridge &_bridge, BridgeResponsePort &_cpuSidePort, Cycles _delay, int _req_limit)
Constructor for the BridgeRequestPort.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void pushLabel(const std::string &lbl)
Push label for PrintReq (safe to call unconditionally).
void trySendTiming()
Handle send event, scheduled when the packet at the head of the outbound queue is ready to transmit (...
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
uint32_t headerDelay
The extra delay from seeing the packet until the header is transmitted.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
bool trySatisfyFunctional(PacketPtr pkt)
Check a functional request against the packets in our request queue.
bool recvTimingResp(PacketPtr pkt)
When receiving a timing request from the peer port, pass it to the bridge.
unsigned int respQueueLimit
Max queue size for reserved responses.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
bool reqQueueFull() const
Is this side blocked from accepting new request packets.
Ports are used to interface objects to each other.
bool needsResponse() const
void trySendTiming()
Handle send event, scheduled when the packet at the head of the response queue is ready to transmit (...
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
void makeResponse()
Take a request packet and modify it in place to be suitable for returning as a response to that reque...
BridgeResponsePort cpuSidePort
Response port of the bridge.
AddrRangeList getAddrRanges() const
When receiving a address range request the peer port, pass it to the bridge.
Port on the side that forwards requests and receives responses.
void recvRespRetry()
When receiving a retry request from the peer port, pass it to the bridge.
virtual const std::string name() const
A deferred packet stores a packet along with its scheduled transmission time.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Cycles ticksToCycles(Tick t) const
void recvFunctional(PacketPtr pkt)
When receiving a Functional request from the peer port, pass it to the bridge.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
BridgeRequestPort memSidePort
Request port of the bridge.
void retryStalledReq()
Retry any stalled request that we have failed to accept at an earlier point in time.
bool isConnected() const
Is this port currently connected to a peer?
unsigned int outstandingResponses
Counter to track the outstanding responses.
Cycles is a wrapper class for representing cycle counts, i.e.
A bridge is used to interface two different crossbars (or in general a memory-mapped requestor and re...
The port on the side that receives requests and sends responses.
void schedTimingResp(PacketPtr pkt, Tick when)
Queue a response packet to be sent out later and also schedule a send if necessary.
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time,...
Tick recvAtomic(PacketPtr pkt)
When receiving a Atomic requestfrom the peer port, pass it to the bridge.
void sendRangeChange() const
Called by the owner to send a range change.
bool trySatisfyFunctional(PacketPtr other)
Check a functional request against a memory value stored in another packet (i.e.
bool recvTimingReq(PacketPtr pkt)
When receiving a timing request from the peer port, pass it to the bridge.
void popLabel()
Pop label for PrintReq (safe to call unconditionally).
BridgeResponsePort(const std::string &_name, Bridge &_bridge, BridgeRequestPort &_memSidePort, Cycles _delay, int _resp_limit, std::vector< AddrRange > _ranges)
Constructor for the BridgeResponsePort.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:02:12 for gem5 by doxygen 1.8.17