noncoherent_xbar.cc (12778:ca8c50112a66) noncoherent_xbar.cc (12780:14937f6495b4)
1/*
1/*
2 * Copyright (c) 2011-2015 ARM Limited
2 * Copyright (c) 2011-2015, 2018 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 "mem/noncoherent_xbar.hh"
51
52#include "base/logging.hh"
53#include "base/trace.hh"
54#include "debug/NoncoherentXBar.hh"
55#include "debug/XBar.hh"
56
57NoncoherentXBar::NoncoherentXBar(const NoncoherentXBarParams *p)
58 : BaseXBar(p)
59{
60 // create the ports based on the size of the master and slave
61 // vector ports, and the presence of the default port, the ports
62 // are enumerated starting from zero
63 for (int i = 0; i < p->port_master_connection_count; ++i) {
64 std::string portName = csprintf("%s.master[%d]", name(), i);
65 MasterPort* bp = new NoncoherentXBarMasterPort(portName, *this, i);
66 masterPorts.push_back(bp);
67 reqLayers.push_back(new ReqLayer(*bp, *this,
68 csprintf(".reqLayer%d", i)));
69 }
70
71 // see if we have a default slave device connected and if so add
72 // our corresponding master port
73 if (p->port_default_connection_count) {
74 defaultPortID = masterPorts.size();
75 std::string portName = name() + ".default";
76 MasterPort* bp = new NoncoherentXBarMasterPort(portName, *this,
77 defaultPortID);
78 masterPorts.push_back(bp);
79 reqLayers.push_back(new ReqLayer(*bp, *this, csprintf(".reqLayer%d",
80 defaultPortID)));
81 }
82
83 // create the slave ports, once again starting at zero
84 for (int i = 0; i < p->port_slave_connection_count; ++i) {
85 std::string portName = csprintf("%s.slave[%d]", name(), i);
86 QueuedSlavePort* bp = new NoncoherentXBarSlavePort(portName, *this, i);
87 slavePorts.push_back(bp);
88 respLayers.push_back(new RespLayer(*bp, *this,
89 csprintf(".respLayer%d", i)));
90 }
91}
92
93NoncoherentXBar::~NoncoherentXBar()
94{
95 for (auto l: reqLayers)
96 delete l;
97 for (auto l: respLayers)
98 delete l;
99}
100
101bool
102NoncoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id)
103{
104 // determine the source port based on the id
105 SlavePort *src_port = slavePorts[slave_port_id];
106
107 // we should never see express snoops on a non-coherent crossbar
108 assert(!pkt->isExpressSnoop());
109
110 // determine the destination based on the address
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 "mem/noncoherent_xbar.hh"
51
52#include "base/logging.hh"
53#include "base/trace.hh"
54#include "debug/NoncoherentXBar.hh"
55#include "debug/XBar.hh"
56
57NoncoherentXBar::NoncoherentXBar(const NoncoherentXBarParams *p)
58 : BaseXBar(p)
59{
60 // create the ports based on the size of the master and slave
61 // vector ports, and the presence of the default port, the ports
62 // are enumerated starting from zero
63 for (int i = 0; i < p->port_master_connection_count; ++i) {
64 std::string portName = csprintf("%s.master[%d]", name(), i);
65 MasterPort* bp = new NoncoherentXBarMasterPort(portName, *this, i);
66 masterPorts.push_back(bp);
67 reqLayers.push_back(new ReqLayer(*bp, *this,
68 csprintf(".reqLayer%d", i)));
69 }
70
71 // see if we have a default slave device connected and if so add
72 // our corresponding master port
73 if (p->port_default_connection_count) {
74 defaultPortID = masterPorts.size();
75 std::string portName = name() + ".default";
76 MasterPort* bp = new NoncoherentXBarMasterPort(portName, *this,
77 defaultPortID);
78 masterPorts.push_back(bp);
79 reqLayers.push_back(new ReqLayer(*bp, *this, csprintf(".reqLayer%d",
80 defaultPortID)));
81 }
82
83 // create the slave ports, once again starting at zero
84 for (int i = 0; i < p->port_slave_connection_count; ++i) {
85 std::string portName = csprintf("%s.slave[%d]", name(), i);
86 QueuedSlavePort* bp = new NoncoherentXBarSlavePort(portName, *this, i);
87 slavePorts.push_back(bp);
88 respLayers.push_back(new RespLayer(*bp, *this,
89 csprintf(".respLayer%d", i)));
90 }
91}
92
93NoncoherentXBar::~NoncoherentXBar()
94{
95 for (auto l: reqLayers)
96 delete l;
97 for (auto l: respLayers)
98 delete l;
99}
100
101bool
102NoncoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id)
103{
104 // determine the source port based on the id
105 SlavePort *src_port = slavePorts[slave_port_id];
106
107 // we should never see express snoops on a non-coherent crossbar
108 assert(!pkt->isExpressSnoop());
109
110 // determine the destination based on the address
111 PortID master_port_id = findPort(pkt->getAddr());
111 AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
112 PortID master_port_id = findPort(addr_range);
112
113 // test if the layer should be considered occupied for the current
114 // port
115 if (!reqLayers[master_port_id]->tryTiming(src_port)) {
116 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x BUSY\n",
117 src_port->name(), pkt->cmdString(), pkt->getAddr());
118 return false;
119 }
120
121 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x\n",
122 src_port->name(), pkt->cmdString(), pkt->getAddr());
123
124 // store size and command as they might be modified when
125 // forwarding the packet
126 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
127 unsigned int pkt_cmd = pkt->cmdToIndex();
128
129 // store the old header delay so we can restore it if needed
130 Tick old_header_delay = pkt->headerDelay;
131
132 // a request sees the frontend and forward latency
133 Tick xbar_delay = (frontendLatency + forwardLatency) * clockPeriod();
134
135 // set the packet header and payload delay
136 calcPacketTiming(pkt, xbar_delay);
137
138 // determine how long to be crossbar layer is busy
139 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay;
140
141 // before forwarding the packet (and possibly altering it),
142 // remember if we are expecting a response
143 const bool expect_response = pkt->needsResponse() &&
144 !pkt->cacheResponding();
145
146 // since it is a normal request, attempt to send the packet
147 bool success = masterPorts[master_port_id]->sendTimingReq(pkt);
148
149 if (!success) {
150 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n",
151 src_port->name(), pkt->cmdString(), pkt->getAddr());
152
153 // restore the header delay as it is additive
154 pkt->headerDelay = old_header_delay;
155
156 // occupy until the header is sent
157 reqLayers[master_port_id]->failedTiming(src_port,
158 clockEdge(Cycles(1)));
159
160 return false;
161 }
162
163 // remember where to route the response to
164 if (expect_response) {
165 assert(routeTo.find(pkt->req) == routeTo.end());
166 routeTo[pkt->req] = slave_port_id;
167 }
168
169 reqLayers[master_port_id]->succeededTiming(packetFinishTime);
170
171 // stats updates
172 pktCount[slave_port_id][master_port_id]++;
173 pktSize[slave_port_id][master_port_id] += pkt_size;
174 transDist[pkt_cmd]++;
175
176 return true;
177}
178
179bool
180NoncoherentXBar::recvTimingResp(PacketPtr pkt, PortID master_port_id)
181{
182 // determine the source port based on the id
183 MasterPort *src_port = masterPorts[master_port_id];
184
185 // determine the destination
186 const auto route_lookup = routeTo.find(pkt->req);
187 assert(route_lookup != routeTo.end());
188 const PortID slave_port_id = route_lookup->second;
189 assert(slave_port_id != InvalidPortID);
190 assert(slave_port_id < respLayers.size());
191
192 // test if the layer should be considered occupied for the current
193 // port
194 if (!respLayers[slave_port_id]->tryTiming(src_port)) {
195 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x BUSY\n",
196 src_port->name(), pkt->cmdString(), pkt->getAddr());
197 return false;
198 }
199
200 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x\n",
201 src_port->name(), pkt->cmdString(), pkt->getAddr());
202
203 // store size and command as they might be modified when
204 // forwarding the packet
205 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
206 unsigned int pkt_cmd = pkt->cmdToIndex();
207
208 // a response sees the response latency
209 Tick xbar_delay = responseLatency * clockPeriod();
210
211 // set the packet header and payload delay
212 calcPacketTiming(pkt, xbar_delay);
213
214 // determine how long to be crossbar layer is busy
215 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay;
216
217 // send the packet through the destination slave port, and pay for
218 // any outstanding latency
219 Tick latency = pkt->headerDelay;
220 pkt->headerDelay = 0;
221 slavePorts[slave_port_id]->schedTimingResp(pkt, curTick() + latency);
222
223 // remove the request from the routing table
224 routeTo.erase(route_lookup);
225
226 respLayers[slave_port_id]->succeededTiming(packetFinishTime);
227
228 // stats updates
229 pktCount[slave_port_id][master_port_id]++;
230 pktSize[slave_port_id][master_port_id] += pkt_size;
231 transDist[pkt_cmd]++;
232
233 return true;
234}
235
236void
237NoncoherentXBar::recvReqRetry(PortID master_port_id)
238{
239 // responses never block on forwarding them, so the retry will
240 // always be coming from a port to which we tried to forward a
241 // request
242 reqLayers[master_port_id]->recvRetry();
243}
244
245Tick
246NoncoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
247{
248 DPRINTF(NoncoherentXBar, "recvAtomic: packet src %s addr 0x%x cmd %s\n",
249 slavePorts[slave_port_id]->name(), pkt->getAddr(),
250 pkt->cmdString());
251
252 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
253 unsigned int pkt_cmd = pkt->cmdToIndex();
254
255 // determine the destination port
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 // store the old header delay so we can restore it if needed
131 Tick old_header_delay = pkt->headerDelay;
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
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->cacheResponding();
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 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n",
152 src_port->name(), pkt->cmdString(), pkt->getAddr());
153
154 // restore the header delay as it is additive
155 pkt->headerDelay = old_header_delay;
156
157 // occupy until the header is sent
158 reqLayers[master_port_id]->failedTiming(src_port,
159 clockEdge(Cycles(1)));
160
161 return false;
162 }
163
164 // remember where to route the response to
165 if (expect_response) {
166 assert(routeTo.find(pkt->req) == routeTo.end());
167 routeTo[pkt->req] = slave_port_id;
168 }
169
170 reqLayers[master_port_id]->succeededTiming(packetFinishTime);
171
172 // stats updates
173 pktCount[slave_port_id][master_port_id]++;
174 pktSize[slave_port_id][master_port_id] += pkt_size;
175 transDist[pkt_cmd]++;
176
177 return true;
178}
179
180bool
181NoncoherentXBar::recvTimingResp(PacketPtr pkt, PortID master_port_id)
182{
183 // determine the source port based on the id
184 MasterPort *src_port = masterPorts[master_port_id];
185
186 // determine the destination
187 const auto route_lookup = routeTo.find(pkt->req);
188 assert(route_lookup != routeTo.end());
189 const PortID slave_port_id = route_lookup->second;
190 assert(slave_port_id != InvalidPortID);
191 assert(slave_port_id < respLayers.size());
192
193 // test if the layer should be considered occupied for the current
194 // port
195 if (!respLayers[slave_port_id]->tryTiming(src_port)) {
196 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x BUSY\n",
197 src_port->name(), pkt->cmdString(), pkt->getAddr());
198 return false;
199 }
200
201 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x\n",
202 src_port->name(), pkt->cmdString(), pkt->getAddr());
203
204 // store size and command as they might be modified when
205 // forwarding the packet
206 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
207 unsigned int pkt_cmd = pkt->cmdToIndex();
208
209 // a response sees the response latency
210 Tick xbar_delay = responseLatency * clockPeriod();
211
212 // set the packet header and payload delay
213 calcPacketTiming(pkt, xbar_delay);
214
215 // determine how long to be crossbar layer is busy
216 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay;
217
218 // send the packet through the destination slave port, and pay for
219 // any outstanding latency
220 Tick latency = pkt->headerDelay;
221 pkt->headerDelay = 0;
222 slavePorts[slave_port_id]->schedTimingResp(pkt, curTick() + latency);
223
224 // remove the request from the routing table
225 routeTo.erase(route_lookup);
226
227 respLayers[slave_port_id]->succeededTiming(packetFinishTime);
228
229 // stats updates
230 pktCount[slave_port_id][master_port_id]++;
231 pktSize[slave_port_id][master_port_id] += pkt_size;
232 transDist[pkt_cmd]++;
233
234 return true;
235}
236
237void
238NoncoherentXBar::recvReqRetry(PortID master_port_id)
239{
240 // responses never block on forwarding them, so the retry will
241 // always be coming from a port to which we tried to forward a
242 // request
243 reqLayers[master_port_id]->recvRetry();
244}
245
246Tick
247NoncoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id)
248{
249 DPRINTF(NoncoherentXBar, "recvAtomic: packet src %s addr 0x%x cmd %s\n",
250 slavePorts[slave_port_id]->name(), pkt->getAddr(),
251 pkt->cmdString());
252
253 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
254 unsigned int pkt_cmd = pkt->cmdToIndex();
255
256 // determine the destination port
256 PortID master_port_id = findPort(pkt->getAddr());
257 AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
258 PortID master_port_id = findPort(addr_range);
257
258 // stats updates for the request
259 pktCount[slave_port_id][master_port_id]++;
260 pktSize[slave_port_id][master_port_id] += pkt_size;
261 transDist[pkt_cmd]++;
262
263 // forward the request to the appropriate destination
264 Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
265
266 // add the response data
267 if (pkt->isResponse()) {
268 pkt_size = pkt->hasData() ? pkt->getSize() : 0;
269 pkt_cmd = pkt->cmdToIndex();
270
271 // stats updates
272 pktCount[slave_port_id][master_port_id]++;
273 pktSize[slave_port_id][master_port_id] += pkt_size;
274 transDist[pkt_cmd]++;
275 }
276
277 // @todo: Not setting first-word time
278 pkt->payloadDelay = response_latency;
279 return response_latency;
280}
281
282void
283NoncoherentXBar::recvFunctional(PacketPtr pkt, PortID slave_port_id)
284{
285 if (!pkt->isPrint()) {
286 // don't do DPRINTFs on PrintReq as it clutters up the output
287 DPRINTF(NoncoherentXBar,
288 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
289 slavePorts[slave_port_id]->name(), pkt->getAddr(),
290 pkt->cmdString());
291 }
292
293 // since our slave ports are queued ports we need to check them as well
294 for (const auto& p : slavePorts) {
295 // if we find a response that has the data, then the
296 // downstream caches/memories may be out of date, so simply stop
297 // here
298 if (p->checkFunctional(pkt)) {
299 if (pkt->needsResponse())
300 pkt->makeResponse();
301 return;
302 }
303 }
304
305 // determine the destination port
259
260 // stats updates for the request
261 pktCount[slave_port_id][master_port_id]++;
262 pktSize[slave_port_id][master_port_id] += pkt_size;
263 transDist[pkt_cmd]++;
264
265 // forward the request to the appropriate destination
266 Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
267
268 // add the response data
269 if (pkt->isResponse()) {
270 pkt_size = pkt->hasData() ? pkt->getSize() : 0;
271 pkt_cmd = pkt->cmdToIndex();
272
273 // stats updates
274 pktCount[slave_port_id][master_port_id]++;
275 pktSize[slave_port_id][master_port_id] += pkt_size;
276 transDist[pkt_cmd]++;
277 }
278
279 // @todo: Not setting first-word time
280 pkt->payloadDelay = response_latency;
281 return response_latency;
282}
283
284void
285NoncoherentXBar::recvFunctional(PacketPtr pkt, PortID slave_port_id)
286{
287 if (!pkt->isPrint()) {
288 // don't do DPRINTFs on PrintReq as it clutters up the output
289 DPRINTF(NoncoherentXBar,
290 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
291 slavePorts[slave_port_id]->name(), pkt->getAddr(),
292 pkt->cmdString());
293 }
294
295 // since our slave ports are queued ports we need to check them as well
296 for (const auto& p : slavePorts) {
297 // if we find a response that has the data, then the
298 // downstream caches/memories may be out of date, so simply stop
299 // here
300 if (p->checkFunctional(pkt)) {
301 if (pkt->needsResponse())
302 pkt->makeResponse();
303 return;
304 }
305 }
306
307 // determine the destination port
306 PortID dest_id = findPort(pkt->getAddr());
308 AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
309 PortID dest_id = findPort(addr_range);
307
308 // forward the request to the appropriate destination
309 masterPorts[dest_id]->sendFunctional(pkt);
310}
311
312NoncoherentXBar*
313NoncoherentXBarParams::create()
314{
315 return new NoncoherentXBar(this);
316}
317
318void
319NoncoherentXBar::regStats()
320{
321 // register the stats of the base class and our layers
322 BaseXBar::regStats();
323 for (auto l: reqLayers)
324 l->regStats();
325 for (auto l: respLayers)
326 l->regStats();
327}
310
311 // forward the request to the appropriate destination
312 masterPorts[dest_id]->sendFunctional(pkt);
313}
314
315NoncoherentXBar*
316NoncoherentXBarParams::create()
317{
318 return new NoncoherentXBar(this);
319}
320
321void
322NoncoherentXBar::regStats()
323{
324 // register the stats of the base class and our layers
325 BaseXBar::regStats();
326 for (auto l: reqLayers)
327 l->regStats();
328 for (auto l: respLayers)
329 l->regStats();
330}