noncoherent_xbar.cc (10572:fc4c90a7d2f5) | noncoherent_xbar.cc (10656:bd376adfb7d4) |
---|---|
1/* 2 * Copyright (c) 2011-2014 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 --- 113 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 | 1/* 2 * Copyright (c) 2011-2014 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 --- 113 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 // set the source port for routing of the response 131 pkt->setSrc(slave_port_id); 132 | |
133 calcPacketTiming(pkt); 134 Tick packetFinishTime = pkt->lastWordDelay + curTick(); 135 | 130 calcPacketTiming(pkt); 131 Tick packetFinishTime = pkt->lastWordDelay + curTick(); 132 |
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 |
|
136 // since it is a normal request, attempt to send the packet 137 bool success = masterPorts[master_port_id]->sendTimingReq(pkt); 138 139 if (!success) { 140 // inhibited packets should never be forced to retry 141 assert(!pkt->memInhibitAsserted()); 142 143 DPRINTF(NoncoherentXBar, "recvTimingReq: src %s %s 0x%x RETRY\n", --- 4 unchanged lines hidden (view full) --- 148 149 // occupy until the header is sent 150 reqLayers[master_port_id]->failedTiming(src_port, 151 clockEdge(headerCycles)); 152 153 return false; 154 } 155 | 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", --- 4 unchanged lines hidden (view full) --- 150 151 // occupy until the header is sent 152 reqLayers[master_port_id]->failedTiming(src_port, 153 clockEdge(headerCycles)); 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; 162 } 163 |
|
156 reqLayers[master_port_id]->succeededTiming(packetFinishTime); 157 158 // stats updates 159 pktCount[slave_port_id][master_port_id]++; 160 pktSize[slave_port_id][master_port_id] += pkt_size; 161 transDist[pkt_cmd]++; 162 163 return true; 164} 165 166bool 167NoncoherentXBar::recvTimingResp(PacketPtr pkt, PortID master_port_id) 168{ 169 // determine the source port based on the id 170 MasterPort *src_port = masterPorts[master_port_id]; 171 | 164 reqLayers[master_port_id]->succeededTiming(packetFinishTime); 165 166 // stats updates 167 pktCount[slave_port_id][master_port_id]++; 168 pktSize[slave_port_id][master_port_id] += pkt_size; 169 transDist[pkt_cmd]++; 170 171 return true; 172} 173 174bool 175NoncoherentXBar::recvTimingResp(PacketPtr pkt, PortID master_port_id) 176{ 177 // determine the source port based on the id 178 MasterPort *src_port = masterPorts[master_port_id]; 179 |
172 // determine the destination based on what is stored in the packet 173 PortID slave_port_id = pkt->getDest(); | 180 // determine the destination 181 const auto route_lookup = routeTo.find(pkt->req); 182 assert(route_lookup != routeTo.end()); 183 const PortID slave_port_id = route_lookup->second; |
174 assert(slave_port_id != InvalidPortID); 175 assert(slave_port_id < respLayers.size()); 176 177 // test if the layer should be considered occupied for the current 178 // port 179 if (!respLayers[slave_port_id]->tryTiming(src_port)) { 180 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x BUSY\n", 181 src_port->name(), pkt->cmdString(), pkt->getAddr()); --- 13 unchanged lines hidden (view full) --- 195 196 // send the packet through the destination slave port 197 bool success M5_VAR_USED = slavePorts[slave_port_id]->sendTimingResp(pkt); 198 199 // currently it is illegal to block responses... can lead to 200 // deadlock 201 assert(success); 202 | 184 assert(slave_port_id != InvalidPortID); 185 assert(slave_port_id < respLayers.size()); 186 187 // test if the layer should be considered occupied for the current 188 // port 189 if (!respLayers[slave_port_id]->tryTiming(src_port)) { 190 DPRINTF(NoncoherentXBar, "recvTimingResp: src %s %s 0x%x BUSY\n", 191 src_port->name(), pkt->cmdString(), pkt->getAddr()); --- 13 unchanged lines hidden (view full) --- 205 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 214 routeTo.erase(route_lookup); 215 |
|
203 respLayers[slave_port_id]->succeededTiming(packetFinishTime); 204 205 // stats updates 206 pktCount[slave_port_id][master_port_id]++; 207 pktSize[slave_port_id][master_port_id] += pkt_size; 208 transDist[pkt_cmd]++; 209 210 return true; --- 94 unchanged lines hidden --- | 216 respLayers[slave_port_id]->succeededTiming(packetFinishTime); 217 218 // stats updates 219 pktCount[slave_port_id][master_port_id]++; 220 pktSize[slave_port_id][master_port_id] += pkt_size; 221 transDist[pkt_cmd]++; 222 223 return true; --- 94 unchanged lines hidden --- |