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 --- 75 unchanged lines hidden (view full) --- 84 snoopLayers.push_back(new SnoopRespLayer(*bp, *this, 85 csprintf(".snoopLayer%d", 86 defaultPortID))); 87 } 88 89 // create the slave ports, once again starting at zero 90 for (int i = 0; i < p->port_slave_connection_count; ++i) { 91 std::string portName = csprintf("%s.slave[%d]", name(), i); |
92 QueuedSlavePort* bp = new CoherentXBarSlavePort(portName, *this, i); |
93 slavePorts.push_back(bp); 94 respLayers.push_back(new RespLayer(*bp, *this, 95 csprintf(".respLayer%d", i))); 96 snoopRespPorts.push_back(new SnoopRespPort(*bp, *this)); 97 } 98 99 if (snoopFilter) 100 snoopFilter->setSlavePorts(slavePorts); --- 239 unchanged lines hidden (view full) --- 340 // determine how long to be crossbar layer is busy 341 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay; 342 343 if (snoopFilter && !system->bypassCaches()) { 344 // let the snoop filter inspect the response and update its state 345 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]); 346 } 347 |
348 // send the packet through the destination slave port and pay for 349 // any outstanding header delay 350 Tick latency = pkt->headerDelay; 351 pkt->headerDelay = 0; 352 slavePorts[slave_port_id]->schedTimingResp(pkt, curTick() + latency); |
353 |
354 // remove the request from the routing table 355 routeTo.erase(route_lookup); 356 357 respLayers[slave_port_id]->succeededTiming(packetFinishTime); 358 359 // stats updates 360 pktCount[slave_port_id][master_port_id]++; 361 pktSize[slave_port_id][master_port_id] += pkt_size; --- 149 unchanged lines hidden (view full) --- 511 *slavePorts[dest_port_id]); 512 } 513 514 DPRINTF(CoherentXBar, "recvTimingSnoopResp: src %s %s 0x%x"\ 515 " FWD RESP\n", src_port->name(), pkt->cmdString(), 516 pkt->getAddr()); 517 518 // as a normal response, it should go back to a master through |
519 // one of our slave ports, we also pay for any outstanding 520 // header latency 521 Tick latency = pkt->headerDelay; 522 pkt->headerDelay = 0; 523 slavePorts[dest_port_id]->schedTimingResp(pkt, curTick() + latency); |
524 |
525 respLayers[dest_port_id]->succeededTiming(packetFinishTime); 526 } 527 528 // remove the request from the routing table 529 routeTo.erase(route_lookup); 530 531 // stats updates 532 transDist[pkt_cmd]++; 533 snoops++; 534 535 return true; 536} 537 538 539void 540CoherentXBar::forwardTiming(PacketPtr pkt, PortID exclude_slave_port_id, |
541 const std::vector<QueuedSlavePort*>& dests) |
542{ 543 DPRINTF(CoherentXBar, "%s for %s address %x size %d\n", __func__, 544 pkt->cmdString(), pkt->getAddr(), pkt->getSize()); 545 546 // snoops should only happen if the system isn't bypassing caches 547 assert(!system->bypassCaches()); 548 549 unsigned fanout = 0; --- 137 unchanged lines hidden (view full) --- 687 // @todo: Not setting header time 688 pkt->payloadDelay = snoop_response_latency; 689 return snoop_response_latency; 690} 691 692std::pair<MemCmd, Tick> 693CoherentXBar::forwardAtomic(PacketPtr pkt, PortID exclude_slave_port_id, 694 PortID source_master_port_id, |
695 const std::vector<QueuedSlavePort*>& dests) |
696{ 697 // the packet may be changed on snoops, record the original 698 // command to enable us to restore it between snoops so that 699 // additional snoops can take place properly 700 MemCmd orig_cmd = pkt->cmd; 701 MemCmd snoop_response_cmd = MemCmd::InvalidCmd; 702 Tick snoop_response_latency = 0; 703 --- 70 unchanged lines hidden (view full) --- 774 if (!system->bypassCaches()) { 775 // forward to all snoopers but the source 776 forwardFunctional(pkt, slave_port_id); 777 } 778 779 // there is no need to continue if the snooping has found what we 780 // were looking for and the packet is already a response 781 if (!pkt->isResponse()) { |
782 // since our slave ports are queued ports we need to check them as well 783 for (const auto& p : slavePorts) { 784 // if we find a response that has the data, then the 785 // downstream caches/memories may be out of date, so simply stop 786 // here 787 if (p->checkFunctional(pkt)) { 788 if (pkt->needsResponse()) 789 pkt->makeResponse(); 790 return; 791 } 792 } 793 |
794 PortID dest_id = findPort(pkt->getAddr()); 795 796 masterPorts[dest_id]->sendFunctional(pkt); 797 } 798} 799 800void 801CoherentXBar::recvFunctionalSnoop(PacketPtr pkt, PortID master_port_id) --- 78 unchanged lines hidden --- |