From 9e97dbe8c8a77643197b28737f47d9ef64d8bb17 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 4 Dec 2020 01:49:48 -0800 Subject: [PATCH] dev: Make DMA devices use their own ports for functional accesses. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit DMA devices already have ports they use for non-functional accesses. We can just attach a port proxy to that instead of getting one from the system object. Change-Id: I5e9adee43c7fe07b4c90978dbb7ec71468caadbb Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38481 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Alexandru Duțu --- src/dev/dma_device.cc | 6 +++--- src/dev/dma_device.hh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dev/dma_device.cc b/src/dev/dma_device.cc index efa9ef74e..0597306f6 100644 --- a/src/dev/dma_device.cc +++ b/src/dev/dma_device.cc @@ -45,7 +45,6 @@ #include "base/chunk_generator.hh" #include "debug/DMA.hh" #include "debug/Drain.hh" -#include "mem/port_proxy.hh" #include "sim/clocked_object.hh" #include "sim/system.hh" @@ -286,7 +285,8 @@ DmaReadFifo::DmaReadFifo(DmaPort &_port, size_t size, unsigned max_pending, Request::Flags flags) : maxReqSize(max_req_size), fifoSize(size), - reqFlags(flags), port(_port), buffer(size) + reqFlags(flags), port(_port), proxy(port, port.sys->cacheLineSize()), + buffer(size) { freeRequests.resize(max_pending); for (auto &e : freeRequests) @@ -403,7 +403,7 @@ DmaReadFifo::resumeFillFunctional() "fifo_space=%#x block_remaining=%#x\n", nextAddr, xfer_size, fifo_space, block_remaining); - port.sys->physProxy.readBlob(nextAddr, tmp_buffer.data(), xfer_size); + proxy.readBlob(nextAddr, tmp_buffer.data(), xfer_size); buffer.write(tmp_buffer.begin(), xfer_size); nextAddr += xfer_size; } diff --git a/src/dev/dma_device.hh b/src/dev/dma_device.hh index 9752c2141..4dec839f9 100644 --- a/src/dev/dma_device.hh +++ b/src/dev/dma_device.hh @@ -46,6 +46,7 @@ #include "base/circlebuf.hh" #include "dev/io_device.hh" +#include "mem/port_proxy.hh" #include "params/DmaDevice.hh" #include "sim/drain.hh" #include "sim/system.hh" @@ -471,6 +472,7 @@ class DmaReadFifo : public Drainable, public Serializable const Request::Flags reqFlags; DmaPort &port; + PortProxy proxy; private: class DmaDoneEvent : public Event -- 2.30.2