coherent_xbar.hh (12351:17eaa27bef22) coherent_xbar.hh (13808:0a44fbc3a853)
1/*
2 * Copyright (c) 2011-2015, 2017 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

103 CoherentXBarSlavePort(const std::string &_name,
104 CoherentXBar &_xbar, PortID _id)
105 : QueuedSlavePort(_name, &_xbar, queue, _id), xbar(_xbar),
106 queue(_xbar, *this)
107 { }
108
109 protected:
110
1/*
2 * Copyright (c) 2011-2015, 2017 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

103 CoherentXBarSlavePort(const std::string &_name,
104 CoherentXBar &_xbar, PortID _id)
105 : QueuedSlavePort(_name, &_xbar, queue, _id), xbar(_xbar),
106 queue(_xbar, *this)
107 { }
108
109 protected:
110
111 /**
112 * When receiving a timing request, pass it to the crossbar.
113 */
114 virtual bool recvTimingReq(PacketPtr pkt)
115 { return xbar.recvTimingReq(pkt, id); }
111 bool
112 recvTimingReq(PacketPtr pkt) override
113 {
114 return xbar.recvTimingReq(pkt, id);
115 }
116
116
117 /**
118 * When receiving a timing snoop response, pass it to the crossbar.
119 */
120 virtual bool recvTimingSnoopResp(PacketPtr pkt)
121 { return xbar.recvTimingSnoopResp(pkt, id); }
117 bool
118 recvTimingSnoopResp(PacketPtr pkt) override
119 {
120 return xbar.recvTimingSnoopResp(pkt, id);
121 }
122
122
123 /**
124 * When receiving an atomic request, pass it to the crossbar.
125 */
126 virtual Tick recvAtomic(PacketPtr pkt)
127 { return xbar.recvAtomic(pkt, id); }
123 Tick
124 recvAtomic(PacketPtr pkt) override
125 {
126 return xbar.recvAtomic(pkt, id);
127 }
128
128
129 /**
130 * When receiving a functional request, pass it to the crossbar.
131 */
132 virtual void recvFunctional(PacketPtr pkt)
133 { xbar.recvFunctional(pkt, id); }
129 void
130 recvFunctional(PacketPtr pkt) override
131 {
132 xbar.recvFunctional(pkt, id);
133 }
134
134
135 /**
136 * Return the union of all adress ranges seen by this crossbar.
137 */
138 virtual AddrRangeList getAddrRanges() const
139 { return xbar.getAddrRanges(); }
135 AddrRangeList
136 getAddrRanges() const override
137 {
138 return xbar.getAddrRanges();
139 }
140
141 };
142
143 /**
144 * Declaration of the coherent crossbar master port type, one will be
145 * instantiated for each of the slave interfaces connecting to the
146 * crossbar.
147 */

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

161 protected:
162
163 /**
164 * Determine if this port should be considered a snooper. For
165 * a coherent crossbar master port this is always true.
166 *
167 * @return a boolean that is true if this port is snooping
168 */
140
141 };
142
143 /**
144 * Declaration of the coherent crossbar master port type, one will be
145 * instantiated for each of the slave interfaces connecting to the
146 * crossbar.
147 */

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

