bridge.hh (4432:5e55857abb01) bridge.hh (4433:4722c6787f69)
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 65 unchanged lines hidden (view full) ---

74 Tick ready;
75 PacketPtr pkt;
76 Packet::SenderState *origSenderState;
77 short origSrc;
78 bool expectResponse;
79
80 bool partialWriteFixed;
81 PacketPtr oldPkt;
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 65 unchanged lines hidden (view full) ---

74 Tick ready;
75 PacketPtr pkt;
76 Packet::SenderState *origSenderState;
77 short origSrc;
78 bool expectResponse;
79
80 bool partialWriteFixed;
81 PacketPtr oldPkt;
82 bool nacked;
82
83
83 PacketBuffer(PacketPtr _pkt, Tick t)
84 PacketBuffer(PacketPtr _pkt, Tick t, bool nack = false)
84 : ready(t), pkt(_pkt),
85 origSenderState(_pkt->senderState), origSrc(_pkt->getSrc()),
85 : ready(t), pkt(_pkt),
86 origSenderState(_pkt->senderState), origSrc(_pkt->getSrc()),
86 expectResponse(_pkt->needsResponse()), partialWriteFixed(false)
87 expectResponse(_pkt->needsResponse() && !nack),
88 partialWriteFixed(false), nacked(nack)
89
87 {
90 {
88 if (!pkt->isResponse())
91 if (!pkt->isResponse() && !nack)
89 pkt->senderState = this;
90 }
91
92 void fixResponse(PacketPtr pkt)
93 {
94 assert(pkt->senderState == this);
95 pkt->setDest(origSrc);
96 pkt->senderState = origSenderState;

--- 42 unchanged lines hidden (view full) ---

139 /**
140 * Outbound packet queue. Packets are held in this queue for a
141 * specified delay to model the processing delay of the
142 * bridge.
143 */
144 std::list<PacketBuffer*> sendQueue;
145
146 int outstandingResponses;
92 pkt->senderState = this;
93 }
94
95 void fixResponse(PacketPtr pkt)
96 {
97 assert(pkt->senderState == this);
98 pkt->setDest(origSrc);
99 pkt->senderState = origSenderState;

--- 42 unchanged lines hidden (view full) ---

142 /**
143 * Outbound packet queue. Packets are held in this queue for a
144 * specified delay to model the processing delay of the
145 * bridge.
146 */
147 std::list<PacketBuffer*> sendQueue;
148
149 int outstandingResponses;
150 int queuedRequests;
147
148 /** Max queue size for outbound packets */
149 int queueLimit;
150
151 /**
152 * Is this side blocked from accepting outbound packets?
153 */
151
152 /** Max queue size for outbound packets */
153 int queueLimit;
154
155 /**
156 * Is this side blocked from accepting outbound packets?
157 */
154 bool queueFull() { return (sendQueue.size() == queueLimit); }
158 bool queueFull();
155
159
156 bool queueForSendTiming(PacketPtr pkt);
160 void queueForSendTiming(PacketPtr pkt);
157
158 void finishSend(PacketBuffer *buf);
159
161
162 void finishSend(PacketBuffer *buf);
163
164 void nackRequest(PacketPtr pkt);
165
160 /**
161 * Handle send event, scheduled when the packet at the head of
162 * the outbound queue is ready to transmit (for timing
163 * accesses only).
164 */
165 void trySend();
166
167 class SendEvent : public Event

--- 66 unchanged lines hidden ---
166 /**
167 * Handle send event, scheduled when the packet at the head of
168 * the outbound queue is ready to transmit (for timing
169 * accesses only).
170 */
171 void trySend();
172
173 class SendEvent : public Event

--- 66 unchanged lines hidden ---