diff options
Diffstat (limited to 'src/dev')
-rw-r--r-- | src/dev/Device.py | 5 | ||||
-rw-r--r-- | src/dev/copy_engine.cc | 3 | ||||
-rw-r--r-- | src/dev/dma_device.cc | 52 | ||||
-rw-r--r-- | src/dev/dma_device.hh | 16 |
4 files changed, 13 insertions, 63 deletions
diff --git a/src/dev/Device.py b/src/dev/Device.py index 60c21df91..b1a4f69bc 100644 --- a/src/dev/Device.py +++ b/src/dev/Device.py @@ -46,11 +46,6 @@ class DmaDevice(PioDevice): type = 'DmaDevice' abstract = True dma = MasterPort("DMA port") - min_backoff_delay = Param.Latency('4ns', - "min time between a nack packet being received and the next request made by the device") - max_backoff_delay = Param.Latency('10us', - "max time between a nack packet being received and the next request made by the device") - class IsaFake(BasicPioDevice): diff --git a/src/dev/copy_engine.cc b/src/dev/copy_engine.cc index bb15abab6..77cc735a9 100644 --- a/src/dev/copy_engine.cc +++ b/src/dev/copy_engine.cc @@ -78,8 +78,7 @@ CopyEngine::CopyEngine(const Params *p) CopyEngine::CopyEngineChannel::CopyEngineChannel(CopyEngine *_ce, int cid) - : cePort(_ce, _ce->sys, _ce->params()->min_backoff_delay, - _ce->params()->max_backoff_delay), + : cePort(_ce, _ce->sys), ce(_ce), channelId(cid), busy(false), underReset(false), refreshNext(false), latBeforeBegin(ce->params()->latBeforeBegin), latAfterCompletion(ce->params()->latAfterCompletion), diff --git a/src/dev/dma_device.cc b/src/dev/dma_device.cc index 5a2f52df1..80253129f 100644 --- a/src/dev/dma_device.cc +++ b/src/dev/dma_device.cc @@ -47,36 +47,18 @@ #include "dev/dma_device.hh" #include "sim/system.hh" -DmaPort::DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff) +DmaPort::DmaPort(MemObject *dev, System *s) : MasterPort(dev->name() + ".dma", dev), device(dev), sys(s), masterId(s->getMasterId(dev->name())), pendingCount(0), drainEvent(NULL), - backoffTime(0), minBackoffDelay(min_backoff), - maxBackoffDelay(max_backoff), inRetry(false), - backoffEvent(this) + inRetry(false) { } bool DmaPort::recvTimingResp(PacketPtr pkt) { - if (pkt->wasNacked()) { - DPRINTF(DMA, "Received nacked %s addr %#x\n", - pkt->cmdString(), pkt->getAddr()); - - if (backoffTime < minBackoffDelay) - backoffTime = minBackoffDelay; - else if (backoffTime < maxBackoffDelay) - backoffTime <<= 1; - - device->reschedule(backoffEvent, curTick() + backoffTime, true); - - DPRINTF(DMA, "Backoff time set to %d ticks\n", backoffTime); - - pkt->reinitNacked(); - queueDma(pkt, true); - } else if (pkt->senderState) { + if (pkt->senderState) { DmaReqState *state; - backoffTime >>= 2; DPRINTF(DMA, "Received response %s addr %#x size %#x\n", pkt->cmdString(), pkt->getAddr(), pkt->req->getSize()); @@ -116,8 +98,7 @@ DmaPort::recvTimingResp(PacketPtr pkt) } DmaDevice::DmaDevice(const Params *p) - : PioDevice(p), dmaPort(this, sys, params()->min_backoff_delay, - params()->max_backoff_delay) + : PioDevice(p), dmaPort(this, sys) { } void @@ -168,16 +149,10 @@ DmaPort::recvRetry() inRetry = true; DPRINTF(DMA, "-- Failed, queued\n"); } - } while (!backoffTime && result && transmitList.size()); + } while (result && transmitList.size()); - if (transmitList.size() && backoffTime && !inRetry) { - DPRINTF(DMA, "Scheduling backoff for %d\n", curTick()+backoffTime); - if (!backoffEvent.scheduled()) - device->schedule(backoffEvent, backoffTime + curTick()); - } - DPRINTF(DMA, "TransmitList: %d, backoffTime: %d inRetry: %d es: %d\n", - transmitList.size(), backoffTime, inRetry, - backoffEvent.scheduled()); + DPRINTF(DMA, "TransmitList: %d, inRetry: %d\n", + transmitList.size(), inRetry); } void @@ -231,8 +206,8 @@ DmaPort::sendDma() Enums::MemoryMode state = sys->getMemoryMode(); if (state == Enums::timing) { - if (backoffEvent.scheduled() || inRetry) { - DPRINTF(DMA, "Can't send immediately, waiting for retry or backoff timer\n"); + if (inRetry) { + DPRINTF(DMA, "Can't send immediately, waiting for retry\n"); return; } @@ -249,14 +224,7 @@ DmaPort::sendDma() inRetry = true; DPRINTF(DMA, "-- Failed: queued\n"); } - } while (result && !backoffTime && transmitList.size()); - - if (transmitList.size() && backoffTime && !inRetry && - !backoffEvent.scheduled()) { - DPRINTF(DMA, "-- Scheduling backoff timer for %d\n", - backoffTime+curTick()); - device->schedule(backoffEvent, backoffTime + curTick()); - } + } while (result && transmitList.size()); } else if (state == Enums::atomic) { transmitList.pop_front(); diff --git a/src/dev/dma_device.hh b/src/dev/dma_device.hh index ccf388fa4..691a21749 100644 --- a/src/dev/dma_device.hh +++ b/src/dev/dma_device.hh @@ -87,16 +87,6 @@ class DmaPort : public MasterPort * here.*/ Event *drainEvent; - /** time to wait between sending another packet, increases as NACKs are - * recived, decreases as responses are recived. */ - Tick backoffTime; - - /** Minimum time that device should back off for after failed sendTiming */ - Tick minBackoffDelay; - - /** Maximum time that device should back off for after failed sendTiming */ - Tick maxBackoffDelay; - /** If the port is currently waiting for a retry before it can send whatever * it is that it's sending. */ bool inRetry; @@ -108,11 +98,9 @@ class DmaPort : public MasterPort void queueDma(PacketPtr pkt, bool front = false); void sendDma(); - /** event to give us a kick every time we backoff time is reached. */ - EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent; - public: - DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff); + + DmaPort(MemObject *dev, System *s); void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag = 0); |