abstract = True
dma = MasterPort("DMA port")
+ sid = Param.Unsigned(0,
+ "Stream identifier used by an IOMMU to distinguish amongst "
+ "several devices attached to it")
+ ssid = Param.Unsigned(0,
+ "Substream identifier used by an IOMMU to distinguish amongst "
+ "several devices attached to it")
+
class IsaFake(BasicPioDevice):
type = 'IsaFake'
/*
- * Copyright (c) 2012, 2015, 2017 ARM Limited
+ * Copyright (c) 2012, 2015, 2017, 2019 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
#include "sim/clocked_object.hh"
#include "sim/system.hh"
-DmaPort::DmaPort(ClockedObject *dev, System *s)
+DmaPort::DmaPort(ClockedObject *dev, System *s,
+ uint32_t sid, uint32_t ssid)
: MasterPort(dev->name() + ".dma", dev),
device(dev), sys(s), masterId(s->getMasterId(dev)),
sendEvent([this]{ sendDma(); }, dev->name()),
- pendingCount(0), inRetry(false)
+ pendingCount(0), inRetry(false),
+ defaultSid(sid),
+ defaultSSid(ssid)
{ }
void
}
DmaDevice::DmaDevice(const Params *p)
- : PioDevice(p), dmaPort(this, sys)
+ : PioDevice(p), dmaPort(this, sys, p->sid, p->ssid)
{ }
void
RequestPtr
DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
- uint8_t *data, Tick delay, Request::Flags flag)
+ uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay,
+ Request::Flags flag)
{
// one DMA request sender state for every action, that is then
// split into many requests and packets based on the block size,
req = std::make_shared<Request>(
gen.addr(), gen.size(), flag, masterId);
+ req->setStreamId(sid);
+ req->setSubStreamId(ssid);
+
req->taskId(ContextSwitchTaskId::DMA);
PacketPtr pkt = new Packet(req, cmd);
return req;
}
+RequestPtr
+DmaPort::dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
+ uint8_t *data, Tick delay, Request::Flags flag)
+{
+ return dmaAction(cmd, addr, size, event, data,
+ defaultSid, defaultSSid, delay, flag);
+}
+
void
DmaPort::queueDma(PacketPtr pkt)
{
return PioDevice::getPort(if_name, idx);
}
-
-
-
-
DmaReadFifo::DmaReadFifo(DmaPort &_port, size_t size,
unsigned max_req_size,
unsigned max_pending,
/*
- * Copyright (c) 2012-2013, 2015, 2017 ARM Limited
+ * Copyright (c) 2012-2013, 2015, 2017, 2019 ARM Limited
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
* send whatever it is that it's sending. */
bool inRetry;
+ /** Default streamId */
+ const uint32_t defaultSid;
+
+ /** Default substreamId */
+ const uint32_t defaultSSid;
+
protected:
bool recvTimingResp(PacketPtr pkt) override;
public:
- DmaPort(ClockedObject *dev, System *s);
+ DmaPort(ClockedObject *dev, System *s,
+ uint32_t sid = 0, uint32_t ssid = 0);
+
+ RequestPtr
+ dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
+ uint8_t *data, Tick delay, Request::Flags flag = 0);
- RequestPtr dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
- uint8_t *data, Tick delay, Request::Flags flag = 0);
+ RequestPtr
+ dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
+ uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay,
+ Request::Flags flag = 0);
bool dmaPending() const { return pendingCount > 0; }
DmaDevice(const Params *p);
virtual ~DmaDevice() { }
+ void dmaWrite(Addr addr, int size, Event *event, uint8_t *data,
+ uint32_t sid, uint32_t ssid, Tick delay = 0)
+ {
+ dmaPort.dmaAction(MemCmd::WriteReq, addr, size, event, data,
+ sid, ssid, delay);
+ }
+
void dmaWrite(Addr addr, int size, Event *event, uint8_t *data,
Tick delay = 0)
{
dmaPort.dmaAction(MemCmd::WriteReq, addr, size, event, data, delay);
}
+ void dmaRead(Addr addr, int size, Event *event, uint8_t *data,
+ uint32_t sid, uint32_t ssid, Tick delay = 0)
+ {
+ dmaPort.dmaAction(MemCmd::ReadReq, addr, size, event, data,
+ sid, ssid, delay);
+ }
+
void dmaRead(Addr addr, int size, Event *event, uint8_t *data,
Tick delay = 0)
{