161 protected:
162
163 /**
164 * Determine if this port should be considered a snooper. For
165 * a coherent crossbar master port this is always true.
166 *
167 * @return a boolean that is true if this port is snooping
168 */
169 virtual bool isSnooping() const
170 { return true; }
169 bool isSnooping() const override { return true; }
171
170
172 /**
173 * When receiving a timing response, pass it to the crossbar.
174 */
175 virtual bool recvTimingResp(PacketPtr pkt)
176 { return xbar.recvTimingResp(pkt, id); }
171 bool
172 recvTimingResp(PacketPtr pkt) override
173 {
174 return xbar.recvTimingResp(pkt, id);
175 }
177
176
178 /**
179 * When receiving a timing snoop request, pass it to the crossbar.
180 */
181 virtual void recvTimingSnoopReq(PacketPtr pkt)
182 { return xbar.recvTimingSnoopReq(pkt, id); }
177 void
178 recvTimingSnoopReq(PacketPtr pkt) override
179 {
180 return xbar.recvTimingSnoopReq(pkt, id);
181 }
183
182
184 /**
185 * When receiving an atomic snoop request, pass it to the crossbar.
186 */
187 virtual Tick recvAtomicSnoop(PacketPtr pkt)
188 { return xbar.recvAtomicSnoop(pkt, id); }
183 Tick
184 recvAtomicSnoop(PacketPtr pkt) override
185 {
186 return xbar.recvAtomicSnoop(pkt, id);
187 }
189
188
190 /**
191 * When receiving a functional snoop request, pass it to the crossbar.
192 */
193 virtual void recvFunctionalSnoop(PacketPtr pkt)
194 { xbar.recvFunctionalSnoop(pkt, id); }
189 void
190 recvFunctionalSnoop(PacketPtr pkt) override
191 {
192 xbar.recvFunctionalSnoop(pkt, id);
193 }
195
194
196 /** When reciving a range change from the peer port (at id),
197 pass it to the crossbar. */
198 virtual void recvRangeChange()
199 { xbar.recvRangeChange(id); }
195 void recvRangeChange() override { xbar.recvRangeChange(id); }
196 void recvReqRetry() override { xbar.recvReqRetry(id); }
200
197
201 /** When reciving a retry from the peer port (at id),
202 pass it to the crossbar. */
203 virtual void recvReqRetry()
204 { xbar.recvReqRetry(id); }
205
206 };
207
208 /**
209 * Internal class to bridge between an incoming snoop response
210 * from a slave port and forwarding it through an outgoing slave
211 * port. It is effectively a dangling master port.
212 */
213 class SnoopRespPort : public MasterPort

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

226 SnoopRespPort(QueuedSlavePort& slave_port, CoherentXBar& _xbar) :
227 MasterPort(slave_port.name() + ".snoopRespPort", &_xbar),
228 slavePort(slave_port) { }
229
230 /**
231 * Override the sending of retries and pass them on through
232 * the mirrored slave port.
233 */
198 };
199
200 /**
201 * Internal class to bridge between an incoming snoop response
202 * from a slave port and forwarding it through an outgoing slave
203 * port. It is effectively a dangling master port.
204 */
205 class SnoopRespPort : public MasterPort

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

218 SnoopRespPort(QueuedSlavePort& slave_port, CoherentXBar& _xbar) :
219 MasterPort(slave_port.name() + ".snoopRespPort", &_xbar),
220 slavePort(slave_port) { }
221
222 /**
223 * Override the sending of retries and pass them on through
224 * the mirrored slave port.
225 */
234 void sendRetryResp() {
226 void
227 sendRetryResp() override
228 {
235 // forward it as a snoop response retry
236 slavePort.sendRetrySnoopResp();
237 }
238
229 // forward it as a snoop response retry
230 slavePort.sendRetrySnoopResp();
231 }
232
239 /**
240 * Provided as necessary.
241 */
242 void recvReqRetry() { panic("SnoopRespPort should never see retry\n"); }
233 void
234 recvReqRetry() override
235 {
236 panic("SnoopRespPort should never see retry");
237 }
243
238
244 /**
245 * Provided as necessary.
246 */
247 bool recvTimingResp(PacketPtr pkt)
239 bool
240 recvTimingResp(PacketPtr pkt) override
248 {
241 {
249 panic("SnoopRespPort should never see timing response\n");
250 return false;
242 panic("SnoopRespPort should never see timing response");
251 }
252
253 };
254
255 std::vector<SnoopRespPort*> snoopRespPorts;
256
257 std::vector<QueuedSlavePort*> snoopPorts;
258

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

