dev: Make DMA devices use their own ports for functional accesses.

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 <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexandru Duțu <alexandru.dutu@amd.com>
This commit is contained in:
Gabe Black
2020-12-04 01:49:48 -08:00
parent f16bfed9ea
commit 9e97dbe8c8
2 changed files with 5 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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