Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/38720 )
Change subject: dev: Use regular atomic accesses for DMA in bypass mode.
......................................................................
dev: Use regular atomic accesses for DMA in bypass mode.
These are now accelerated with backdoor accesses and should be at least
as fast as functional accesses. This removes a dependency on port
proxies, and also stops the HDLCD from using functional accesses.
Change-Id: I5e959288eb533d09cffa7b79938aa2f61e4aff7d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38720
Reviewed-by: Andreas Sandberg <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/dev/dma_device.cc
M src/dev/dma_device.hh
2 files changed, 10 insertions(+), 10 deletions(-)
Approvals:
Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/dev/dma_device.cc b/src/dev/dma_device.cc
index bbdae7d..9aebb7b 100644
--- a/src/dev/dma_device.cc
+++ b/src/dev/dma_device.cc
@@ -370,8 +370,8 @@
unsigned max_pending,
Request::Flags flags)
: maxReqSize(max_req_size), fifoSize(size),
- reqFlags(flags), port(_port), proxy(port, port.sys->cacheLineSize()),
- cacheLineSize(port.sys->cacheLineSize()), buffer(size)
+ reqFlags(flags), port(_port),
cacheLineSize(port.sys->cacheLineSize()),
+ buffer(size)
{
freeRequests.resize(max_pending);
for (auto &e : freeRequests)
@@ -465,7 +465,7 @@
const bool old_eob(atEndOfBlock());
if (port.sys->bypassCaches())
- resumeFillFunctional();
+ resumeFillBypass();
else
resumeFillTiming();
@@ -474,7 +474,7 @@
}
void
-DmaReadFifo::resumeFillFunctional()
+DmaReadFifo::resumeFillBypass()
{
const size_t fifo_space = buffer.capacity() - buffer.size();
if (fifo_space >= cacheLineSize || buffer.capacity() < cacheLineSize) {
@@ -483,11 +483,13 @@
std::vector<uint8_t> tmp_buffer(xfer_size);
assert(pendingRequests.empty());
- DPRINTF(DMA, "KVM Bypassing startAddr=%#x xfer_size=%#x " \
+ DPRINTF(DMA, "Direct bypass startAddr=%#x xfer_size=%#x " \
"fifo_space=%#x block_remaining=%#x\n",
nextAddr, xfer_size, fifo_space, block_remaining);
- proxy.readBlob(nextAddr, tmp_buffer.data(), xfer_size);
+ port.dmaAction(MemCmd::ReadReq, nextAddr, xfer_size, nullptr,
+ tmp_buffer.data(), 0, reqFlags);
+
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 3904a08..330be1a 100644
--- a/src/dev/dma_device.hh
+++ b/src/dev/dma_device.hh
@@ -49,7 +49,6 @@
#include "base/circlebuf.hh"
#include "dev/io_device.hh"
#include "mem/backdoor.hh"
-#include "mem/port_proxy.hh"
#include "params/DmaDevice.hh"
#include "sim/drain.hh"
#include "sim/system.hh"
@@ -508,7 +507,6 @@
const Request::Flags reqFlags;
DmaPort &port;
- PortProxy proxy;
const int cacheLineSize;
@@ -554,8 +552,8 @@
/** Try to issue new DMA requests during normal execution*/
void resumeFillTiming();
- /** Try to bypass DMA requests in KVM execution mode */
- void resumeFillFunctional();
+ /** Try to bypass DMA requests in non-caching mode */
+ void resumeFillBypass();
private: // Internal state
Fifo<uint8_t> buffer;
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38720
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I5e959288eb533d09cffa7b79938aa2f61e4aff7d
Gerrit-Change-Number: 38720
Gerrit-PatchSet: 13
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s