diff options
author | Ali Saidi <saidi@eecs.umich.edu> | 2006-05-30 18:57:42 -0400 |
---|---|---|
committer | Ali Saidi <saidi@eecs.umich.edu> | 2006-05-30 18:57:42 -0400 |
commit | 09d8a1e1252eba582fd8450ee31e784b54910f7d (patch) | |
tree | 90790e6ea9e1575eb2a81715a33eddccb091bd82 /src/dev/io_device.cc | |
parent | e60dc5195ce36bc055e9ea6899df9968bccafe9f (diff) | |
download | gem5-09d8a1e1252eba582fd8450ee31e784b54910f7d.tar.xz |
Add a very poor implementation of dealing with retries on timing requests. It is especially slow with tracing on since
it ends up being O(N^2). But it's probably going to have to change for the real bus anyway, so it should be rewritten then
Change recvRetry() to not accept a packet. Sendtiming should be called again (and can respond with false or true)
Removed Port Blocked/Unblocked and replaced with sendRetry().
Remove possibility of packet mangling if packet is going to be refused anyway in bridge
src/cpu/simple/atomic.cc:
src/cpu/simple/atomic.hh:
src/cpu/simple/timing.cc:
src/cpu/simple/timing.hh:
Change recvRetry() to not accept a packet. Sendtiming should be called again (and can respond with false or true)
src/dev/io_device.cc:
src/dev/io_device.hh:
Make DMA Timing requests/responses work.
Change recvRetry() to not accept a packet. Sendtiming should be called again (and can respond with false or true)
src/mem/bridge.cc:
src/mem/bridge.hh:
Change recvRetry() to not accept a packet. Sendtiming should be called again (and can respond with false or true)
Removed Port Blocked/Unblocked and replaced with sendRetry().
Remove posibility of packet mangling if packet is going to be refused anyway.
src/mem/bus.cc:
src/mem/bus.hh:
Add a very poor implementation of dealing with retries on timing requests. It is especially slow with tracing on since
it ends up being O(N^2). But it's probably going to have to change for the real bus anyway, so it should be rewritten then
src/mem/port.hh:
Change recvRetry() to not accept a packet. Sendtiming should be called again (and can respond with false or true)
Removed Blocked/Unblocked port status, their functionality is really duplicated in the recvRetry() method
--HG--
extra : convert_revision : fab613404be54bfa7a4c67572bae7b559169e573
Diffstat (limited to 'src/dev/io_device.cc')
-rw-r--r-- | src/dev/io_device.cc | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index 87fdbb765..563fdb759 100644 --- a/src/dev/io_device.cc +++ b/src/dev/io_device.cc @@ -26,6 +26,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "base/trace.hh" #include "dev/io_device.hh" #include "sim/builder.hh" @@ -55,12 +56,13 @@ PioPort::getDeviceAddressRanges(AddrRangeList &resp, AddrRangeList &snoop) } -Packet * +void PioPort::recvRetry() { Packet* pkt = transmitList.front(); - transmitList.pop_front(); - return pkt; + if (Port::sendTiming(pkt)) { + transmitList.pop_front(); + } } @@ -74,6 +76,7 @@ PioPort::SendEvent::process() } + bool PioPort::recvTiming(Packet *pkt) { @@ -116,16 +119,20 @@ DmaPort::recvTiming(Packet *pkt) { if (pkt->senderState) { DmaReqState *state; + DPRINTF(DMA, "Received response Packet %#x with senderState: %#x\n", + pkt, pkt->senderState); state = dynamic_cast<DmaReqState*>(pkt->senderState); - state->completionEvent->schedule(pkt->time - pkt->req->getTime()); + assert(state); + state->completionEvent->process(); delete pkt->req; delete pkt; } else { + DPRINTF(DMA, "Received response Packet %#x with no senderState\n", pkt); delete pkt->req; delete pkt; } - return Packet::Success; + return true; } DmaDevice::DmaDevice(Params *p) @@ -133,20 +140,19 @@ DmaDevice::DmaDevice(Params *p) { } void -DmaPort::SendEvent::process() -{ - if (port->Port::sendTiming(packet)) - return; - - port->transmitList.push_back(packet); -} - -Packet * DmaPort::recvRetry() { Packet* pkt = transmitList.front(); - transmitList.pop_front(); - return pkt; + DPRINTF(DMA, "Retry on Packet %#x with senderState: %#x\n", + pkt, pkt->senderState); + if (sendTiming(pkt)) { + DPRINTF(DMA, "-- Done\n"); + transmitList.pop_front(); + pendingCount--; + assert(pendingCount >= 0); + } else { + DPRINTF(DMA, "-- Failed, queued\n"); + } } @@ -192,13 +198,22 @@ DmaPort::sendDma(Packet *pkt) // switching actually work /* MemState state = device->platform->system->memState; - if (state == Timing) { - if (!sendTiming(pkt)) - transmitList.push_back(&packet); - } else if (state == Atomic) {*/ + if (state == Timing) { */ + DPRINTF(DMA, "Attempting to send Packet %#x with senderState: %#x\n", + pkt, pkt->senderState); + if (!sendTiming(pkt)) { + transmitList.push_back(pkt); + DPRINTF(DMA, "-- Failed: queued\n"); + } else { + DPRINTF(DMA, "-- Done\n"); + pendingCount--; + assert(pendingCount >= 0); + } + /* } else if (state == Atomic) { sendAtomic(pkt); if (pkt->senderState) { DmaReqState *state = dynamic_cast<DmaReqState*>(pkt->senderState); + assert(state); state->completionEvent->schedule(curTick + (pkt->time - pkt->req->getTime()) +1); } pendingCount--; @@ -206,7 +221,7 @@ DmaPort::sendDma(Packet *pkt) delete pkt->req; delete pkt; -/* } else if (state == Functional) { + } else if (state == Functional) { sendFunctional(pkt); // Is this correct??? completionEvent->schedule(pkt->req->responseTime - pkt->req->requestTime); |