coherent_xbar.cc (11605:65ae342b627b) | coherent_xbar.cc (11744:5d33c6972dda) |
---|---|
1/* 2 * Copyright (c) 2011-2016 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 --- 142 unchanged lines hidden (view full) --- 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)) { | 1/* 2 * Copyright (c) 2011-2016 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 --- 142 unchanged lines hidden (view full) --- 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", 160 src_port->name(), pkt->cmdString(), pkt->getAddr()); | 159 DPRINTF(CoherentXBar, "%s: src %s packet %s BUSY\n", __func__, 160 src_port->name(), pkt->print()); |
161 return false; 162 } 163 | 161 return false; 162 } 163 |
164 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s expr %d 0x%x\n", 165 src_port->name(), pkt->cmdString(), is_express_snoop, 166 pkt->getAddr()); | 164 DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__, 165 src_port->name(), pkt->print()); |
167 168 // store size and command as they might be modified when 169 // forwarding the packet 170 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 171 unsigned int pkt_cmd = pkt->cmdToIndex(); 172 173 // store the old header delay so we can restore it if needed 174 Tick old_header_delay = pkt->headerDelay; --- 14 unchanged lines hidden (view full) --- 189 // broadcasted to our snoopers but the source 190 if (snoopFilter) { 191 // check with the snoop filter where to forward this packet 192 auto sf_res = snoopFilter->lookupRequest(pkt, *src_port); 193 // the time required by a packet to be delivered through 194 // the xbar has to be charged also with to lookup latency 195 // of the snoop filter 196 pkt->headerDelay += sf_res.second * clockPeriod(); | 166 167 // store size and command as they might be modified when 168 // forwarding the packet 169 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 170 unsigned int pkt_cmd = pkt->cmdToIndex(); 171 172 // store the old header delay so we can restore it if needed 173 Tick old_header_delay = pkt->headerDelay; --- 14 unchanged lines hidden (view full) --- 188 // broadcasted to our snoopers but the source 189 if (snoopFilter) { 190 // check with the snoop filter where to forward this packet 191 auto sf_res = snoopFilter->lookupRequest(pkt, *src_port); 192 // the time required by a packet to be delivered through 193 // the xbar has to be charged also with to lookup latency 194 // of the snoop filter 195 pkt->headerDelay += sf_res.second * clockPeriod(); |
197 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x"\ 198 " SF size: %i lat: %i\n", src_port->name(), 199 pkt->cmdString(), pkt->getAddr(), sf_res.first.size(), 200 sf_res.second); | 196 DPRINTF(CoherentXBar, "%s: src %s packet %s SF size: %i lat: %i\n", 197 __func__, src_port->name(), pkt->print(), 198 sf_res.first.size(), sf_res.second); |
201 202 if (pkt->isEviction()) { 203 // for block-evicting packets, i.e. writebacks and 204 // clean evictions, there is no need to snoop up, as 205 // all we do is determine if the block is cached or 206 // not, instead just set it here based on the snoop 207 // filter result 208 if (!sf_res.first.empty()) --- 22 unchanged lines hidden (view full) --- 231 const bool sink_packet = sinkPacket(pkt); 232 233 // in certain cases the crossbar is responsible for responding 234 bool respond_directly = false; 235 // store the original address as an address mapper could possibly 236 // modify the address upon a sendTimingRequest 237 const Addr addr(pkt->getAddr()); 238 if (sink_packet) { | 199 200 if (pkt->isEviction()) { 201 // for block-evicting packets, i.e. writebacks and 202 // clean evictions, there is no need to snoop up, as 203 // all we do is determine if the block is cached or 204 // not, instead just set it here based on the snoop 205 // filter result 206 if (!sf_res.first.empty()) --- 22 unchanged lines hidden (view full) --- 229 const bool sink_packet = sinkPacket(pkt); 230 231 // in certain cases the crossbar is responsible for responding 232 bool respond_directly = false; 233 // store the original address as an address mapper could possibly 234 // modify the address upon a sendTimingRequest 235 const Addr addr(pkt->getAddr()); 236 if (sink_packet) { |
239 DPRINTF(CoherentXBar, "Not forwarding %s to %#llx\n", 240 pkt->cmdString(), pkt->getAddr()); | 237 DPRINTF(CoherentXBar, "%s: Not forwarding %s\n", __func__, 238 pkt->print()); |
241 } else { 242 // determine if we are forwarding the packet, or responding to 243 // it 244 if (!pointOfCoherency || pkt->isRead() || pkt->isWrite()) { 245 // if we are passing on, rather than sinking, a packet to 246 // which an upstream cache has committed to responding, 247 // the line was needs writable, and the responding only 248 // had an Owned copy, so we need to immidiately let the --- 23 unchanged lines hidden (view full) --- 272 // check if we were successful in sending the packet onwards 273 if (!success) { 274 // express snoops should never be forced to retry 275 assert(!is_express_snoop); 276 277 // restore the header delay 278 pkt->headerDelay = old_header_delay; 279 | 239 } else { 240 // determine if we are forwarding the packet, or responding to 241 // it 242 if (!pointOfCoherency || pkt->isRead() || pkt->isWrite()) { 243 // if we are passing on, rather than sinking, a packet to 244 // which an upstream cache has committed to responding, 245 // the line was needs writable, and the responding only 246 // had an Owned copy, so we need to immidiately let the --- 23 unchanged lines hidden (view full) --- 270 // check if we were successful in sending the packet onwards 271 if (!success) { 272 // express snoops should never be forced to retry 273 assert(!is_express_snoop); 274 275 // restore the header delay 276 pkt->headerDelay = old_header_delay; 277 |
280 DPRINTF(CoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n", 281 src_port->name(), pkt->cmdString(), pkt->getAddr()); | 278 DPRINTF(CoherentXBar, "%s: src %s packet %s RETRY\n", __func__, 279 src_port->name(), pkt->print()); |
282 283 // update the layer state and schedule an idle event 284 reqLayers[master_port_id]->failedTiming(src_port, 285 clockEdge(Cycles(1))); 286 } else { 287 // express snoops currently bypass the crossbar state entirely 288 if (!is_express_snoop) { 289 // if this particular request will generate a snoop --- 68 unchanged lines hidden (view full) --- 358 assert(route_lookup != routeTo.end()); 359 const PortID slave_port_id = route_lookup->second; 360 assert(slave_port_id != InvalidPortID); 361 assert(slave_port_id < respLayers.size()); 362 363 // test if the crossbar should be considered occupied for the 364 // current port 365 if (!respLayers[slave_port_id]->tryTiming(src_port)) { | 280 281 // update the layer state and schedule an idle event 282 reqLayers[master_port_id]->failedTiming(src_port, 283 clockEdge(Cycles(1))); 284 } else { 285 // express snoops currently bypass the crossbar state entirely 286 if (!is_express_snoop) { 287 // if this particular request will generate a snoop --- 68 unchanged lines hidden (view full) --- 356 assert(route_lookup != routeTo.end()); 357 const PortID slave_port_id = route_lookup->second; 358 assert(slave_port_id != InvalidPortID); 359 assert(slave_port_id < respLayers.size()); 360 361 // test if the crossbar should be considered occupied for the 362 // current port 363 if (!respLayers[slave_port_id]->tryTiming(src_port)) { |
366 DPRINTF(CoherentXBar, "recvTimingResp: src %s %s 0x%x BUSY\n", 367 src_port->name(), pkt->cmdString(), pkt->getAddr()); | 364 DPRINTF(CoherentXBar, "%s: src %s packet %s BUSY\n", __func__, 365 src_port->name(), pkt->print()); |
368 return false; 369 } 370 | 366 return false; 367 } 368 |
371 DPRINTF(CoherentXBar, "recvTimingResp: src %s %s 0x%x\n", 372 src_port->name(), pkt->cmdString(), pkt->getAddr()); | 369 DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__, 370 src_port->name(), pkt->print()); |
373 374 // store size and command as they might be modified when 375 // forwarding the packet 376 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 377 unsigned int pkt_cmd = pkt->cmdToIndex(); 378 379 // a response sees the response latency 380 Tick xbar_delay = responseLatency * clockPeriod(); --- 26 unchanged lines hidden (view full) --- 407 transDist[pkt_cmd]++; 408 409 return true; 410} 411 412void 413CoherentXBar::recvTimingSnoopReq(PacketPtr pkt, PortID master_port_id) 414{ | 371 372 // store size and command as they might be modified when 373 // forwarding the packet 374 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 375 unsigned int pkt_cmd = pkt->cmdToIndex(); 376 377 // a response sees the response latency 378 Tick xbar_delay = responseLatency * clockPeriod(); --- 26 unchanged lines hidden (view full) --- 405 transDist[pkt_cmd]++; 406 407 return true; 408} 409 410void 411CoherentXBar::recvTimingSnoopReq(PacketPtr pkt, PortID master_port_id) 412{ |
415 DPRINTF(CoherentXBar, "recvTimingSnoopReq: src %s %s 0x%x\n", 416 masterPorts[master_port_id]->name(), pkt->cmdString(), 417 pkt->getAddr()); | 413 DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__, 414 masterPorts[master_port_id]->name(), pkt->print()); |
418 419 // update stats here as we know the forwarding will succeed 420 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 421 transDist[pkt->cmdToIndex()]++; 422 snoops++; 423 snoopTraffic += pkt_size; 424 425 // we should only see express snoops from caches --- 11 unchanged lines hidden (view full) --- 437 438 if (snoopFilter) { 439 // let the Snoop Filter work its magic and guide probing 440 auto sf_res = snoopFilter->lookupSnoop(pkt); 441 // the time required by a packet to be delivered through 442 // the xbar has to be charged also with to lookup latency 443 // of the snoop filter 444 pkt->headerDelay += sf_res.second * clockPeriod(); | 415 416 // update stats here as we know the forwarding will succeed 417 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 418 transDist[pkt->cmdToIndex()]++; 419 snoops++; 420 snoopTraffic += pkt_size; 421 422 // we should only see express snoops from caches --- 11 unchanged lines hidden (view full) --- 434 435 if (snoopFilter) { 436 // let the Snoop Filter work its magic and guide probing 437 auto sf_res = snoopFilter->lookupSnoop(pkt); 438 // the time required by a packet to be delivered through 439 // the xbar has to be charged also with to lookup latency 440 // of the snoop filter 441 pkt->headerDelay += sf_res.second * clockPeriod(); |
445 DPRINTF(CoherentXBar, "recvTimingSnoopReq: src %s %s 0x%x"\ 446 " SF size: %i lat: %i\n", masterPorts[master_port_id]->name(), 447 pkt->cmdString(), pkt->getAddr(), sf_res.first.size(), 448 sf_res.second); | 442 DPRINTF(CoherentXBar, "%s: src %s packet %s SF size: %i lat: %i\n", 443 __func__, masterPorts[master_port_id]->name(), pkt->print(), 444 sf_res.first.size(), sf_res.second); |
449 450 // forward to all snoopers 451 forwardTiming(pkt, InvalidPortID, sf_res.first); 452 } else { 453 forwardTiming(pkt, InvalidPortID); 454 } 455 456 // add the snoop delay to our header delay, and then reset it --- 35 unchanged lines hidden (view full) --- 492 493 // test if the crossbar should be considered occupied for the 494 // current port, note that the check is bypassed if the response 495 // is being passed on as a normal response since this is occupying 496 // the response layer rather than the snoop response layer 497 if (forwardAsSnoop) { 498 assert(dest_port_id < snoopLayers.size()); 499 if (!snoopLayers[dest_port_id]->tryTiming(src_port)) { | 445 446 // forward to all snoopers 447 forwardTiming(pkt, InvalidPortID, sf_res.first); 448 } else { 449 forwardTiming(pkt, InvalidPortID); 450 } 451 452 // add the snoop delay to our header delay, and then reset it --- 35 unchanged lines hidden (view full) --- 488 489 // test if the crossbar should be considered occupied for the 490 // current port, note that the check is bypassed if the response 491 // is being passed on as a normal response since this is occupying 492 // the response layer rather than the snoop response layer 493 if (forwardAsSnoop) { 494 assert(dest_port_id < snoopLayers.size()); 495 if (!snoopLayers[dest_port_id]->tryTiming(src_port)) { |
500 DPRINTF(CoherentXBar, "recvTimingSnoopResp: src %s %s 0x%x BUSY\n", 501 src_port->name(), pkt->cmdString(), pkt->getAddr()); | 496 DPRINTF(CoherentXBar, "%s: src %s packet %s BUSY\n", __func__, 497 src_port->name(), pkt->print()); |
502 return false; 503 } 504 } else { 505 // get the master port that mirrors this slave port internally 506 MasterPort* snoop_port = snoopRespPorts[slave_port_id]; 507 assert(dest_port_id < respLayers.size()); 508 if (!respLayers[dest_port_id]->tryTiming(snoop_port)) { | 498 return false; 499 } 500 } else { 501 // get the master port that mirrors this slave port internally 502 MasterPort* snoop_port = snoopRespPorts[slave_port_id]; 503 assert(dest_port_id < respLayers.size()); 504 if (!respLayers[dest_port_id]->tryTiming(snoop_port)) { |
509 DPRINTF(CoherentXBar, "recvTimingSnoopResp: src %s %s 0x%x BUSY\n", 510 snoop_port->name(), pkt->cmdString(), pkt->getAddr()); | 505 DPRINTF(CoherentXBar, "%s: src %s packet %s BUSY\n", __func__, 506 snoop_port->name(), pkt->print()); |
511 return false; 512 } 513 } 514 | 507 return false; 508 } 509 } 510 |
515 DPRINTF(CoherentXBar, "recvTimingSnoopResp: src %s %s 0x%x\n", 516 src_port->name(), pkt->cmdString(), pkt->getAddr()); | 511 DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__, 512 src_port->name(), pkt->print()); |
517 518 // store size and command as they might be modified when 519 // forwarding the packet 520 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 521 unsigned int pkt_cmd = pkt->cmdToIndex(); 522 523 // responses are never express snoops 524 assert(!pkt->isExpressSnoop()); --- 42 unchanged lines hidden (view full) --- 567 assert(slave_port_id != dest_port_id); 568 569 if (snoopFilter) { 570 // update the probe filter so that it can properly track the line 571 snoopFilter->updateSnoopResponse(pkt, *slavePorts[slave_port_id], 572 *slavePorts[dest_port_id]); 573 } 574 | 513 514 // store size and command as they might be modified when 515 // forwarding the packet 516 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 517 unsigned int pkt_cmd = pkt->cmdToIndex(); 518 519 // responses are never express snoops 520 assert(!pkt->isExpressSnoop()); --- 42 unchanged lines hidden (view full) --- 563 assert(slave_port_id != dest_port_id); 564 565 if (snoopFilter) { 566 // update the probe filter so that it can properly track the line 567 snoopFilter->updateSnoopResponse(pkt, *slavePorts[slave_port_id], 568 *slavePorts[dest_port_id]); 569 } 570 |
575 DPRINTF(CoherentXBar, "recvTimingSnoopResp: src %s %s 0x%x"\ 576 " FWD RESP\n", src_port->name(), pkt->cmdString(), 577 pkt->getAddr()); | 571 DPRINTF(CoherentXBar, "%s: src %s packet %s FWD RESP\n", __func__, 572 src_port->name(), pkt->print()); |
578 579 // as a normal response, it should go back to a master through 580 // one of our slave ports, we also pay for any outstanding 581 // header latency 582 Tick latency = pkt->headerDelay; 583 pkt->headerDelay = 0; 584 slavePorts[dest_port_id]->schedTimingResp(pkt, curTick() + latency); 585 --- 11 unchanged lines hidden (view full) --- 597 return true; 598} 599 600 601void 602CoherentXBar::forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id, 603 const std::vector<QueuedSlavePort*>& dests) 604{ | 573 574 // as a normal response, it should go back to a master through 575 // one of our slave ports, we also pay for any outstanding 576 // header latency 577 Tick latency = pkt->headerDelay; 578 pkt->headerDelay = 0; 579 slavePorts[dest_port_id]->schedTimingResp(pkt, curTick() + latency); 580 --- 11 unchanged lines hidden (view full) --- 592 return true; 593} 594 595 596void 597CoherentXBar::forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id, 598 const std::vector<QueuedSlavePort*>& dests) 599{ |
605 DPRINTF(CoherentXBar, "%s for %s address %x size %d\n", __func__, 606 pkt->cmdString(), pkt->getAddr(), pkt->getSize()); | 600 DPRINTF(CoherentXBar, "%s for %s\n", __func__, pkt->print()); |
607 608 // snoops should only happen if the system isn't bypassing caches 609 assert(!system->bypassCaches()); 610 611 unsigned fanout = 0; 612 613 for (const auto& p: dests) { 614 // we could have gotten this request from a snooping master --- 19 unchanged lines hidden (view full) --- 634 // so the retry will always be coming from a port to which we 635 // tried to forward a request 636 reqLayers[master_port_id]->recvRetry(); 637} 638 639Tick 640CoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id) 641{ | 601 602 // snoops should only happen if the system isn't bypassing caches 603 assert(!system->bypassCaches()); 604 605 unsigned fanout = 0; 606 607 for (const auto& p: dests) { 608 // we could have gotten this request from a snooping master --- 19 unchanged lines hidden (view full) --- 628 // so the retry will always be coming from a port to which we 629 // tried to forward a request 630 reqLayers[master_port_id]->recvRetry(); 631} 632 633Tick 634CoherentXBar::recvAtomic(PacketPtr pkt, PortID slave_port_id) 635{ |
642 DPRINTF(CoherentXBar, "recvAtomic: packet src %s addr 0x%x cmd %s\n", 643 slavePorts[slave_port_id]->name(), pkt->getAddr(), 644 pkt->cmdString()); | 636 DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__, 637 slavePorts[slave_port_id]->name(), pkt->print()); |
645 646 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 647 unsigned int pkt_cmd = pkt->cmdToIndex(); 648 649 MemCmd snoop_response_cmd = MemCmd::InvalidCmd; 650 Tick snoop_response_latency = 0; 651 652 if (!system->bypassCaches()) { 653 // forward to all snoopers but the source 654 std::pair<MemCmd, Tick> snoop_result; 655 if (snoopFilter) { 656 // check with the snoop filter where to forward this packet 657 auto sf_res = 658 snoopFilter->lookupRequest(pkt, *slavePorts[slave_port_id]); 659 snoop_response_latency += sf_res.second * clockPeriod(); | 638 639 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 640 unsigned int pkt_cmd = pkt->cmdToIndex(); 641 642 MemCmd snoop_response_cmd = MemCmd::InvalidCmd; 643 Tick snoop_response_latency = 0; 644 645 if (!system->bypassCaches()) { 646 // forward to all snoopers but the source 647 std::pair<MemCmd, Tick> snoop_result; 648 if (snoopFilter) { 649 // check with the snoop filter where to forward this packet 650 auto sf_res = 651 snoopFilter->lookupRequest(pkt, *slavePorts[slave_port_id]); 652 snoop_response_latency += sf_res.second * clockPeriod(); |
660 DPRINTF(CoherentXBar, "%s: src %s %s 0x%x"\ 661 " SF size: %i lat: %i\n", __func__, 662 slavePorts[slave_port_id]->name(), pkt->cmdString(), 663 pkt->getAddr(), sf_res.first.size(), sf_res.second); | 653 DPRINTF(CoherentXBar, "%s: src %s packet %s SF size: %i lat: %i\n", 654 __func__, slavePorts[slave_port_id]->name(), pkt->print(), 655 sf_res.first.size(), sf_res.second); |
664 665 // let the snoop filter know about the success of the send 666 // operation, and do it even before sending it onwards to 667 // avoid situations where atomic upward snoops sneak in 668 // between and change the filter state 669 snoopFilter->finishRequest(false, pkt->getAddr(), pkt->isSecure()); 670 671 snoop_result = forwardAtomic(pkt, slave_port_id, InvalidPortID, --- 10 unchanged lines hidden (view full) --- 682 683 const bool sink_packet = sinkPacket(pkt); 684 685 // even if we had a snoop response, we must continue and also 686 // perform the actual request at the destination 687 PortID master_port_id = findPort(pkt->getAddr()); 688 689 if (sink_packet) { | 656 657 // let the snoop filter know about the success of the send 658 // operation, and do it even before sending it onwards to 659 // avoid situations where atomic upward snoops sneak in 660 // between and change the filter state 661 snoopFilter->finishRequest(false, pkt->getAddr(), pkt->isSecure()); 662 663 snoop_result = forwardAtomic(pkt, slave_port_id, InvalidPortID, --- 10 unchanged lines hidden (view full) --- 674 675 const bool sink_packet = sinkPacket(pkt); 676 677 // even if we had a snoop response, we must continue and also 678 // perform the actual request at the destination 679 PortID master_port_id = findPort(pkt->getAddr()); 680 681 if (sink_packet) { |
690 DPRINTF(CoherentXBar, "Not forwarding %s to %#llx\n", 691 pkt->cmdString(), pkt->getAddr()); | 682 DPRINTF(CoherentXBar, "%s: Not forwarding %s\n", __func__, 683 pkt->print()); |
692 } else { 693 if (!pointOfCoherency || pkt->isRead() || pkt->isWrite()) { 694 // forward the request to the appropriate destination 695 response_latency = masterPorts[master_port_id]->sendAtomic(pkt); 696 } else { 697 // if it does not need a response we sink the packet above 698 assert(pkt->needsResponse()); 699 --- 34 unchanged lines hidden (view full) --- 734 // @todo: Not setting header time 735 pkt->payloadDelay = response_latency; 736 return response_latency; 737} 738 739Tick 740CoherentXBar::recvAtomicSnoop(PacketPtr pkt, PortID master_port_id) 741{ | 684 } else { 685 if (!pointOfCoherency || pkt->isRead() || pkt->isWrite()) { 686 // forward the request to the appropriate destination 687 response_latency = masterPorts[master_port_id]->sendAtomic(pkt); 688 } else { 689 // if it does not need a response we sink the packet above 690 assert(pkt->needsResponse()); 691 --- 34 unchanged lines hidden (view full) --- 726 // @todo: Not setting header time 727 pkt->payloadDelay = response_latency; 728 return response_latency; 729} 730 731Tick 732CoherentXBar::recvAtomicSnoop(PacketPtr pkt, PortID master_port_id) 733{ |
742 DPRINTF(CoherentXBar, "recvAtomicSnoop: packet src %s addr 0x%x cmd %s\n", 743 masterPorts[master_port_id]->name(), pkt->getAddr(), 744 pkt->cmdString()); | 734 DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__, 735 masterPorts[master_port_id]->name(), pkt->print()); |
745 746 // add the request snoop data 747 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 748 snoops++; 749 snoopTraffic += pkt_size; 750 751 // forward to all snoopers 752 std::pair<MemCmd, Tick> snoop_result; 753 Tick snoop_response_latency = 0; 754 if (snoopFilter) { 755 auto sf_res = snoopFilter->lookupSnoop(pkt); 756 snoop_response_latency += sf_res.second * clockPeriod(); | 736 737 // add the request snoop data 738 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 739 snoops++; 740 snoopTraffic += pkt_size; 741 742 // forward to all snoopers 743 std::pair<MemCmd, Tick> snoop_result; 744 Tick snoop_response_latency = 0; 745 if (snoopFilter) { 746 auto sf_res = snoopFilter->lookupSnoop(pkt); 747 snoop_response_latency += sf_res.second * clockPeriod(); |
757 DPRINTF(CoherentXBar, "%s: src %s %s 0x%x SF size: %i lat: %i\n", 758 __func__, masterPorts[master_port_id]->name(), pkt->cmdString(), 759 pkt->getAddr(), sf_res.first.size(), sf_res.second); | 748 DPRINTF(CoherentXBar, "%s: src %s packet %s SF size: %i lat: %i\n", 749 __func__, masterPorts[master_port_id]->name(), pkt->print(), 750 sf_res.first.size(), sf_res.second); |
760 snoop_result = forwardAtomic(pkt, InvalidPortID, master_port_id, 761 sf_res.first); 762 } else { 763 snoop_result = forwardAtomic(pkt, InvalidPortID); 764 } 765 MemCmd snoop_response_cmd = snoop_result.first; 766 snoop_response_latency += snoop_result.second; 767 --- 81 unchanged lines hidden (view full) --- 849 return std::make_pair(snoop_response_cmd, snoop_response_latency); 850} 851 852void 853CoherentXBar::recvFunctional(PacketPtr pkt, PortID slave_port_id) 854{ 855 if (!pkt->isPrint()) { 856 // don't do DPRINTFs on PrintReq as it clutters up the output | 751 snoop_result = forwardAtomic(pkt, InvalidPortID, master_port_id, 752 sf_res.first); 753 } else { 754 snoop_result = forwardAtomic(pkt, InvalidPortID); 755 } 756 MemCmd snoop_response_cmd = snoop_result.first; 757 snoop_response_latency += snoop_result.second; 758 --- 81 unchanged lines hidden (view full) --- 840 return std::make_pair(snoop_response_cmd, snoop_response_latency); 841} 842 843void 844CoherentXBar::recvFunctional(PacketPtr pkt, PortID slave_port_id) 845{ 846 if (!pkt->isPrint()) { 847 // don't do DPRINTFs on PrintReq as it clutters up the output |
857 DPRINTF(CoherentXBar, 858 "recvFunctional: packet src %s addr 0x%x cmd %s\n", 859 slavePorts[slave_port_id]->name(), pkt->getAddr(), 860 pkt->cmdString()); | 848 DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__, 849 slavePorts[slave_port_id]->name(), pkt->print()); |
861 } 862 863 if (!system->bypassCaches()) { 864 // forward to all snoopers but the source 865 forwardFunctional(pkt, slave_port_id); 866 } 867 868 // there is no need to continue if the snooping has found what we --- 17 unchanged lines hidden (view full) --- 886 } 887} 888 889void 890CoherentXBar::recvFunctionalSnoop(PacketPtr pkt, PortID master_port_id) 891{ 892 if (!pkt->isPrint()) { 893 // don't do DPRINTFs on PrintReq as it clutters up the output | 850 } 851 852 if (!system->bypassCaches()) { 853 // forward to all snoopers but the source 854 forwardFunctional(pkt, slave_port_id); 855 } 856 857 // there is no need to continue if the snooping has found what we --- 17 unchanged lines hidden (view full) --- 875 } 876} 877 878void 879CoherentXBar::recvFunctionalSnoop(PacketPtr pkt, PortID master_port_id) 880{ 881 if (!pkt->isPrint()) { 882 // don't do DPRINTFs on PrintReq as it clutters up the output |
894 DPRINTF(CoherentXBar, 895 "recvFunctionalSnoop: packet src %s addr 0x%x cmd %s\n", 896 masterPorts[master_port_id]->name(), pkt->getAddr(), 897 pkt->cmdString()); | 883 DPRINTF(CoherentXBar, "%s: src %s packet %s\n", __func__, 884 masterPorts[master_port_id]->name(), pkt->print()); |
898 } 899 900 for (const auto& p : slavePorts) { 901 if (p->checkFunctional(pkt)) { 902 if (pkt->needsResponse()) 903 pkt->makeResponse(); 904 return; 905 } --- 86 unchanged lines hidden --- | 885 } 886 887 for (const auto& p : slavePorts) { 888 if (p->checkFunctional(pkt)) { 889 if (pkt->needsResponse()) 890 pkt->makeResponse(); 891 return; 892 } --- 86 unchanged lines hidden --- |