55,56d54
< #include <queue>
< #include <string>
60,61d57
< #include "mem/packet.hh"
< #include "mem/port.hh"
63d58
< #include "sim/eventq.hh"
74,76c69,71
< * before forwarding the request. An incoming request is always
< * accepted (recvTiming returns true), but is potentially NACKed if
< * there is no request space or response space.
---
> * before forwarding the request. If there is no space present, then
> * the bridge will delay accepting the packet until space becomes
> * available.
109,111c104,105
< * A deferred request stores a packet along with its scheduled
< * transmission time, and whether we can expect to see a response
< * or not.
---
> * A deferred packet stores a packet along with its scheduled
> * transmission time
113c107
< class DeferredRequest
---
> class DeferredPacket
118c112
< Tick ready;
---
> Tick tick;
120d113
< bool expectResponse;
122,123c115
< DeferredRequest(PacketPtr _pkt, Tick t)
< : ready(t), pkt(_pkt), expectResponse(_pkt->needsResponse())
---
> DeferredPacket(PacketPtr _pkt, Tick _tick) : tick(_tick), pkt(_pkt)
127,145d118
< /**
< * A deferred response stores a packet along with its scheduled
< * transmission time. It also contains information of whether the
< * bridge NACKed the packet to be able to correctly maintain
< * counters of outstanding responses.
< */
< class DeferredResponse {
<
< public:
<
< Tick ready;
< PacketPtr pkt;
< bool nackedHere;
<
< DeferredResponse(PacketPtr _pkt, Tick t, bool nack = false)
< : ready(t), pkt(_pkt), nackedHere(nack)
< { }
< };
<
160,161c133,134
< /** A pointer to the bridge to which this port belongs. */
< Bridge *bridge;
---
> /** The bridge to which this port belongs. */
> Bridge& bridge;
164,165c137,138
< * Master port on the other side of the bridge
< * (connected to the other bus).
---
> * Master port on the other side of the bridge (connected to
> * the other bus).
172,174d144
< /** Min delay to respond with a nack. */
< Tick nackDelay;
<
183c153
< std::list<DeferredResponse> responseQueue;
---
> std::list<DeferredPacket> transmitList;
188,189c158,159
< /** If we're waiting for a retry to happen. */
< bool inRetry;
---
> /** If we should send a retry when space becomes available. */
> bool retryReq;
202,209d171
< * Turn the request packet into a NACK response and put it in
< * the response queue and schedule its transmission.
< *
< * @param pkt the request packet to NACK
< */
< void nackRequest(PacketPtr pkt);
<
< /**
214c176
< void trySend();
---
> void trySendTiming();
217c179,180
< EventWrapper<BridgeSlavePort, &BridgeSlavePort::trySend> sendEvent;
---
> EventWrapper<BridgeSlavePort,
> &BridgeSlavePort::trySendTiming> sendEvent;
228d190
< * @param _nack_delay the delay from a NACK to sending the response
232c194
< BridgeSlavePort(const std::string &_name, Bridge *_bridge,
---
> BridgeSlavePort(const std::string& _name, Bridge& _bridge,
234,235c196
< int _nack_delay, int _resp_limit,
< std::vector<Range<Addr> > _ranges);
---
> int _resp_limit, std::vector<Range<Addr> > _ranges);
241a203
> * @param when tick when response packet should be sent
243c205
< void queueForSendTiming(PacketPtr pkt);
---
> void schedTimingResp(PacketPtr pkt, Tick when);
244a207,213
> /**
> * Retry any stalled request that we have failed to accept at
> * an earlier point in time. This call will do nothing if no
> * request is waiting.
> */
> void retryStalledReq();
>
249c218
< virtual bool recvTimingReq(PacketPtr pkt);
---
> bool recvTimingReq(PacketPtr pkt);
253c222
< virtual void recvRetry();
---
> void recvRetry();
257c226
< virtual Tick recvAtomic(PacketPtr pkt);
---
> Tick recvAtomic(PacketPtr pkt);
261c230
< virtual void recvFunctional(PacketPtr pkt);
---
> void recvFunctional(PacketPtr pkt);
265c234
< virtual AddrRangeList getAddrRanges() const;
---
> AddrRangeList getAddrRanges() const;
279,280c248,249
< /** A pointer to the bridge to which this port belongs. */
< Bridge* bridge;
---
> /** The bridge to which this port belongs. */
> Bridge& bridge;
283,284c252,253
< * Pointer to the slave port on the other side of the bridge
< * (connected to the other bus).
---
> * The slave port on the other side of the bridge (connected
> * to the other bus).
296c265
< std::list<DeferredRequest> requestQueue;
---
> std::list<DeferredPacket> transmitList;
298,300d266
< /** If we're waiting for a retry to happen. */
< bool inRetry;
<
309c275
< void trySend();
---
> void trySendTiming();
312c278,279
< EventWrapper<BridgeMasterPort, &BridgeMasterPort::trySend> sendEvent;
---
> EventWrapper<BridgeMasterPort,
> &BridgeMasterPort::trySendTiming> sendEvent;
325c292
< BridgeMasterPort(const std::string &_name, Bridge *_bridge,
---
> BridgeMasterPort(const std::string& _name, Bridge& _bridge,
340a308
> * @param when tick when response packet should be sent
342c310
< void queueForSendTiming(PacketPtr pkt);
---
> void schedTimingReq(PacketPtr pkt, Tick when);
358c326
< virtual bool recvTimingResp(PacketPtr pkt);
---
> bool recvTimingResp(PacketPtr pkt);
362c330
< virtual void recvRetry();
---
> void recvRetry();
371,373d338
< /** If this bridge should acknowledge writes. */
< bool ackWrites;
<
375d339
< typedef BridgeParams Params;
377,382d340
< protected:
< Params *_params;
<
< public:
< const Params *params() const { return _params; }
<
388a347,348
> typedef BridgeParams Params;
>