noncoherent_xbar.cc (10713:eddb533708cb) | noncoherent_xbar.cc (10719:b4fc9ad648aa) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2011-2014 ARM Limited | 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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 111 unchanged lines hidden (view full) --- 122 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x\n", 123 src_port->name(), pkt->cmdString(), pkt->getAddr()); 124 125 // store size and command as they might be modified when 126 // forwarding the packet 127 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 128 unsigned int pkt_cmd = pkt->cmdToIndex(); 129 | 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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 111 unchanged lines hidden (view full) --- 122 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x\n", 123 src_port->name(), pkt->cmdString(), pkt->getAddr()); 124 125 // store size and command as they might be modified when 126 // forwarding the packet 127 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 128 unsigned int pkt_cmd = pkt->cmdToIndex(); 129 |
130 calcPacketTiming(pkt); 131 Tick packetFinishTime = curTick() + pkt->payloadDelay; | 130 // store the old header delay so we can restore it if needed 131 Tick old_header_delay = pkt->headerDelay; |
132 | 132 |
133 // a request sees the frontend and forward latency 134 Tick xbar_delay = (frontendLatency + forwardLatency) * clockPeriod(); 135 136 // set the packet header and payload delay 137 calcPacketTiming(pkt, xbar_delay); 138 139 // determine how long to be crossbar layer is busy 140 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay; 141 |
|
133 // before forwarding the packet (and possibly altering it), 134 // remember if we are expecting a response 135 const bool expect_response = pkt->needsResponse() && 136 !pkt->memInhibitAsserted(); 137 138 // since it is a normal request, attempt to send the packet 139 bool success = masterPorts[master_port_id]->sendTimingReq(pkt); 140 141 if (!success) { 142 // inhibited packets should never be forced to retry 143 assert(!pkt->memInhibitAsserted()); 144 145 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n", 146 src_port->name(), pkt->cmdString(), pkt->getAddr()); 147 | 142 // before forwarding the packet (and possibly altering it), 143 // remember if we are expecting a response 144 const bool expect_response = pkt->needsResponse() && 145 !pkt->memInhibitAsserted(); 146 147 // since it is a normal request, attempt to send the packet 148 bool success = masterPorts[master_port_id]->sendTimingReq(pkt); 149 150 if (!success) { 151 // inhibited packets should never be forced to retry 152 assert(!pkt->memInhibitAsserted()); 153 154 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n", 155 src_port->name(), pkt->cmdString(), pkt->getAddr()); 156 |
148 // undo the calculation so we can check for 0 again 149 pkt->headerDelay = pkt->payloadDelay = 0; | 157 // restore the header delay as it is additive 158 pkt->headerDelay = old_header_delay; |
150 151 // occupy until the header is sent 152 reqLayers[master_port_id]->failedTiming(src_port, | 159 160 // occupy until the header is sent 161 reqLayers[master_port_id]->failedTiming(src_port, |
153 clockEdge(headerCycles)); | 162 clockEdge(Cycles(1))); |
154 155 return false; 156 } 157 158 // remember where to route the response to 159 if (expect_response) { 160 assert(routeTo.find(pkt->req) == routeTo.end()); 161 routeTo[pkt->req] = slave_port_id; --- 33 unchanged lines hidden (view full) --- 195 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x\n", 196 src_port->name(), pkt->cmdString(), pkt->getAddr()); 197 198 // store size and command as they might be modified when 199 // forwarding the packet 200 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 201 unsigned int pkt_cmd = pkt->cmdToIndex(); 202 | 163 164 return false; 165 } 166 167 // remember where to route the response to 168 if (expect_response) { 169 assert(routeTo.find(pkt->req) == routeTo.end()); 170 routeTo[pkt->req] = slave_port_id; --- 33 unchanged lines hidden (view full) --- 204 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x\n", 205 src_port->name(), pkt->cmdString(), pkt->getAddr()); 206 207 // store size and command as they might be modified when 208 // forwarding the packet 209 unsigned int pkt_size = pkt->hasData() ? pkt->getSize() : 0; 210 unsigned int pkt_cmd = pkt->cmdToIndex(); 211 |
203 calcPacketTiming(pkt); 204 Tick packetFinishTime = curTick() + pkt->payloadDelay; | 212 // a response sees the response latency 213 Tick xbar_delay = responseLatency * clockPeriod(); |
205 | 214 |
215 // set the packet header and payload delay 216 calcPacketTiming(pkt, xbar_delay); 217 218 // determine how long to be crossbar layer is busy 219 Tick packetFinishTime = clockEdge(Cycles(1)) + pkt->payloadDelay; 220 |
|
206 // send the packet through the destination slave port 207 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt); 208 209 // currently it is illegal to block responses... can lead to 210 // deadlock 211 assert(success); 212 213 // remove the request from the routing table --- 104 unchanged lines hidden --- | 221 // send the packet through the destination slave port 222 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt); 223 224 // currently it is illegal to block responses... can lead to 225 // deadlock 226 assert(success); 227 228 // remove the request from the routing table --- 104 unchanged lines hidden --- |