{
if (!slavePort.isConnected() || !masterPort.isConnected())
fatal("Address mapper is not connected on both sides.\n");
-
- if ((slavePort.peerBlockSize() != masterPort.peerBlockSize()) &&
- slavePort.peerBlockSize() && masterPort.peerBlockSize())
- fatal("Slave port size %d, master port size %d \n "
- "don't have the same block size... Not supported.\n",
- slavePort.peerBlockSize(), masterPort.peerBlockSize());
}
BaseMasterPort&
Addr orig_addr = pkt->getAddr();
bool needsResponse = pkt->needsResponse();
bool memInhibitAsserted = pkt->memInhibitAsserted();
- Packet::SenderState* senderState = pkt->senderState;
if (needsResponse && !memInhibitAsserted) {
- pkt->senderState = new AddrMapperSenderState(senderState, orig_addr);
+ pkt->pushSenderState(new AddrMapperSenderState(orig_addr));
}
pkt->setAddr(remapAddr(orig_addr));
// packets)
bool successful = masterPort.sendTimingReq(pkt);
- // If not successful, restore the sender state
- if (!successful && needsResponse) {
- delete pkt->senderState;
- pkt->senderState = senderState;
+ // If not successful, restore the address and sender state
+ if (!successful) {
+ pkt->setAddr(orig_addr);
+
+ if (needsResponse) {
+ delete pkt->popSenderState();
+ }
}
return successful;
Addr remapped_addr = pkt->getAddr();
// Restore the state and address
- pkt->senderState = receivedState->origSenderState;
+ pkt->senderState = receivedState->predecessor;
pkt->setAddr(receivedState->origAddr);
// Attempt to send the packet
return false;
}
-unsigned
-AddrMapper::deviceBlockSizeMaster()
-{
- return slavePort.peerBlockSize();
-}
-
-unsigned
-AddrMapper::deviceBlockSizeSlave()
-{
- return masterPort.peerBlockSize();
-}
-
void
-AddrMapper::recvRetryMaster()
+AddrMapper::recvReqRetry()
{
- slavePort.sendRetry();
+ slavePort.sendRetryReq();
}
void
-AddrMapper::recvRetrySlave()
+AddrMapper::recvRespRetry()
{
- masterPort.sendRetry();
+ masterPort.sendRetryResp();
}
void