Go to the documentation of this file.
41 #ifndef __DEV_DMA_DEVICE_HH__
42 #define __DEV_DMA_DEVICE_HH__
49 #include "params/DmaDevice.hh"
149 uint32_t sid = 0, uint32_t ssid = 0);
157 uint8_t *
data, uint32_t sid, uint32_t ssid,
Tick delay,
176 uint32_t sid, uint32_t ssid,
Tick delay = 0)
189 uint32_t sid, uint32_t ssid,
Tick delay = 0)
203 void init()
override;
223 virtual const std::string
name()
const {
return "DmaCallback"; }
329 unsigned max_req_size,
330 unsigned max_pending,
363 return tryGet(
static_cast<T *
>(&value),
sizeof(T));
374 void get(uint8_t *dst,
size_t len);
379 get(
static_cast<uint8_t *
>(&value),
sizeof(T));
526 #endif // __DEV_DMA_DEVICE_HH__
bool tryGet(uint8_t *dst, size_t len)
Try to read data from the FIFO.
std::deque< PacketPtr > transmitList
Use a deque as we never do any insertion or removal in the middle.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void startFill(Addr start, size_t size)
Start filling the FIFO.
void flush()
Flush the FIFO.
std::unique_ptr< DmaDoneEvent > DmaDoneEventUPtr
const PortID InvalidPortID
const uint8_t * data() const
std::deque< DmaDoneEventUPtr > freeRequests
Basic support for object serialization.
void queueDma(PacketPtr pkt)
DrainState drain() override
DmaPort ensures that all oustanding DMA accesses have completed before it finishes draining.
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
void trySendTimingReq()
Take the first packet of the transmit list and attempt to send it as a timing request.
uint64_t Tick
Tick count type.
void chunkComplete()
Called by DMA engine completion event on each chunk completion.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Addr numBytes
Number of bytes that have been acked for this transaction.
const Tick delay
Amount to delay completion of dma by.
std::shared_ptr< Request > RequestPtr
unsigned int cacheBlockSize() const
const RequestorID requestorId
Id for all requests.
const uint32_t defaultSid
Default streamId.
void stopFill()
Stop the DMA engine.
void handlePending()
Handle pending requests that have been flagged as done.
EventFunctionWrapper sendEvent
Event used to schedule a future sending from the transmit list.
ClockedObject *const device
The device that owns this port.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
const Request::Flags reqFlags
Request flags.
@ Drained
Buffers drained, ready for serialization/handover.
const Addr maxReqSize
Maximum request size in bytes.
Command
List of all commands associated with a packet.
DrainState
Object drain/handover states.
virtual void onIdle()
Last response received callback.
void dmaRead(Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0)
This device is the base class which all devices senstive to an address range inherit from.
void dmaWrite(Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0)
A virtual base opaque structure used to hold state associated with the packet (e.g....
Interface for objects that might require draining before checkpointing.
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
void resumeFillFunctional()
Try to bypass DMA requests in KVM execution mode.
void handleResp(PacketPtr pkt, Tick delay=0)
Handle a response packet by updating the corresponding DMA request state to reflect the bytes receive...
Ports are used to interface objects to each other.
DmaDevice(const Params *p)
size_t requestSize() const
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
virtual const std::string name() const
std::vector< uint8_t > _data
void signalDrainDone() const
Signal that an object is drained.
Buffered DMA engine helper class.
void dmaRead(Addr addr, int size, Event *event, uint8_t *data, Tick delay=0)
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Event * getChunkEvent()
Request a chunk event.
DmaReqState(Event *ce, Addr tb, Tick _delay)
const size_t fifoSize
Maximum FIFO size in bytes.
void dmaDone()
DMA request done, handle incoming data and issue new request.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
System *const sys
The system that device/port are in.
RequestPtr dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag=0)
DmaDoneEvent(DmaReadFifo *_parent, size_t max_size)
void resumeFill()
Try to issue new DMA requests or bypass DMA requests.
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void resumeFillTiming()
Try to issue new DMA requests during normal execution.
Event * completionEvent
Event to call on the device when this transaction (all packets) complete.
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
virtual void process()=0
Callback function invoked on completion of all chunks.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
std::deque< DmaDoneEventUPtr > pendingRequests
virtual void onEndOfBlock()
End of block callback.
void dmaWrite(Addr addr, int size, Event *event, uint8_t *data, Tick delay=0)
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
uint32_t pendingCount
Number of outstanding packets the dma port has.
void sendDma()
For timing, attempt to send the first item on the transmit list, and if it is successful and there ar...
bool atEndOfBlock() const
Has the DMA engine sent out the last request for the active block?
size_t size() const
Get the amount of data stored in the FIFO.
const Addr totBytes
Total number of bytes that this transaction involves.
std::ostream CheckpointOut
bool isActive() const
Is the DMA engine active (i.e., are there still in-flight accesses)?
const uint32_t defaultSSid
Default substreamId.
DmaPort(ClockedObject *dev, System *s, uint32_t sid=0, uint32_t ssid=0)
unsigned int cacheLineSize() const
Get the cache line size of the system.
bool inRetry
If the port is currently waiting for a retry before it can send whatever it is that it's sending.
DmaReadFifo(DmaPort &port, size_t size, unsigned max_req_size, unsigned max_pending, Request::Flags flags=0)
@ Draining
Draining buffers pending serialization/handover.
Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17