dev: Make DMA devices use their own ports for functional accesses.
authorGabe Black <gabe.black@gmail.com>
Fri, 4 Dec 2020 09:49:48 +0000 (01:49 -0800)
committerGabe Black <gabe.black@gmail.com>
Thu, 31 Dec 2020 10:19:12 +0000 (10:19 +0000)
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>
src/dev/dma_device.cc
src/dev/dma_device.hh

index efa9ef74e0c2892ae6bb38076179bcbe22645b65..0597306f6bed52c3f2f54a8523d15c66f9404ff6 100644 (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;
     }
index 9752c2141b383f9c5c07cef6577dcc0e3ada3c75..4dec839f9beccb96c129e0a7feba14caddd74cb7 100644 (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