275 * properties.
276 */
277 System *system;
278
279 /** A snoop filter that tracks cache line residency and can restrict the
280 * broadcast needed for probes. NULL denotes an absent filter. */
281 SnoopFilter *snoopFilter;
282
243 }
244
245 };
246
247 std::vector<SnoopRespPort*> snoopRespPorts;
248
249 std::vector<QueuedSlavePort*> snoopPorts;
250

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

267 * properties.
268 */
269 System *system;
270
271 /** A snoop filter that tracks cache line residency and can restrict the
272 * broadcast needed for probes. NULL denotes an absent filter. */
273 SnoopFilter *snoopFilter;
274
283 /** Cycles of snoop response latency.*/
284 const Cycles snoopResponseLatency;
275 const Cycles snoopResponseLatency;
285
286 /** Is this crossbar the point of coherency? **/
287 const bool pointOfCoherency;
276 const bool pointOfCoherency;
288
289 /** Is this crossbar the point of unification? **/
290 const bool pointOfUnification;
291
292 /**
293 * Upstream caches need this packet until true is returned, so
294 * hold it for deletion until a subsequent call
295 */
296 std::unique_ptr<Packet> pendingDelete;
297
277 const bool pointOfUnification;
278
279 /**
280 * Upstream caches need this packet until true is returned, so
281 * hold it for deletion until a subsequent call
282 */
283 std::unique_ptr<Packet> pendingDelete;
284
298 /** Function called by the port when the crossbar is recieving a Timing
299 request packet.*/
300 bool recvTimingReq(PacketPtr pkt, PortID slave_port_id);
285 bool recvTimingReq(PacketPtr pkt, PortID slave_port_id);
301
302 /** Function called by the port when the crossbar is recieving a Timing
303 response packet.*/
304 bool recvTimingResp(PacketPtr pkt, PortID master_port_id);
286 bool recvTimingResp(PacketPtr pkt, PortID master_port_id);
305
306 /** Function called by the port when the crossbar is recieving a timing
307 snoop request.*/
308 void recvTimingSnoopReq(PacketPtr pkt, PortID master_port_id);
287 void recvTimingSnoopReq(PacketPtr pkt, PortID master_port_id);
309
310 /** Function called by the port when the crossbar is recieving a timing
311 snoop response.*/
312 bool recvTimingSnoopResp(PacketPtr pkt, PortID slave_port_id);
288 bool recvTimingSnoopResp(PacketPtr pkt, PortID slave_port_id);
313
314 /** Timing function called by port when it is once again able to process
315 * requests. */
316 void recvReqRetry(PortID master_port_id);
317
318 /**
319 * Forward a timing packet to our snoopers, potentially excluding
320 * one of the connected coherent masters to avoid sending a packet
321 * back to where it came from.
322 *
323 * @param pkt Packet to forward
324 * @param exclude_slave_port_id Id of slave port to exclude
325 */
289 void recvReqRetry(PortID master_port_id);
290
291 /**
292 * Forward a timing packet to our snoopers, potentially excluding
293 * one of the connected coherent masters to avoid sending a packet
294 * back to where it came from.
295 *
296 * @param pkt Packet to forward
297 * @param exclude_slave_port_id Id of slave port to exclude
298 */
326 void forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id) {
299 void
300 forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id)
301 {
327 forwardTiming(pkt, exclude_slave_port_id, snoopPorts);
328 }
329
330 /**
331 * Forward a timing packet to a selected list of snoopers, potentially
332 * excluding one of the connected coherent masters to avoid sending a packet
333 * back to where it came from.
334 *
335 * @param pkt Packet to forward
336 * @param exclude_slave_port_id Id of slave port to exclude
337 * @param dests Vector of destination ports for the forwarded pkt
338 */
339 void forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id,
340 const std::vector<QueuedSlavePort*>& dests);
341
302 forwardTiming(pkt, exclude_slave_port_id, snoopPorts);
303 }
304
305 /**
306 * Forward a timing packet to a selected list of snoopers, potentially
307 * excluding one of the connected coherent masters to avoid sending a packet
308 * back to where it came from.
309 *
310 * @param pkt Packet to forward
311 * @param exclude_slave_port_id Id of slave port to exclude
312 * @param dests Vector of destination ports for the forwarded pkt
313 */
314 void forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id,
315 const std::vector<QueuedSlavePort*>& dests);
316
342 /** Function called by the port when the crossbar is recieving a Atomic
343 transaction.*/
344 Tick recvAtomic(PacketPtr pkt, PortID slave_port_id);
317 Tick recvAtomic(PacketPtr pkt, PortID slave_port_id);
345
346 /** Function called by the port when the crossbar is recieving an
347 atomic snoop transaction.*/
348 Tick recvAtomicSnoop(PacketPtr pkt, PortID master_port_id);
349
350 /**
351 * Forward an atomic packet to our snoopers, potentially excluding
352 * one of the connected coherent masters to avoid sending a packet
353 * back to where it came from.
354 *
355 * @param pkt Packet to forward
356 * @param exclude_slave_port_id Id of slave port to exclude
357 *
358 * @return a pair containing the snoop response and snoop latency
359 */
318 Tick recvAtomicSnoop(PacketPtr pkt, PortID master_port_id);
319
320 /**
321 * Forward an atomic packet to our snoopers, potentially excluding
322 * one of the connected coherent masters to avoid sending a packet
323 * back to where it came from.
324 *
325 * @param pkt Packet to forward
326 * @param exclude_slave_port_id Id of slave port to exclude
327 *
328 * @return a pair containing the snoop response and snoop latency
329 */
360 std::pair<MemCmd, Tick> forwardAtomic(PacketPtr pkt,
361 PortID exclude_slave_port_id)
330 std::pair
331 forwardAtomic(PacketPtr pkt, PortID exclude_slave_port_id)
362 {
363 return forwardAtomic(pkt, exclude_slave_port_id, InvalidPortID,
364 snoopPorts);
365 }
366
367 /**
368 * Forward an atomic packet to a selected list of snoopers, potentially
369 * excluding one of the connected coherent masters to avoid sending a packet

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

418 * The memory below is the destination for a cache mainteance
419 * operation to the Point of Coherence/Unification if this is the
420 * Point of Coherence/Unification.
421 *
422 * @param pkt The processed packet
423 *
424 * @return Whether the memory below is the destination for the packet
425 */
332 {
333 return forwardAtomic(pkt, exclude_slave_port_id, InvalidPortID,
334 snoopPorts);
335 }
336
337 /**
338 * Forward an atomic packet to a selected list of snoopers, potentially
339 * excluding one of the connected coherent masters to avoid sending a packet

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

388 * The memory below is the destination for a cache mainteance
389 * operation to the Point of Coherence/Unification if this is the
390 * Point of Coherence/Unification.
391 *
392 * @param pkt The processed packet
393 *
394 * @return Whether the memory below is the destination for the packet
395 */
426 bool isDestination(const PacketPtr pkt) const
396 bool
397 isDestination(const PacketPtr pkt) const
427 {
428 return (pkt->req->isToPOC() && pointOfCoherency) ||
429 (pkt->req->isToPOU() && pointOfUnification);
430 }
431
432 Stats::Scalar snoops;
433 Stats::Scalar snoopTraffic;
434 Stats::Distribution snoopFanout;

--- 13 unchanged lines hidden ---
398 {
399 return (pkt->req->isToPOC() && pointOfCoherency) ||
400 (pkt->req->isToPOU() && pointOfUnification);
401 }
402
403 Stats::Scalar snoops;
404 Stats::Scalar snoopTraffic;
405 Stats::Distribution snoopFanout;

--- 13 unchanged lines hidden ---