coherent_xbar.hh (10883:9294c4a60251) coherent_xbar.hh (10888:85a001f2193b)
1/*
2 * Copyright (c) 2011-2015 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

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

79 std::vector<RespLayer*> respLayers;
80 std::vector<SnoopRespLayer*> snoopLayers;
81
82 /**
83 * Declaration of the coherent crossbar slave port type, one will
84 * be instantiated for each of the master ports connecting to the
85 * crossbar.
86 */
1/*
2 * Copyright (c) 2011-2015 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

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

79 std::vector<RespLayer*> respLayers;
80 std::vector<SnoopRespLayer*> snoopLayers;
81
82 /**
83 * Declaration of the coherent crossbar slave port type, one will
84 * be instantiated for each of the master ports connecting to the
85 * crossbar.
86 */
87 class CoherentXBarSlavePort : public SlavePort
87 class CoherentXBarSlavePort : public QueuedSlavePort
88 {
89
90 private:
91
92 /** A reference to the crossbar to which this port belongs. */
93 CoherentXBar &xbar;
94
88 {
89
90 private:
91
92 /** A reference to the crossbar to which this port belongs. */
93 CoherentXBar &xbar;
94
95 /** A normal packet queue used to store responses. */
96 RespPacketQueue queue;
97
95 public:
96
97 CoherentXBarSlavePort(const std::string &_name,
98 CoherentXBar &_xbar, PortID _id)
98 public:
99
100 CoherentXBarSlavePort(const std::string &_name,
101 CoherentXBar &_xbar, PortID _id)
99 : SlavePort(_name, &_xbar, _id), xbar(_xbar)
102 : QueuedSlavePort(_name, &_xbar, queue, _id), xbar(_xbar),
103 queue(_xbar, *this)
100 { }
101
102 protected:
103
104 /**
105 * When receiving a timing request, pass it to the crossbar.
106 */
107 virtual bool recvTimingReq(PacketPtr pkt)

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

121
122 /**
123 * When receiving a functional request, pass it to the crossbar.
124 */
125 virtual void recvFunctional(PacketPtr pkt)
126 { xbar.recvFunctional(pkt, id); }
127
128 /**
104 { }
105
106 protected:
107
108 /**
109 * When receiving a timing request, pass it to the crossbar.
110 */
111 virtual bool recvTimingReq(PacketPtr pkt)

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

125
126 /**
127 * When receiving a functional request, pass it to the crossbar.
128 */
129 virtual void recvFunctional(PacketPtr pkt)
130 { xbar.recvFunctional(pkt, id); }
131
132 /**
129 * When receiving a retry, pass it to the crossbar.
130 */
131 virtual void recvRespRetry()
132 { panic("Crossbar slave ports should never retry.\n"); }
133
134 /**
135 * Return the union of all adress ranges seen by this crossbar.
136 */
137 virtual AddrRangeList getAddrRanges() const
138 { return xbar.getAddrRanges(); }
139
140 };
141
142 /**

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

210 * port. It is effectively a dangling master port.
211 */
212 class SnoopRespPort : public MasterPort
213 {
214
215 private:
216
217 /** The port which we mirror internally. */
133 * Return the union of all adress ranges seen by this crossbar.
134 */
135 virtual AddrRangeList getAddrRanges() const
136 { return xbar.getAddrRanges(); }
137
138 };
139
140 /**

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

208 * port. It is effectively a dangling master port.
209 */
210 class SnoopRespPort : public MasterPort
211 {
212
213 private:
214
215 /** The port which we mirror internally. */
218 SlavePort& slavePort;
216 QueuedSlavePort& slavePort;
219
220 public:
221
222 /**
223 * Create a snoop response port that mirrors a given slave port.
224 */
217
218 public:
219
220 /**
221 * Create a snoop response port that mirrors a given slave port.
222 */
225 SnoopRespPort(SlavePort& slave_port, CoherentXBar& _xbar) :
223 SnoopRespPort(QueuedSlavePort& slave_port, CoherentXBar& _xbar) :
226 MasterPort(slave_port.name() + ".snoopRespPort", &_xbar),
227 slavePort(slave_port) { }
228
229 /**
230 * Override the sending of retries and pass them on through
231 * the mirrored slave port.
232 */
233 void sendRetryResp() {

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

248 panic("SnoopRespPort should never see timing response\n");
249 return false;
250 }
251
252 };
253
254 std::vector<SnoopRespPort*> snoopRespPorts;
255
224 MasterPort(slave_port.name() + ".snoopRespPort", &_xbar),
225 slavePort(slave_port) { }
226
227 /**
228 * Override the sending of retries and pass them on through
229 * the mirrored slave port.
230 */
231 void sendRetryResp() {

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

246 panic("SnoopRespPort should never see timing response\n");
247 return false;
248 }
249
250 };
251
252 std::vector<SnoopRespPort*> snoopRespPorts;
253
256 std::vector snoopPorts;
254 std::vector<QueuedSlavePort*> snoopPorts;
257
258 /**
259 * Store the outstanding requests that we are expecting snoop
260 * responses from so we can determine which snoop responses we
261 * generated and which ones were merely forwarded.
262 */
263 m5::hash_set<RequestPtr> outstandingSnoop;
264

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

