simple_mem.cc (11284:b3926db25371) | simple_mem.cc (11334:9bd2e84abdca) |
---|---|
1/* 2 * Copyright (c) 2010-2013, 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 --- 58 unchanged lines hidden (view full) --- 67 if (port.isConnected()) { 68 port.sendRangeChange(); 69 } 70} 71 72Tick 73SimpleMemory::recvAtomic(PacketPtr pkt) 74{ | 1/* 2 * Copyright (c) 2010-2013, 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 --- 58 unchanged lines hidden (view full) --- 67 if (port.isConnected()) { 68 port.sendRangeChange(); 69 } 70} 71 72Tick 73SimpleMemory::recvAtomic(PacketPtr pkt) 74{ |
75 panic_if(pkt->cacheResponding(), "Should not see packets where cache " 76 "is responding"); 77 |
|
75 access(pkt); | 78 access(pkt); |
76 return pkt->cacheResponding() ? 0 : getLatency(); | 79 return getLatency(); |
77} 78 79void 80SimpleMemory::recvFunctional(PacketPtr pkt) 81{ 82 pkt->pushLabel(name()); 83 84 functionalAccess(pkt); --- 7 unchanged lines hidden (view full) --- 92 } 93 94 pkt->popLabel(); 95} 96 97bool 98SimpleMemory::recvTimingReq(PacketPtr pkt) 99{ | 80} 81 82void 83SimpleMemory::recvFunctional(PacketPtr pkt) 84{ 85 pkt->pushLabel(name()); 86 87 functionalAccess(pkt); --- 7 unchanged lines hidden (view full) --- 95 } 96 97 pkt->popLabel(); 98} 99 100bool 101SimpleMemory::recvTimingReq(PacketPtr pkt) 102{ |
100 // if a cache is responding, sink the packet without further action 101 if (pkt->cacheResponding()) { 102 pendingDelete.reset(pkt); 103 return true; 104 } | 103 panic_if(pkt->cacheResponding(), "Should not see packets where cache " 104 "is responding"); |
105 | 105 |
106 panic_if(!(pkt->isRead() || pkt->isWrite()), 107 "Should only see read and writes at memory controller, " 108 "saw %s to %#llx\n", pkt->cmdString(), pkt->getAddr()); 109 |
|
106 // we should not get a new request after committing to retry the 107 // current one, but unfortunately the CPU violates this rule, so 108 // simply ignore it for now 109 if (retryReq) 110 return false; 111 112 // if we are busy with a read or write, remember that we have to 113 // retry --- 8 unchanged lines hidden (view full) --- 122 Tick receive_delay = pkt->headerDelay + pkt->payloadDelay; 123 pkt->headerDelay = pkt->payloadDelay = 0; 124 125 // update the release time according to the bandwidth limit, and 126 // do so with respect to the time it takes to finish this request 127 // rather than long term as it is the short term data rate that is 128 // limited for any real memory 129 | 110 // we should not get a new request after committing to retry the 111 // current one, but unfortunately the CPU violates this rule, so 112 // simply ignore it for now 113 if (retryReq) 114 return false; 115 116 // if we are busy with a read or write, remember that we have to 117 // retry --- 8 unchanged lines hidden (view full) --- 126 Tick receive_delay = pkt->headerDelay + pkt->payloadDelay; 127 pkt->headerDelay = pkt->payloadDelay = 0; 128 129 // update the release time according to the bandwidth limit, and 130 // do so with respect to the time it takes to finish this request 131 // rather than long term as it is the short term data rate that is 132 // limited for any real memory 133 |
130 // only look at reads and writes when determining if we are busy, 131 // and for how long, as it is not clear what to regulate for the 132 // other types of commands 133 if (pkt->isRead() || pkt->isWrite()) { 134 // calculate an appropriate tick to release to not exceed 135 // the bandwidth limit 136 Tick duration = pkt->getSize() * bandwidth; | 134 // calculate an appropriate tick to release to not exceed 135 // the bandwidth limit 136 Tick duration = pkt->getSize() * bandwidth; |
137 | 137 |
138 // only consider ourselves busy if there is any need to wait 139 // to avoid extra events being scheduled for (infinitely) fast 140 // memories 141 if (duration != 0) { 142 schedule(releaseEvent, curTick() + duration); 143 isBusy = true; 144 } | 138 // only consider ourselves busy if there is any need to wait 139 // to avoid extra events being scheduled for (infinitely) fast 140 // memories 141 if (duration != 0) { 142 schedule(releaseEvent, curTick() + duration); 143 isBusy = true; |
145 } 146 147 // go ahead and deal with the packet and put the response in the 148 // queue if there is one 149 bool needsResponse = pkt->needsResponse(); 150 recvAtomic(pkt); 151 // turn packet around to go back to requester if response expected 152 if (needsResponse) { --- 144 unchanged lines hidden --- | 144 } 145 146 // go ahead and deal with the packet and put the response in the 147 // queue if there is one 148 bool needsResponse = pkt->needsResponse(); 149 recvAtomic(pkt); 150 // turn packet around to go back to requester if response expected 151 if (needsResponse) { --- 144 unchanged lines hidden --- |