coherent_xbar.cc (10719:b4fc9ad648aa) coherent_xbar.cc (10821:581fb2484bd6)
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
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 // uncacheable requests need never be snooped
184 if (!pkt->req->isUncacheable() && !system->bypassCaches()) {
183 if (!system->bypassCaches()) {
185 // the packet is a memory-mapped request and should be
186 // broadcasted to our snoopers but the source
187 if (snoopFilter) {
188 // check with the snoop filter where to forward this packet
189 auto sf_res = snoopFilter->lookupRequest(pkt, *src_port);
190 // If SnoopFilter is enabled, the total time required by a packet
191 // to be delivered through the xbar has to be charged also with
192 // to lookup latency of the snoop filter (sf_res.second).

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

208 !pkt->memInhibitAsserted();
209
210 // Note: Cannot create a copy of the full packet, here.
211 MemCmd orig_cmd(pkt->cmd);
212
213 // since it is a normal request, attempt to send the packet
214 bool success = masterPorts[master_port_id]->sendTimingReq(pkt);
215
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
216 if (snoopFilter && !pkt->req->isUncacheable()
217 && !system->bypassCaches()) {
215 if (snoopFilter && !system->bypassCaches()) {
218 // The packet may already be overwritten by the sendTimingReq function.
219 // The snoop filter needs to see the original request *and* the return
220 // status of the send operation, so we need to recreate the original
221 // request. Atomic mode does not have the issue, as there the send
222 // operation and the response happen instantaneously and don't need two
223 // phase tracking.
224 MemCmd tmp_cmd(pkt->cmd);
225 pkt->cmd = orig_cmd;

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

318 Tick xbar_delay = responseLatency * clockPeriod();
319
320 // set the packet header and payload delay
321 calcPacketTiming(pkt, xbar_delay);
322
323 // determine how long to be crossbar layer is busy
324 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay;
325
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
326 if (snoopFilter && !pkt->req->isUncacheable() && !system->bypassCaches()) {
324 if (snoopFilter && !system->bypassCaches()) {
327 // let the snoop filter inspect the response and update its state
328 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]);
329 }
330
331 // send the packet through the destination slave port
332 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt);
333
334 // currently it is illegal to block responses... can lead to

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

573 pkt->cmdString());
574
575 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0;
576 unsigned int pkt_cmd = pkt->cmdToIndex();
577
578 MemCmd snoop_response_cmd = MemCmd::InvalidCmd;
579 Tick snoop_response_latency = 0;
580
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
581 // uncacheable requests need never be snooped
582 if (!pkt->req->isUncacheable() && !system->bypassCaches()) {
579 if (!system->bypassCaches()) {
583 // forward to all snoopers but the source
584 std::pair<MemCmd, Tick> snoop_result;
585 if (snoopFilter) {
586 // check with the snoop filter where to forward this packet
587 auto sf_res =
588 snoopFilter->lookupRequest(pkt, *slavePorts[slave_port_id]);
589 snoop_response_latency += sf_res.second * clockPeriod();
590 DPRINTF(CoherentXBar, "%s: src %s %s 0x%x"\

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

608 pktCount[slave_port_id][master_port_id]++;
609 pktSize[slave_port_id][master_port_id] += pkt_size;
610 transDist[pkt_cmd]++;
611
612 // forward the request to the appropriate destination
613 Tick response_latency = masterPorts[master_port_id]->sendAtomic(pkt);
614
615 // Lower levels have replied, tell the snoop filter
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
616 if (snoopFilter && !pkt->req->isUncacheable() && !system->bypassCaches() &&
617 pkt->isResponse()) {
613 if (snoopFilter && !system->bypassCaches() && pkt->isResponse()) {
618 snoopFilter->updateResponse(pkt, *slavePorts[slave_port_id]);
619 }
620
621 // if we got a response from a snooper, restore it here
622 if (snoop_response_cmd != MemCmd::InvalidCmd) {
623 // no one else should have responded
624 assert(!pkt->isResponse());
625 pkt->cmd = snoop_response_cmd;

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

759 if (!pkt->isPrint()) {
760 // don't do DPRINTFs on PrintReq as it clutters up the output
761 DPRINTF(CoherentXBar,
762 "recvFunctional: packet src %s addr 0x%x cmd %s\n",
763 slavePorts[slave_port_id]->name(), pkt->getAddr(),
764 pkt->cmdString());
765 }
766
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
767 // uncacheable requests need never be snooped
768 if (!pkt->req->isUncacheable() && !system->bypassCaches()) {
763 if (!system->bypassCaches()) {
769 // forward to all snoopers but the source
770 forwardFunctional(pkt, slave_port_id);
771 }
772
773 // there is no need to continue if the snooping has found what we
774 // were looking for and the packet is already a response
775 if (!pkt->isResponse()) {
776 PortID dest_id = findPort(pkt->getAddr());

--- 85 unchanged lines hidden ---
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 ---