319 * excluding one of the connected coherent masters to avoid sending a packet
320 * back to where it came from.
321 *
322 * @param pkt Packet to forward
323 * @param exclude_slave_port_id Id of slave port to exclude
324 * @param dests Vector of destination ports for the forwarded pkt
325 */
326 void forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id,
255
256 /**
257 * Store the outstanding requests that we are expecting snoop
258 * responses from so we can determine which snoop responses we
259 * generated and which ones were merely forwarded.
260 */
261 m5::hash_set<RequestPtr> outstandingSnoop;
262

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

317 * excluding one of the connected coherent masters to avoid sending a packet
318 * back to where it came from.
319 *
320 * @param pkt Packet to forward
321 * @param exclude_slave_port_id Id of slave port to exclude
322 * @param dests Vector of destination ports for the forwarded pkt
323 */
324 void forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id,
327 const std::vector& dests);
325 const std::vector<QueuedSlavePort*>& dests);
328
329 /** Function called by the port when the crossbar is recieving a Atomic
330 transaction.*/
331 Tick recvAtomic(PacketPtr pkt, PortID slave_port_id);
332
333 /** Function called by the port when the crossbar is recieving an
334 atomic snoop transaction.*/
335 Tick recvAtomicSnoop(PacketPtr pkt, PortID master_port_id);

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

342 * @param pkt Packet to forward
343 * @param exclude_slave_port_id Id of slave port to exclude
344 *
345 * @return a pair containing the snoop response and snoop latency
346 */
347 std::pair<MemCmd, Tick> forwardAtomic(PacketPtr pkt,
348 PortID exclude_slave_port_id)
349 {
326
327 /** Function called by the port when the crossbar is recieving a Atomic
328 transaction.*/
329 Tick recvAtomic(PacketPtr pkt, PortID slave_port_id);
330
331 /** Function called by the port when the crossbar is recieving an
332 atomic snoop transaction.*/
333 Tick recvAtomicSnoop(PacketPtr pkt, PortID master_port_id);

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

340 * @param pkt Packet to forward
341 * @param exclude_slave_port_id Id of slave port to exclude
342 *
343 * @return a pair containing the snoop response and snoop latency
344 */
345 std::pair<MemCmd, Tick> forwardAtomic(PacketPtr pkt,
346 PortID exclude_slave_port_id)
347 {
350 return forwardAtomic(pkt, exclude_slave_port_id, InvalidPortID, snoopPorts);
348 return forwardAtomic(pkt, exclude_slave_port_id, InvalidPortID,
349 snoopPorts);
351 }
352
353 /**
354 * Forward an atomic packet to a selected list of snoopers, potentially
355 * excluding one of the connected coherent masters to avoid sending a packet
356 * back to where it came from.
357 *
358 * @param pkt Packet to forward
359 * @param exclude_slave_port_id Id of slave port to exclude
360 * @param source_master_port_id Id of the master port for snoops from below
361 * @param dests Vector of destination ports for the forwarded pkt
362 *
363 * @return a pair containing the snoop response and snoop latency
364 */
365 std::pair<MemCmd, Tick> forwardAtomic(PacketPtr pkt,
366 PortID exclude_slave_port_id,
367 PortID source_master_port_id,
350 }
351
352 /**
353 * Forward an atomic packet to a selected list of snoopers, potentially
354 * excluding one of the connected coherent masters to avoid sending a packet
355 * back to where it came from.
356 *
357 * @param pkt Packet to forward
358 * @param exclude_slave_port_id Id of slave port to exclude
359 * @param source_master_port_id Id of the master port for snoops from below
360 * @param dests Vector of destination ports for the forwarded pkt
361 *
362 * @return a pair containing the snoop response and snoop latency
363 */
364 std::pair<MemCmd, Tick> forwardAtomic(PacketPtr pkt,
365 PortID exclude_slave_port_id,
366 PortID source_master_port_id,
368 const std::vector<SlavePort*>& dests);
367 const std::vector<QueuedSlavePort*>&
368 dests);
369
370 /** Function called by the port when the crossbar is recieving a Functional
371 transaction.*/
372 void recvFunctional(PacketPtr pkt, PortID slave_port_id);
373
374 /** Function called by the port when the crossbar is recieving a functional
375 snoop transaction.*/
376 void recvFunctionalSnoop(PacketPtr pkt, PortID master_port_id);

--- 28 unchanged lines hidden ---
369
370 /** Function called by the port when the crossbar is recieving a Functional
371 transaction.*/
372 void recvFunctional(PacketPtr pkt, PortID slave_port_id);
373
374 /** Function called by the port when the crossbar is recieving a functional
375 snoop transaction.*/
376 void recvFunctionalSnoop(PacketPtr pkt, PortID master_port_id);

--- 28 unchanged lines hidden ---