Deleted Added
sdiff udiff text old ( 10713:eddb533708cb ) new ( 10719:b4fc9ad648aa )
full compact
1/*
2 * Copyright (c) 2011-2014 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

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

50#include "base/misc.hh"
51#include "base/trace.hh"
52#include "debug/AddrRanges.hh"
53#include "debug/CoherentXBar.hh"
54#include "mem/coherent_xbar.hh"
55#include "sim/system.hh"
56
57CoherentXBar::CoherentXBar(const CoherentXBarParams *p)
58 : BaseXBar(p), system(p->system), snoopFilter(p->snoop_filter)
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 CoherentXBarMasterPort(portName, *this, i);
66 masterPorts.push_back(bp);

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

162 src_port->name(), pkt->cmdString(), is_express_snoop,
163 pkt->getAddr());
164
165 // store size and command as they might be modified when
166 // forwarding the packet
167 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
168 unsigned int pkt_cmd = pkt->cmdToIndex();
169
170 calcPacketTiming(pkt);
171 Tick packetFinishTime = curTick() + pkt->payloadDelay;
172
173 // uncacheable requests need never be snooped
174 if (!pkt->req->isUncacheable() && !system->bypassCaches()) {
175 // the packet is a memory-mapped request and should be
176 // broadcasted to our snoopers but the source
177 if (snoopFilter) {
178 // check with the snoop filter where to forward this packet
179 auto sf_res = snoopFilter->lookupRequest(pkt, *src_port);
180 packetFinishTime += sf_res.second * clockPeriod();
181 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x"\
182 " SF size: %i lat: %i\n", src_port->name(),
183 pkt->cmdString(), pkt->getAddr(), sf_res.first.size(),
184 sf_res.second);
185 forwardTiming(pkt, slave_port_id, sf_res.first);
186 } else {
187 forwardTiming(pkt, slave_port_id);

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

216
217 // check if we were successful in sending the packet onwards
218 if (!success) {
219 // express snoops and inhibited packets should never be forced
220 // to retry
221 assert(!is_express_snoop);
222 assert(!pkt->memInhibitAsserted());
223
224 // undo the calculation so we can check for 0 again
225 pkt->headerDelay = pkt->payloadDelay = 0;
226
227 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n",
228 src_port->name(), pkt->cmdString(), pkt->getAddr());
229
230 // update the layer state and schedule an idle event
231 reqLayers[master_port_id]->failedTiming(src_port,
232 clockEdge(headerCycles));
233 } else {
234 // express snoops currently bypass the crossbar state entirely
235 if (!is_express_snoop) {
236 // if this particular request will generate a snoop
237 // response
238 if (expect_snoop_resp) {
239 // we should never have an exsiting request outstanding
240 assert(outstandingSnoop.find(pkt->req) ==

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

295 DPRINTF(CoherentXBar, "recvTimingResp: src %s %s 0x%x\n",
296 src_port->name(), pkt->cmdString(), pkt->getAddr());
297
298 // store size and command as they might be modified when
299 // forwarding the packet
300 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
301 unsigned int pkt_cmd = pkt->cmdToIndex();
302
303 calcPacketTiming(pkt);
304 Tick packetFinishTime = curTick() + pkt->payloadDelay;
305
306 if (snoopFilter && !pkt->req->isUncacheable() && !system->bypassCaches()) {
307 // let the snoop filter inspect the response and update its state
308 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]);
309 }
310
311 // send the packet through the destination slave port
312 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);
313

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

421 // store size and command as they might be modified when
422 // forwarding the packet
423 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
424 unsigned int pkt_cmd = pkt->cmdToIndex();
425
426 // responses are never express snoops
427 assert(!pkt->isExpressSnoop());
428
429 calcPacketTiming(pkt);
430 Tick packetFinishTime = curTick() + pkt->payloadDelay;
431
432 // forward it either as a snoop response or a normal response
433 if (forwardAsSnoop) {
434 // this is a snoop response to a snoop request we forwarded,
435 // e.g. coming from the L1 and going to the L2, and it should
436 // be forwarded as a snoop response
437
438 if (snoopFilter) {
439 // update the probe filter so that it can properly track the line

--- 393 unchanged lines hidden ---