coherent_xbar.cc (11199:929fd978ab4e) | coherent_xbar.cc (11284:b3926db25371) |
---|---|
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 --- 131 unchanged lines hidden (view full) --- 140bool 141CoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id) 142{ 143 // determine the source port based on the id 144 SlavePort *src_port = slavePorts[slave_port_id]; 145 146 // remember if the packet is an express snoop 147 bool is_express_snoop = pkt->isExpressSnoop(); | 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 --- 131 unchanged lines hidden (view full) --- 140bool 141CoherentXBar::recvTimingReq(PacketPtr pkt, PortID slave_port_id) 142{ 143 // determine the source port based on the id 144 SlavePort *src_port = slavePorts[slave_port_id]; 145 146 // remember if the packet is an express snoop 147 bool is_express_snoop = pkt->isExpressSnoop(); |
148 bool is_inhibited = pkt->memInhibitAsserted(); | 148 bool cache_responding = pkt->cacheResponding(); |
149 // for normal requests, going downstream, the express snoop flag | 149 // for normal requests, going downstream, the express snoop flag |
150 // and the inhibited flag should always be the same 151 assert(is_express_snoop == is_inhibited); | 150 // and the cache responding flag should always be the same 151 assert(is_express_snoop == cache_responding); |
152 153 // determine the destination based on the address 154 PortID master_port_id = findPort(pkt->getAddr()); 155 156 // test if the crossbar should be considered occupied for the current 157 // port, and exclude express snoops from the check 158 if (!is_express_snoop && !reqLayers[master_port_id]->tryTiming(src_port)) { 159 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x BUSY\n", --- 71 unchanged lines hidden (view full) --- 231 reqLayers[master_port_id]->succeededTiming(packetFinishTime); 232 233 // queue the packet for deletion 234 pendingDelete.reset(pkt); 235 236 return true; 237 } 238 | 152 153 // determine the destination based on the address 154 PortID master_port_id = findPort(pkt->getAddr()); 155 156 // test if the crossbar should be considered occupied for the current 157 // port, and exclude express snoops from the check 158 if (!is_express_snoop && !reqLayers[master_port_id]->tryTiming(src_port)) { 159 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x BUSY\n", --- 71 unchanged lines hidden (view full) --- 231 reqLayers[master_port_id]->succeededTiming(packetFinishTime); 232 233 // queue the packet for deletion 234 pendingDelete.reset(pkt); 235 236 return true; 237 } 238 |
239 // remember if the packet will generate a snoop response 240 const bool expect_snoop_resp = !is_inhibited && pkt->memInhibitAsserted(); | 239 // remember if the packet will generate a snoop response by 240 // checking if a cache set the cacheResponding flag during the 241 // snooping above 242 const bool expect_snoop_resp = !cache_responding && pkt->cacheResponding(); |
241 const bool expect_response = pkt->needsResponse() && | 243 const bool expect_response = pkt->needsResponse() && |
242 !pkt->memInhibitAsserted(); | 244 !pkt->cacheResponding(); |
243 244 // since it is a normal request, attempt to send the packet 245 bool success = masterPorts[master_port_id]->sendTimingReq(pkt); 246 247 if (snoopFilter && !system->bypassCaches()) { 248 // Let the snoop filter know about the success of the send operation 249 snoopFilter->finishRequest(!success, pkt); 250 } 251 252 // check if we were successful in sending the packet onwards 253 if (!success) { | 245 246 // since it is a normal request, attempt to send the packet 247 bool success = masterPorts[master_port_id]->sendTimingReq(pkt); 248 249 if (snoopFilter && !system->bypassCaches()) { 250 // Let the snoop filter know about the success of the send operation 251 snoopFilter->finishRequest(!success, pkt); 252 } 253 254 // check if we were successful in sending the packet onwards 255 if (!success) { |
254 // express snoops and inhibited packets should never be forced 255 // to retry | 256 // express snoops should never be forced to retry |
256 assert(!is_express_snoop); | 257 assert(!is_express_snoop); |
257 assert(!pkt->memInhibitAsserted()); | |
258 259 // restore the header delay 260 pkt->headerDelay = old_header_delay; 261 262 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n", 263 src_port->name(), pkt->cmdString(), pkt->getAddr()); 264 265 // update the layer state and schedule an idle event --- 115 unchanged lines hidden (view full) --- 381 382 // we should only see express snoops from caches 383 assert(pkt->isExpressSnoop()); 384 385 // set the packet header and payload delay, for now use forward latency 386 // @todo Assess the choice of latency further 387 calcPacketTiming(pkt, forwardLatency * clockPeriod()); 388 | 258 259 // restore the header delay 260 pkt->headerDelay = old_header_delay; 261 262 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n", 263 src_port->name(), pkt->cmdString(), pkt->getAddr()); 264 265 // update the layer state and schedule an idle event --- 115 unchanged lines hidden (view full) --- 381 382 // we should only see express snoops from caches 383 assert(pkt->isExpressSnoop()); 384 385 // set the packet header and payload delay, for now use forward latency 386 // @todo Assess the choice of latency further 387 calcPacketTiming(pkt, forwardLatency * clockPeriod()); 388 |
389 // remeber if the packet is inhibited so we can see if it changes 390 const bool is_inhibited = pkt->memInhibitAsserted(); | 389 // remember if a cache has already committed to responding so we 390 // can see if it changes during the snooping 391 const bool cache_responding = pkt->cacheResponding(); |
391 392 assert(pkt->snoopDelay == 0); 393 394 if (snoopFilter) { 395 // let the Snoop Filter work its magic and guide probing 396 auto sf_res = snoopFilter->lookupSnoop(pkt); 397 // the time required by a packet to be delivered through 398 // the xbar has to be charged also with to lookup latency --- 10 unchanged lines hidden (view full) --- 409 forwardTiming(pkt, InvalidPortID); 410 } 411 412 // add the snoop delay to our header delay, and then reset it 413 pkt->headerDelay += pkt->snoopDelay; 414 pkt->snoopDelay = 0; 415 416 // if we can expect a response, remember how to route it | 392 393 assert(pkt->snoopDelay == 0); 394 395 if (snoopFilter) { 396 // let the Snoop Filter work its magic and guide probing 397 auto sf_res = snoopFilter->lookupSnoop(pkt); 398 // the time required by a packet to be delivered through 399 // the xbar has to be charged also with to lookup latency --- 10 unchanged lines hidden (view full) --- 410 forwardTiming(pkt, InvalidPortID); 411 } 412 413 // add the snoop delay to our header delay, and then reset it 414 pkt->headerDelay += pkt->snoopDelay; 415 pkt->snoopDelay = 0; 416 417 // if we can expect a response, remember how to route it |
417 if (!is_inhibited && pkt->memInhibitAsserted()) { | 418 if (!cache_responding && pkt->cacheResponding()) { |
418 assert(routeTo.find(pkt->req) == routeTo.end()); 419 routeTo[pkt->req] = master_port_id; 420 } 421 422 // a snoop request came from a connected slave device (one of 423 // our master ports), and if it is not coming from the slave 424 // device responsible for the address range something is 425 // wrong, hence there is nothing further to do as the packet --- 329 unchanged lines hidden (view full) --- 755 // in contrast to a functional access, we have to keep on 756 // going as all snoopers must be updated even if we get a 757 // response 758 if (!pkt->isResponse()) 759 continue; 760 761 // response from snoop agent 762 assert(pkt->cmd != orig_cmd); | 419 assert(routeTo.find(pkt->req) == routeTo.end()); 420 routeTo[pkt->req] = master_port_id; 421 } 422 423 // a snoop request came from a connected slave device (one of 424 // our master ports), and if it is not coming from the slave 425 // device responsible for the address range something is 426 // wrong, hence there is nothing further to do as the packet --- 329 unchanged lines hidden (view full) --- 756 // in contrast to a functional access, we have to keep on 757 // going as all snoopers must be updated even if we get a 758 // response 759 if (!pkt->isResponse()) 760 continue; 761 762 // response from snoop agent 763 assert(pkt->cmd != orig_cmd); |
763 assert(pkt->memInhibitAsserted()); | 764 assert(pkt->cacheResponding()); |
764 // should only happen once 765 assert(snoop_response_cmd == MemCmd::InvalidCmd); 766 // save response state 767 snoop_response_cmd = pkt->cmd; 768 snoop_response_latency = latency; 769 770 if (snoopFilter) { 771 // Handle responses by the snoopers and differentiate between --- 136 unchanged lines hidden --- | 765 // should only happen once 766 assert(snoop_response_cmd == MemCmd::InvalidCmd); 767 // save response state 768 snoop_response_cmd = pkt->cmd; 769 snoop_response_latency = latency; 770 771 if (snoopFilter) { 772 // Handle responses by the snoopers and differentiate between --- 136 unchanged lines hidden --- |