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 --- 166 unchanged lines hidden (view full) --- 175 Tick xbar_delay = (frontendLatency + forwardLatency) * clockPeriod(); 176 177 // set the packet header and payload delay 178 calcPacketTiming(pkt, xbar_delay); 179 180 // determine how long to be crossbar layer is busy 181 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay; 182 |
183 if (!system->bypassCaches()) { |
184 // the packet is a memory-mapped request and should be 185 // broadcasted to our snoopers but the source 186 if (snoopFilter) { 187 // check with the snoop filter where to forward this packet 188 auto sf_res = snoopFilter->lookupRequest(pkt, *src_port); 189 // If SnoopFilter is enabled, the total time required by a packet 190 // to be delivered through the xbar has to be charged also with 191 // to lookup latency of the snoop filter (sf_res.second). --- 15 unchanged lines hidden (view full) --- 207 !pkt->memInhibitAsserted(); 208 209 // Note: Cannot create a copy of the full packet, here. 210 MemCmd orig_cmd(pkt->cmd); 211 212 // since it is a normal request, attempt to send the packet 213 bool success = masterPorts[master_port_id]->sendTimingReq(pkt); 214 |
215 if (snoopFilter && !system->bypassCaches()) { |
216 // The packet may already be overwritten by the sendTimingReq function. 217 // The snoop filter needs to see the original request *and* the return 218 // status of the send operation, so we need to recreate the original 219 // request. Atomic mode does not have the issue, as there the send 220 // operation and the response happen instantaneously and don't need two 221 // phase tracking. 222 MemCmd tmp_cmd(pkt->cmd); 223 pkt->cmd = orig_cmd; --- 92 unchanged lines hidden (view full) --- 316 Tick xbar_delay = responseLatency * clockPeriod(); 317 318 // set the packet header and payload delay 319 calcPacketTiming(pkt, xbar_delay); 320 321 // determine how long to be crossbar layer is busy 322 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay; 323 |
324 if (snoopFilter && !system->bypassCaches()) { |
325 // let the snoop filter inspect the response and update its state 326 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]); 327 } 328 329 // send the packet through the destination slave port 330 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt); 331 332 // currently it is illegal to block responses... can lead to --- 238 unchanged lines hidden (view full) --- 571 pkt->cmdString()); 572 573 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 574 unsigned int pkt_cmd = pkt->cmdToIndex(); 575 576 MemCmd snoop_response_cmd = MemCmd::InvalidCmd; 577 Tick snoop_response_latency = 0; 578 |
579 if (!system->bypassCaches()) { |
580 // forward to all snoopers but the source 581 std::pair<MemCmd, Tick> snoop_result; 582 if (snoopFilter) { 583 // check with the snoop filter where to forward this packet 584 auto sf_res = 585 snoopFilter->lookupRequest(pkt, *slavePorts[slave_port_id]); 586 snoop_response_latency += sf_res.second * clockPeriod(); 587 DPRINTF(CoherentXBar, "%s: src %s %s 0x%x"\ --- 17 unchanged lines hidden (view full) --- 605 pktCount[slave_port_id][master_port_id]++; 606 pktSize[slave_port_id][master_port_id] += pkt_size; 607 transDist[pkt_cmd]++; 608 609 // forward the request to the appropriate destination 610 Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt); 611 612 // Lower levels have replied, tell the snoop filter |
613 if (snoopFilter && !system->bypassCaches() && pkt->isResponse()) { |
614 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]); 615 } 616 617 // if we got a response from a snooper, restore it here 618 if (snoop_response_cmd != MemCmd::InvalidCmd) { 619 // no one else should have responded 620 assert(!pkt->isResponse()); 621 pkt->cmd = snoop_response_cmd; --- 133 unchanged lines hidden (view full) --- 755 if (!pkt->isPrint()) { 756 // don't do DPRINTFs on PrintReq as it clutters up the output 757 DPRINTF(CoherentXBar, 758 "recvFunctional: packet src %s addr 0x%x cmd %s\n", 759 slavePorts[slave_port_id]->name(), pkt->getAddr(), 760 pkt->cmdString()); 761 } 762 |
763 if (!system->bypassCaches()) { |
764 // forward to all snoopers but the source 765 forwardFunctional(pkt, slave_port_id); 766 } 767 768 // there is no need to continue if the snooping has found what we 769 // were looking for and the packet is already a response 770 if (!pkt->isResponse()) { 771 PortID dest_id = findPort(pkt->getAddr()); --- 85 unchanged lines hidden --- |