noncoherent_xbar.cc (10713:eddb533708cb) noncoherent_xbar.cc (10719:b4fc9ad648aa)
1/*
1/*
2 * Copyright (c) 2011-2014 ARM Limited
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Copyright (c) 2006 The Regents of The University of Michigan
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution;
24 * neither the name of the copyright holders nor the names of its
25 * contributors may be used to endorse or promote products derived from
26 * this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Authors: Ali Saidi
41 * Andreas Hansson
42 * William Wang
43 */
44
45/**
46 * @file
47 * Definition of a non-coherent crossbar object.
48 */
49
50#include "base/misc.hh"
51#include "base/trace.hh"
52#include "debug/NoncoherentXBar.hh"
53#include "debug/XBar.hh"
54#include "mem/noncoherent_xbar.hh"
55
56NoncoherentXBar::NoncoherentXBar(const NoncoherentXBarParams *p)
57 : BaseXBar(p)
58{
59 // create the ports based on the size of the master and slave
60 // vector ports, and the presence of the default port, the ports
61 // are enumerated starting from zero
62 for (int i = 0; i < p->port_master_connection_count; ++i) {
63 std::string portName = csprintf("%s.master[%d]", name(), i);
64 MasterPort* bp = new NoncoherentXBarMasterPort(portName, *this, i);
65 masterPorts.push_back(bp);
66 reqLayers.push_back(new ReqLayer(*bp, *this,
67 csprintf(".reqLayer%d", i)));
68 }
69
70 // see if we have a default slave device connected and if so add
71 // our corresponding master port
72 if (p->port_default_connection_count) {
73 defaultPortID = masterPorts.size();
74 std::string portName = name() + ".default";
75 MasterPort* bp = new NoncoherentXBarMasterPort(portName, *this,
76 defaultPortID);
77 masterPorts.push_back(bp);
78 reqLayers.push_back(new ReqLayer(*bp, *this, csprintf(".reqLayer%d",
79 defaultPortID)));
80 }
81
82 // create the slave ports, once again starting at zero
83 for (int i = 0; i < p->port_slave_connection_count; ++i) {
84 std::string portName = csprintf("%s.slave[%d]", name(), i);
85 SlavePort* bp = new NoncoherentXBarSlavePort(portName, *this, i);
86 slavePorts.push_back(bp);
87 respLayers.push_back(new RespLayer(*bp, *this,
88 csprintf(".respLayer%d", i)));
89 }
90
91 clearPortCache();
92}
93
94NoncoherentXBar::~NoncoherentXBar()
95{
96 for (auto l: reqLayers)
97 delete l;
98 for (auto l: respLayers)
99 delete l;
100}
101
102bool
103NoncoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id)
104{
105 // determine the source port based on the id
106 SlavePort *src_port = slavePorts[slave_port_id];
107
108 // we should never see express snoops on a non-coherent crossbar
109 assert(!pkt->isExpressSnoop());
110
111 // determine the destination based on the address
112 PortID master_port_id = findPort(pkt->getAddr());
113
114 // test if the layer should be considered occupied for the current
115 // port
116 if (!reqLayers[master_port_id]->tryTiming(src_port)) {
117 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x BUSY\n",
118 src_port->name(), pkt->cmdString(), pkt->getAddr());
119 return false;
120 }
121
122 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x\n",
123 src_port->name(), pkt->cmdString(), pkt->getAddr());
124
125 // store size and command as they might be modified when
126 // forwarding the packet
127 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
128 unsigned int pkt_cmd = pkt->cmdToIndex();
129
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Copyright (c) 2006 The Regents of The University of Michigan
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution;
24 * neither the name of the copyright holders nor the names of its
25 * contributors may be used to endorse or promote products derived from
26 * this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Authors: Ali Saidi
41 * Andreas Hansson
42 * William Wang
43 */
44
45/**
46 * @file
47 * Definition of a non-coherent crossbar object.
48 */
49
50#include "base/misc.hh"
51#include "base/trace.hh"
52#include "debug/NoncoherentXBar.hh"
53#include "debug/XBar.hh"
54#include "mem/noncoherent_xbar.hh"
55
56NoncoherentXBar::NoncoherentXBar(const NoncoherentXBarParams *p)
57 : BaseXBar(p)
58{
59 // create the ports based on the size of the master and slave
60 // vector ports, and the presence of the default port, the ports
61 // are enumerated starting from zero
62 for (int i = 0; i < p->port_master_connection_count; ++i) {
63 std::string portName = csprintf("%s.master[%d]", name(), i);
64 MasterPort* bp = new NoncoherentXBarMasterPort(portName, *this, i);
65 masterPorts.push_back(bp);
66 reqLayers.push_back(new ReqLayer(*bp, *this,
67 csprintf(".reqLayer%d", i)));
68 }
69
70 // see if we have a default slave device connected and if so add
71 // our corresponding master port
72 if (p->port_default_connection_count) {
73 defaultPortID = masterPorts.size();
74 std::string portName = name() + ".default";
75 MasterPort* bp = new NoncoherentXBarMasterPort(portName, *this,
76 defaultPortID);
77 masterPorts.push_back(bp);
78 reqLayers.push_back(new ReqLayer(*bp, *this, csprintf(".reqLayer%d",
79 defaultPortID)));
80 }
81
82 // create the slave ports, once again starting at zero
83 for (int i = 0; i < p->port_slave_connection_count; ++i) {
84 std::string portName = csprintf("%s.slave[%d]", name(), i);
85 SlavePort* bp = new NoncoherentXBarSlavePort(portName, *this, i);
86 slavePorts.push_back(bp);
87 respLayers.push_back(new RespLayer(*bp, *this,
88 csprintf(".respLayer%d", i)));
89 }
90
91 clearPortCache();
92}
93
94NoncoherentXBar::~NoncoherentXBar()
95{
96 for (auto l: reqLayers)
97 delete l;
98 for (auto l: respLayers)
99 delete l;
100}
101
102bool
103NoncoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id)
104{
105 // determine the source port based on the id
106 SlavePort *src_port = slavePorts[slave_port_id];
107
108 // we should never see express snoops on a non-coherent crossbar
109 assert(!pkt->isExpressSnoop());
110
111 // determine the destination based on the address
112 PortID master_port_id = findPort(pkt->getAddr());
113
114 // test if the layer should be considered occupied for the current
115 // port
116 if (!reqLayers[master_port_id]->tryTiming(src_port)) {
117 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x BUSY\n",
118 src_port->name(), pkt->cmdString(), pkt->getAddr());
119 return false;
120 }
121
122 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x\n",
123 src_port->name(), pkt->cmdString(), pkt->getAddr());
124
125 // store size and command as they might be modified when
126 // forwarding the packet
127 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
128 unsigned int pkt_cmd = pkt->cmdToIndex();
129
130 calcPacketTiming(pkt);
131 Tick packetFinishTime = curTick() + pkt->payloadDelay;
130 // store the old header delay so we can restore it if needed
131 Tick old_header_delay = pkt->headerDelay;
132
132
133 // a request sees the frontend and forward latency
134 Tick xbar_delay = (frontendLatency + forwardLatency) * clockPeriod();
135
136 // set the packet header and payload delay
137 calcPacketTiming(pkt, xbar_delay);
138
139 // determine how long to be crossbar layer is busy
140 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay;
141
133 // before forwarding the packet (and possibly altering it),
134 // remember if we are expecting a response
135 const bool expect_response = pkt->needsResponse() &&
136 !pkt->memInhibitAsserted();
137
138 // since it is a normal request, attempt to send the packet
139 bool success = masterPorts[master_port_id]->sendTimingReq(pkt);
140
141 if (!success) {
142 // inhibited packets should never be forced to retry
143 assert(!pkt->memInhibitAsserted());
144
145 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n",
146 src_port->name(), pkt->cmdString(), pkt->getAddr());
147
142 // before forwarding the packet (and possibly altering it),
143 // remember if we are expecting a response
144 const bool expect_response = pkt->needsResponse() &&
145 !pkt->memInhibitAsserted();
146
147 // since it is a normal request, attempt to send the packet
148 bool success = masterPorts[master_port_id]->sendTimingReq(pkt);
149
150 if (!success) {
151 // inhibited packets should never be forced to retry
152 assert(!pkt->memInhibitAsserted());
153
154 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n",
155 src_port->name(), pkt->cmdString(), pkt->getAddr());
156
148 // undo the calculation so we can check for 0 again
149 pkt->headerDelay = pkt->payloadDelay = 0;
157 // restore the header delay as it is additive
158 pkt->headerDelay = old_header_delay;
150
151 // occupy until the header is sent
152 reqLayers[master_port_id]->failedTiming(src_port,
159
160 // occupy until the header is sent
161 reqLayers[master_port_id]->failedTiming(src_port,
153 clockEdge(headerCycles));
162 clockEdge(Cycles(1)));
154
155 return false;
156 }
157
158 // remember where to route the response to
159 if (expect_response) {
160 assert(routeTo.find(pkt->req) == routeTo.end());
161 routeTo[pkt->req] = slave_port_id;
162 }
163
164 reqLayers[master_port_id]->succeededTiming(packetFinishTime);
165
166 // stats updates
167 pktCount[slave_port_id][master_port_id]++;
168 pktSize[slave_port_id][master_port_id] += pkt_size;
169 transDist[pkt_cmd]++;
170
171 return true;
172}
173
174bool
175NoncoherentXBar::recvTimingResp(PacketPtr pkt, PortID master_port_id)
176{
177 // determine the source port based on the id
178 MasterPort *src_port = masterPorts[master_port_id];
179
180 // determine the destination
181 const auto route_lookup = routeTo.find(pkt->req);
182 assert(route_lookup != routeTo.end());
183 const PortID slave_port_id = route_lookup->second;
184 assert(slave_port_id != InvalidPortID);
185 assert(slave_port_id < respLayers.size());
186
187 // test if the layer should be considered occupied for the current
188 // port
189 if (!respLayers[slave_port_id]->tryTiming(src_port)) {
190 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x BUSY\n",
191 src_port->name(), pkt->cmdString(), pkt->getAddr());
192 return false;
193 }
194
195 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x\n",
196 src_port->name(), pkt->cmdString(), pkt->getAddr());
197
198 // store size and command as they might be modified when
199 // forwarding the packet
200 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
201 unsigned int pkt_cmd = pkt->cmdToIndex();
202
163
164 return false;
165 }
166
167 // remember where to route the response to
168 if (expect_response) {
169 assert(routeTo.find(pkt->req) == routeTo.end());
170 routeTo[pkt->req] = slave_port_id;
171 }
172
173 reqLayers[master_port_id]->succeededTiming(packetFinishTime);
174
175 // stats updates
176 pktCount[slave_port_id][master_port_id]++;
177 pktSize[slave_port_id][master_port_id] += pkt_size;
178 transDist[pkt_cmd]++;
179
180 return true;
181}
182
183bool
184NoncoherentXBar::recvTimingResp(PacketPtr pkt, PortID master_port_id)
185{
186 // determine the source port based on the id
187 MasterPort *src_port = masterPorts[master_port_id];
188
189 // determine the destination
190 const auto route_lookup = routeTo.find(pkt->req);
191 assert(route_lookup != routeTo.end());
192 const PortID slave_port_id = route_lookup->second;
193 assert(slave_port_id != InvalidPortID);
194 assert(slave_port_id < respLayers.size());
195
196 // test if the layer should be considered occupied for the current
197 // port
198 if (!respLayers[slave_port_id]->tryTiming(src_port)) {
199 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x BUSY\n",
200 src_port->name(), pkt->cmdString(), pkt->getAddr());
201 return false;
202 }
203
204 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x\n",
205 src_port->name(), pkt->cmdString(), pkt->getAddr());
206
207 // store size and command as they might be modified when
208 // forwarding the packet
209 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
210 unsigned int pkt_cmd = pkt->cmdToIndex();
211
203 calcPacketTiming(pkt);
204 Tick packetFinishTime = curTick() + pkt->payloadDelay;
212 // a response sees the response latency
213 Tick xbar_delay = responseLatency * clockPeriod();
205
214
215 // set the packet header and payload delay
216 calcPacketTiming(pkt, xbar_delay);
217
218 // determine how long to be crossbar layer is busy
219 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay;
220
206 // send the packet through the destination slave port
207 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);
208
209 // currently it is illegal to block responses... can lead to
210 // deadlock
211 assert(success);
212
213 // remove the request from the routing table
214 routeTo.erase(route_lookup);
215
216 respLayers[slave_port_id]->succeededTiming(packetFinishTime);
217
218 // stats updates
219 pktCount[slave_port_id][master_port_id]++;
220 pktSize[slave_port_id][master_port_id] += pkt_size;
221 transDist[pkt_cmd]++;
222
223 return true;
224}
225
226void
227NoncoherentXBar::recvReqRetry(PortID master_port_id)
228{
229 // responses never block on forwarding them, so the retry will
230 // always be coming from a port to which we tried to forward a
231 // request
232 reqLayers[master_port_id]->recvRetry();
233}
234
235Tick
236NoncoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
237{
238 DPRINTF(NoncoherentXBar, "recvAtomic: packet src %s addr 0x%x cmd %s\n",
239 slavePorts[slave_port_id]->name(), pkt->getAddr(),
240 pkt->cmdString());
241
242 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
243 unsigned int pkt_cmd = pkt->cmdToIndex();
244
245 // determine the destination port
246 PortID master_port_id = findPort(pkt->getAddr());
247
248 // stats updates for the request
249 pktCount[slave_port_id][master_port_id]++;
250 pktSize[slave_port_id][master_port_id] += pkt_size;
251 transDist[pkt_cmd]++;
252
253 // forward the request to the appropriate destination
254 Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
255
256 // add the response data
257 if (pkt->isResponse()) {
258 pkt_size = pkt->hasData() ? pkt->getSize() : 0;
259 pkt_cmd = pkt->cmdToIndex();
260
261 // stats updates
262 pktCount[slave_port_id][master_port_id]++;
263 pktSize[slave_port_id][master_port_id] += pkt_size;
264 transDist[pkt_cmd]++;
265 }
266
267 // @todo: Not setting first-word time
268 pkt->payloadDelay = response_latency;
269 return response_latency;
270}
271
272void
273NoncoherentXBar::recvFunctional(PacketPtr pkt, PortID slave_port_id)
274{
275 if (!pkt->isPrint()) {
276 // don't do DPRINTFs on PrintReq as it clutters up the output
277 DPRINTF(NoncoherentXBar,
278 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
279 slavePorts[slave_port_id]->name(), pkt->getAddr(),
280 pkt->cmdString());
281 }
282
283 // determine the destination port
284 PortID dest_id = findPort(pkt->getAddr());
285
286 // forward the request to the appropriate destination
287 masterPorts[dest_id]->sendFunctional(pkt);
288}
289
290unsigned int
291NoncoherentXBar::drain(DrainManager *dm)
292{
293 // sum up the individual layers
294 unsigned int total = 0;
295 for (auto l: reqLayers)
296 total += l->drain(dm);
297 for (auto l: respLayers)
298 total += l->drain(dm);
299 return total;
300}
301
302NoncoherentXBar*
303NoncoherentXBarParams::create()
304{
305 return new NoncoherentXBar(this);
306}
307
308void
309NoncoherentXBar::regStats()
310{
311 // register the stats of the base class and our layers
312 BaseXBar::regStats();
313 for (auto l: reqLayers)
314 l->regStats();
315 for (auto l: respLayers)
316 l->regStats();
317}
221 // send the packet through the destination slave port
222 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);
223
224 // currently it is illegal to block responses... can lead to
225 // deadlock
226 assert(success);
227
228 // remove the request from the routing table
229 routeTo.erase(route_lookup);
230
231 respLayers[slave_port_id]->succeededTiming(packetFinishTime);
232
233 // stats updates
234 pktCount[slave_port_id][master_port_id]++;
235 pktSize[slave_port_id][master_port_id] += pkt_size;
236 transDist[pkt_cmd]++;
237
238 return true;
239}
240
241void
242NoncoherentXBar::recvReqRetry(PortID master_port_id)
243{
244 // responses never block on forwarding them, so the retry will
245 // always be coming from a port to which we tried to forward a
246 // request
247 reqLayers[master_port_id]->recvRetry();
248}
249
250Tick
251NoncoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
252{
253 DPRINTF(NoncoherentXBar, "recvAtomic: packet src %s addr 0x%x cmd %s\n",
254 slavePorts[slave_port_id]->name(), pkt->getAddr(),
255 pkt->cmdString());
256
257 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
258 unsigned int pkt_cmd = pkt->cmdToIndex();
259
260 // determine the destination port
261 PortID master_port_id = findPort(pkt->getAddr());
262
263 // stats updates for the request
264 pktCount[slave_port_id][master_port_id]++;
265 pktSize[slave_port_id][master_port_id] += pkt_size;
266 transDist[pkt_cmd]++;
267
268 // forward the request to the appropriate destination
269 Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
270
271 // add the response data
272 if (pkt->isResponse()) {
273 pkt_size = pkt->hasData() ? pkt->getSize() : 0;
274 pkt_cmd = pkt->cmdToIndex();
275
276 // stats updates
277 pktCount[slave_port_id][master_port_id]++;
278 pktSize[slave_port_id][master_port_id] += pkt_size;
279 transDist[pkt_cmd]++;
280 }
281
282 // @todo: Not setting first-word time
283 pkt->payloadDelay = response_latency;
284 return response_latency;
285}
286
287void
288NoncoherentXBar::recvFunctional(PacketPtr pkt, PortID slave_port_id)
289{
290 if (!pkt->isPrint()) {
291 // don't do DPRINTFs on PrintReq as it clutters up the output
292 DPRINTF(NoncoherentXBar,
293 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
294 slavePorts[slave_port_id]->name(), pkt->getAddr(),
295 pkt->cmdString());
296 }
297
298 // determine the destination port
299 PortID dest_id = findPort(pkt->getAddr());
300
301 // forward the request to the appropriate destination
302 masterPorts[dest_id]->sendFunctional(pkt);
303}
304
305unsigned int
306NoncoherentXBar::drain(DrainManager *dm)
307{
308 // sum up the individual layers
309 unsigned int total = 0;
310 for (auto l: reqLayers)
311 total += l->drain(dm);
312 for (auto l: respLayers)
313 total += l->drain(dm);
314 return total;
315}
316
317NoncoherentXBar*
318NoncoherentXBarParams::create()
319{
320 return new NoncoherentXBar(this);
321}
322
323void
324NoncoherentXBar::regStats()
325{
326 // register the stats of the base class and our layers
327 BaseXBar::regStats();
328 for (auto l: reqLayers)
329 l->regStats();
330 for (auto l: respLayers)
331 l->regStats();
332}