RubyPort.cc (10525:77787650cbbc) | RubyPort.cc (10657:8bb4a9717eaa) |
---|---|
1/* 2 * Copyright (c) 2012-2013 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 return true; 176} 177 178bool RubyPort::MemMasterPort::recvTimingResp(PacketPtr pkt) 179{ 180 // got a response from a device 181 assert(pkt->isResponse()); 182 | 1/* 2 * Copyright (c) 2012-2013 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 return true; 176} 177 178bool RubyPort::MemMasterPort::recvTimingResp(PacketPtr pkt) 179{ 180 // got a response from a device 181 assert(pkt->isResponse()); 182 |
183 // In FS mode, ruby memory will receive pio responses from devices 184 // and it must forward these responses back to the particular CPU. 185 DPRINTF(RubyPort, "Pio response for address %#x, going to %d\n", 186 pkt->getAddr(), pkt->getDest()); 187 | |
188 // First we must retrieve the request port from the sender State 189 RubyPort::SenderState *senderState = 190 safe_cast<RubyPort::SenderState *>(pkt->popSenderState()); 191 MemSlavePort *port = senderState->port; 192 assert(port != NULL); 193 delete senderState; 194 | 183 // First we must retrieve the request port from the sender State 184 RubyPort::SenderState *senderState = 185 safe_cast<RubyPort::SenderState *>(pkt->popSenderState()); 186 MemSlavePort *port = senderState->port; 187 assert(port != NULL); 188 delete senderState; 189 |
190 // In FS mode, ruby memory will receive pio responses from devices 191 // and it must forward these responses back to the particular CPU. 192 DPRINTF(RubyPort, "Pio response for address %#x, going to %s\n", 193 pkt->getAddr(), port->name()); 194 |
|
195 // attempt to send the response in the next cycle 196 port->schedTimingResp(pkt, curTick() + g_system_ptr->clockPeriod()); 197 198 return true; 199} 200 201bool 202RubyPort::PioSlavePort::recvTimingReq(PacketPtr pkt) --- 38 unchanged lines hidden (view full) --- 241 pkt->pushSenderState(new SenderState(this)); 242 243 // send next cycle 244 ruby_port->memMasterPort.schedTimingReq(pkt, 245 curTick() + g_system_ptr->clockPeriod()); 246 return true; 247 } 248 | 195 // attempt to send the response in the next cycle 196 port->schedTimingResp(pkt, curTick() + g_system_ptr->clockPeriod()); 197 198 return true; 199} 200 201bool 202RubyPort::PioSlavePort::recvTimingReq(PacketPtr pkt) --- 38 unchanged lines hidden (view full) --- 241 pkt->pushSenderState(new SenderState(this)); 242 243 // send next cycle 244 ruby_port->memMasterPort.schedTimingReq(pkt, 245 curTick() + g_system_ptr->clockPeriod()); 246 return true; 247 } 248 |
249 // Save the port id to be used later to route the response 250 pkt->setSrc(id); 251 | |
252 assert(Address(pkt->getAddr()).getOffset() + pkt->getSize() <= 253 RubySystem::getBlockSizeBytes()); 254 255 // Submit the ruby request 256 RequestStatus requestStatus = ruby_port->makeRequest(pkt); 257 258 // If the request successfully issued then we should return true. 259 // Otherwise, we need to tell the port to retry at a later point 260 // and return false. 261 if (requestStatus == RequestStatus_Issued) { | 249 assert(Address(pkt->getAddr()).getOffset() + pkt->getSize() <= 250 RubySystem::getBlockSizeBytes()); 251 252 // Submit the ruby request 253 RequestStatus requestStatus = ruby_port->makeRequest(pkt); 254 255 // If the request successfully issued then we should return true. 256 // Otherwise, we need to tell the port to retry at a later point 257 // and return false. 258 if (requestStatus == RequestStatus_Issued) { |
259 // Save the port in the sender state object to be used later to 260 // route the response 261 pkt->pushSenderState(new SenderState(this)); 262 |
|
262 DPRINTF(RubyPort, "Request %s 0x%x issued\n", pkt->cmdString(), 263 pkt->getAddr()); 264 return true; 265 } 266 267 // 268 // Unless one is using the ruby tester, record the stalled M5 port for 269 // later retry when the sequencer becomes free. --- 68 unchanged lines hidden (view full) --- 338 DPRINTF(RubyPort, "Hit callback for %s 0x%x\n", pkt->cmdString(), 339 pkt->getAddr()); 340 341 // The packet was destined for memory and has not yet been turned 342 // into a response 343 assert(system->isMemAddr(pkt->getAddr())); 344 assert(pkt->isRequest()); 345 | 263 DPRINTF(RubyPort, "Request %s 0x%x issued\n", pkt->cmdString(), 264 pkt->getAddr()); 265 return true; 266 } 267 268 // 269 // Unless one is using the ruby tester, record the stalled M5 port for 270 // later retry when the sequencer becomes free. --- 68 unchanged lines hidden (view full) --- 339 DPRINTF(RubyPort, "Hit callback for %s 0x%x\n", pkt->cmdString(), 340 pkt->getAddr()); 341 342 // The packet was destined for memory and has not yet been turned 343 // into a response 344 assert(system->isMemAddr(pkt->getAddr())); 345 assert(pkt->isRequest()); 346 |
346 // As it has not yet been turned around, the source field tells us 347 // which port it came from. 348 assert(pkt->getSrc() < slave_ports.size()); | 347 // First we must retrieve the request port from the sender State 348 RubyPort::SenderState *senderState = 349 safe_cast<RubyPort::SenderState *>(pkt->popSenderState()); 350 MemSlavePort *port = senderState->port; 351 assert(port != NULL); 352 delete senderState; |
349 | 353 |
350 slave_ports[pkt->getSrc()]->hitCallback(pkt); | 354 port->hitCallback(pkt); |
351 352 // 353 // If we had to stall the MemSlavePorts, wake them up because the sequencer 354 // likely has free resources now. 355 // 356 if (!retryList.empty()) { 357 // 358 // Record the current list of ports to retry on a temporary list before --- 205 unchanged lines hidden --- | 355 356 // 357 // If we had to stall the MemSlavePorts, wake them up because the sequencer 358 // likely has free resources now. 359 // 360 if (!retryList.empty()) { 361 // 362 // Record the current list of ports to retry on a temporary list before --- 205 unchanged lines hidden --- |