gem5  v20.1.0.0
dma_device.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, 2015, 2017, 2019 ARM Limited
3  * All rights reserved.
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2006 The Regents of The University of Michigan
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #include "dev/dma_device.hh"
42 
43 #include <utility>
44 
45 #include "base/chunk_generator.hh"
46 #include "debug/DMA.hh"
47 #include "debug/Drain.hh"
48 #include "mem/port_proxy.hh"
49 #include "sim/clocked_object.hh"
50 #include "sim/system.hh"
51 
53  uint32_t sid, uint32_t ssid)
54  : RequestPort(dev->name() + ".dma", dev),
55  device(dev), sys(s), requestorId(s->getRequestorId(dev)),
56  sendEvent([this]{ sendDma(); }, dev->name()),
57  pendingCount(0), inRetry(false),
58  defaultSid(sid),
59  defaultSSid(ssid)
60 { }
61 
62 void
64 {
65  // should always see a response with a sender state
66  assert(pkt->isResponse());
67 
68  // get the DMA sender state
69  DmaReqState *state = dynamic_cast<DmaReqState*>(pkt->senderState);
70  assert(state);
71 
72  DPRINTF(DMA, "Received response %s for addr: %#x size: %d nb: %d," \
73  " tot: %d sched %d\n",
74  pkt->cmdString(), pkt->getAddr(), pkt->req->getSize(),
75  state->numBytes, state->totBytes,
76  state->completionEvent ?
77  state->completionEvent->scheduled() : 0);
78 
79  assert(pendingCount != 0);
80  pendingCount--;
81 
82  // update the number of bytes received based on the request rather
83  // than the packet as the latter could be rounded up to line sizes
84  state->numBytes += pkt->req->getSize();
85  assert(state->totBytes >= state->numBytes);
86 
87  // if we have reached the total number of bytes for this DMA
88  // request, then signal the completion and delete the sate
89  if (state->totBytes == state->numBytes) {
90  if (state->completionEvent) {
91  delay += state->delay;
92  device->schedule(state->completionEvent, curTick() + delay);
93  }
94  delete state;
95  }
96 
97  // delete the packet
98  delete pkt;
99 
100  // we might be drained at this point, if so signal the drain event
101  if (pendingCount == 0)
102  signalDrainDone();
103 }
104 
105 bool
107 {
108  // We shouldn't ever get a cacheable block in Modified state
109  assert(pkt->req->isUncacheable() ||
110  !(pkt->cacheResponding() && !pkt->hasSharers()));
111 
112  handleResp(pkt);
113 
114  return true;
115 }
116 
118  : PioDevice(p), dmaPort(this, sys, p->sid, p->ssid)
119 { }
120 
121 void
123 {
124  if (!dmaPort.isConnected())
125  panic("DMA port of %s not connected to anything!", name());
126  PioDevice::init();
127 }
128 
131 {
132  if (pendingCount == 0) {
133  return DrainState::Drained;
134  } else {
135  DPRINTF(Drain, "DmaPort not drained\n");
136  return DrainState::Draining;
137  }
138 }
139 
140 void
142 {
143  assert(transmitList.size());
145 }
146 
149  uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay,
150  Request::Flags flag)
151 {
152  // one DMA request sender state for every action, that is then
153  // split into many requests and packets based on the block size,
154  // i.e. cache line size
155  DmaReqState *reqState = new DmaReqState(event, size, delay);
156 
157  // (functionality added for Table Walker statistics)
158  // We're only interested in this when there will only be one request.
159  // For simplicity, we return the last request, which would also be
160  // the only request in that case.
161  RequestPtr req = NULL;
162 
163  DPRINTF(DMA, "Starting DMA for addr: %#x size: %d sched: %d\n", addr, size,
164  event ? event->scheduled() : -1);
165  for (ChunkGenerator gen(addr, size, sys->cacheLineSize());
166  !gen.done(); gen.next()) {
167 
168  req = std::make_shared<Request>(
169  gen.addr(), gen.size(), flag, requestorId);
170 
171  req->setStreamId(sid);
172  req->setSubStreamId(ssid);
173 
174  req->taskId(ContextSwitchTaskId::DMA);
175  PacketPtr pkt = new Packet(req, cmd);
176 
177  // Increment the data pointer on a write
178  if (data)
179  pkt->dataStatic(data + gen.complete());
180 
181  pkt->senderState = reqState;
182 
183  DPRINTF(DMA, "--Queuing DMA for addr: %#x size: %d\n", gen.addr(),
184  gen.size());
185  queueDma(pkt);
186  }
187 
188  // in zero time also initiate the sending of the packets we have
189  // just created, for atomic this involves actually completing all
190  // the requests
191  sendDma();
192 
193  return req;
194 }
195 
198  uint8_t *data, Tick delay, Request::Flags flag)
199 {
200  return dmaAction(cmd, addr, size, event, data,
201  defaultSid, defaultSSid, delay, flag);
202 }
203 
204 void
206 {
207  transmitList.push_back(pkt);
208 
209  // remember that we have another packet pending, this will only be
210  // decremented once a response comes back
211  pendingCount++;
212 }
213 
214 void
216 {
217  // send the first packet on the transmit list and schedule the
218  // following send if it is successful
219  PacketPtr pkt = transmitList.front();
220 
221  DPRINTF(DMA, "Trying to send %s addr %#x\n", pkt->cmdString(),
222  pkt->getAddr());
223 
224  inRetry = !sendTimingReq(pkt);
225  if (!inRetry) {
226  transmitList.pop_front();
227  DPRINTF(DMA, "-- Done\n");
228  // if there is more to do, then do so
229  if (!transmitList.empty())
230  // this should ultimately wait for as many cycles as the
231  // device needs to send the packet, but currently the port
232  // does not have any known width so simply wait a single
233  // cycle
235  } else {
236  DPRINTF(DMA, "-- Failed, waiting for retry\n");
237  }
238 
239  DPRINTF(DMA, "TransmitList: %d, inRetry: %d\n",
240  transmitList.size(), inRetry);
241 }
242 
243 void
245 {
246  // some kind of selcetion between access methods
247  // more work is going to have to be done to make
248  // switching actually work
249  assert(transmitList.size());
250 
251  if (sys->isTimingMode()) {
252  // if we are either waiting for a retry or are still waiting
253  // after sending the last packet, then do not proceed
254  if (inRetry || sendEvent.scheduled()) {
255  DPRINTF(DMA, "Can't send immediately, waiting to send\n");
256  return;
257  }
258 
260  } else if (sys->isAtomicMode()) {
261  // send everything there is to send in zero time
262  while (!transmitList.empty()) {
263  PacketPtr pkt = transmitList.front();
264  transmitList.pop_front();
265 
266  DPRINTF(DMA, "Sending DMA for addr: %#x size: %d\n",
267  pkt->req->getPaddr(), pkt->req->getSize());
268  Tick lat = sendAtomic(pkt);
269 
270  handleResp(pkt, lat);
271  }
272  } else
273  panic("Unknown memory mode.");
274 }
275 
276 Port &
277 DmaDevice::getPort(const std::string &if_name, PortID idx)
278 {
279  if (if_name == "dma") {
280  return dmaPort;
281  }
282  return PioDevice::getPort(if_name, idx);
283 }
284 
285 DmaReadFifo::DmaReadFifo(DmaPort &_port, size_t size,
286  unsigned max_req_size,
287  unsigned max_pending,
288  Request::Flags flags)
289  : maxReqSize(max_req_size), fifoSize(size),
290  reqFlags(flags), port(_port),
291  buffer(size),
292  nextAddr(0), endAddr(0)
293 {
294  freeRequests.resize(max_pending);
295  for (auto &e : freeRequests)
296  e.reset(new DmaDoneEvent(this, max_req_size));
297 
298 }
299 
301 {
302  for (auto &p : pendingRequests) {
303  DmaDoneEvent *e(p.release());
304 
305  if (e->done()) {
306  delete e;
307  } else {
308  // We can't kill in-flight DMAs, so we'll just transfer
309  // ownership to the event queue so that they get freed
310  // when they are done.
311  e->kill();
312  }
313  }
314 }
315 
316 void
318 {
319  assert(pendingRequests.empty());
320 
324 }
325 
326 void
328 {
332 }
333 
334 bool
335 DmaReadFifo::tryGet(uint8_t *dst, size_t len)
336 {
337  if (buffer.size() >= len) {
338  buffer.read(dst, len);
339  resumeFill();
340  return true;
341  } else {
342  return false;
343  }
344 }
345 
346 void
347 DmaReadFifo::get(uint8_t *dst, size_t len)
348 {
349  const bool success(tryGet(dst, len));
350  panic_if(!success, "Buffer underrun in DmaReadFifo::get()\n");
351 }
352 
353 void
354 DmaReadFifo::startFill(Addr start, size_t size)
355 {
356  assert(atEndOfBlock());
357 
358  nextAddr = start;
359  endAddr = start + size;
360  resumeFill();
361 }
362 
363 void
365 {
366  // Prevent new DMA requests by setting the next address to the end
367  // address. Pending requests will still complete.
368  nextAddr = endAddr;
369 
370  // Flag in-flight accesses as canceled. This prevents their data
371  // from being written to the FIFO.
372  for (auto &p : pendingRequests)
373  p->cancel();
374 }
375 
376 void
378 {
379  // Don't try to fetch more data if we are draining. This ensures
380  // that the DMA engine settles down before we checkpoint it.
382  return;
383 
384  const bool old_eob(atEndOfBlock());
385 
386  if (port.sys->bypassCaches())
388  else
390 
391  if (!old_eob && atEndOfBlock())
392  onEndOfBlock();
393 }
394 
395 void
397 {
398  const size_t fifo_space = buffer.capacity() - buffer.size();
399  const size_t kvm_watermark = port.sys->cacheLineSize();
400  if (fifo_space >= kvm_watermark || buffer.capacity() < kvm_watermark) {
401  const size_t block_remaining = endAddr - nextAddr;
402  const size_t xfer_size = std::min(fifo_space, block_remaining);
403  std::vector<uint8_t> tmp_buffer(xfer_size);
404 
405  assert(pendingRequests.empty());
406  DPRINTF(DMA, "KVM Bypassing startAddr=%#x xfer_size=%#x " \
407  "fifo_space=%#x block_remaining=%#x\n",
408  nextAddr, xfer_size, fifo_space, block_remaining);
409 
410  port.sys->physProxy.readBlob(nextAddr, tmp_buffer.data(), xfer_size);
411  buffer.write(tmp_buffer.begin(), xfer_size);
412  nextAddr += xfer_size;
413  }
414 }
415 
416 void
418 {
419  size_t size_pending(0);
420  for (auto &e : pendingRequests)
421  size_pending += e->requestSize();
422 
423  while (!freeRequests.empty() && !atEndOfBlock()) {
424  const size_t req_size(std::min(maxReqSize, endAddr - nextAddr));
425  if (buffer.size() + size_pending + req_size > fifoSize)
426  break;
427 
428  DmaDoneEventUPtr event(std::move(freeRequests.front()));
429  freeRequests.pop_front();
430  assert(event);
431 
432  event->reset(req_size);
433  port.dmaAction(MemCmd::ReadReq, nextAddr, req_size, event.get(),
434  event->data(), 0, reqFlags);
435  nextAddr += req_size;
436  size_pending += req_size;
437 
438  pendingRequests.emplace_back(std::move(event));
439  }
440 }
441 
442 void
444 {
445  const bool old_active(isActive());
446 
447  handlePending();
448  resumeFill();
449 
450  if (old_active && !isActive())
451  onIdle();
452 }
453 
454 void
456 {
457  while (!pendingRequests.empty() && pendingRequests.front()->done()) {
458  // Get the first finished pending request
459  DmaDoneEventUPtr event(std::move(pendingRequests.front()));
460  pendingRequests.pop_front();
461 
462  if (!event->canceled())
463  buffer.write(event->data(), event->requestSize());
464 
465  // Move the event to the list of free requests
466  freeRequests.emplace_back(std::move(event));
467  }
468 
469  if (pendingRequests.empty())
470  signalDrainDone();
471 }
472 
475 {
477 }
478 
479 
481  size_t max_size)
482  : parent(_parent), _done(false), _canceled(false), _data(max_size, 0)
483 {
484 }
485 
486 void
488 {
489  parent = nullptr;
490  setFlags(AutoDelete);
491 }
492 
493 void
495 {
496  _canceled = true;
497 }
498 
499 void
501 {
502  assert(size <= _data.size());
503  _done = false;
504  _canceled = false;
505  _requestSize = size;
506 }
507 
508 void
510 {
511  if (!parent)
512  return;
513 
514  assert(!_done);
515  _done = true;
516  parent->dmaDone();
517 }
ArmISA::sendEvent
void sendEvent(ThreadContext *tc)
Send an event (SEV) to a specific PE if there isn't already a pending event.
Definition: utility.cc:165
DmaReadFifo::tryGet
bool tryGet(uint8_t *dst, size_t len)
Try to read data from the FIFO.
Definition: dma_device.cc:335
DmaPort::transmitList
std::deque< PacketPtr > transmitList
Use a deque as we never do any insertion or removal in the middle.
Definition: dma_device.hh:121
DmaReadFifo::nextAddr
Addr nextAddr
Definition: dma_device.hh:519
Event::scheduled
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:460
DmaReadFifo::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: dma_device.cc:317
DmaReadFifo::startFill
void startFill(Addr start, size_t size)
Start filling the FIFO.
Definition: dma_device.cc:354
Packet::isResponse
bool isResponse() const
Definition: packet.hh:560
system.hh
Packet::cacheResponding
bool cacheResponding() const
Definition: packet.hh:619
DmaReadFifo::DmaDoneEventUPtr
std::unique_ptr< DmaDoneEvent > DmaDoneEventUPtr
Definition: dma_device.hh:496
data
const char data[]
Definition: circlebuf.test.cc:42
Packet::hasSharers
bool hasSharers() const
Definition: packet.hh:646
System::isTimingMode
bool isTimingMode() const
Is the system in timing mode?
Definition: system.hh:269
UNSERIALIZE_SCALAR
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:797
Packet::getAddr
Addr getAddr() const
Definition: packet.hh:754
PioDevice::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: io_device.cc:56
UNSERIALIZE_CONTAINER
#define UNSERIALIZE_CONTAINER(member)
Definition: serialize.hh:856
System::physProxy
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
Definition: system.hh:324
Fifo::capacity
size_t capacity() const
Definition: circlebuf.hh:151
DmaReadFifo::freeRequests
std::deque< DmaDoneEventUPtr > freeRequests
Definition: dma_device.hh:523
Flags< FlagsType >
DmaPort::queueDma
void queueDma(PacketPtr pkt)
Definition: dma_device.cc:205
DmaPort::drain
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
Definition: dma_device.cc:130
DmaPort::trySendTimingReq
void trySendTimingReq()
Take the first packet of the transmit list and attempt to send it as a timing request.
Definition: dma_device.cc:215
MemCmd::ReadReq
@ ReadReq
Definition: packet.hh:82
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
DmaReadFifo::port
DmaPort & port
Definition: dma_device.hh:469
PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:237
DmaPort::DmaReqState::numBytes
Addr numBytes
Number of bytes that have been acked for this transaction.
Definition: dma_device.hh:98
DmaPort::DmaReqState::delay
const Tick delay
Amount to delay completion of dma by.
Definition: dma_device.hh:101
RequestPtr
std::shared_ptr< Request > RequestPtr
Definition: request.hh:82
Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:340
std::vector< uint8_t >
DmaPort::requestorId
const RequestorID requestorId
Id for all requests.
Definition: dma_device.hh:117
DmaPort::defaultSid
const uint32_t defaultSid
Default streamId.
Definition: dma_device.hh:134
DmaReadFifo::stopFill
void stopFill()
Stop the DMA engine.
Definition: dma_device.cc:364
DmaReadFifo::DmaDoneEvent
Definition: dma_device.hh:472
DmaPort::DmaReqState
Definition: dma_device.hh:88
ContextSwitchTaskId::DMA
@ DMA
Definition: request.hh:74
DmaReadFifo::get
T get()
Definition: dma_device.hh:377
DmaReadFifo::handlePending
void handlePending()
Handle pending requests that have been flagged as done.
Definition: dma_device.cc:455
DmaPort::sendEvent
EventFunctionWrapper sendEvent
Event used to schedule a future sending from the transmit list.
Definition: dma_device.hh:124
DmaPort::device
ClockedObject *const device
The device that owns this port.
Definition: dma_device.hh:110
DmaReadFifo::endAddr
Addr endAddr
Definition: dma_device.hh:520
ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:231
DmaReadFifo::reqFlags
const Request::Flags reqFlags
Request flags.
Definition: dma_device.hh:467
DmaReadFifo::buffer
Fifo< uint8_t > buffer
Definition: dma_device.hh:517
DmaReadFifo::~DmaReadFifo
~DmaReadFifo()
Definition: dma_device.cc:300
DrainState::Drained
@ Drained
Buffers drained, ready for serialization/handover.
DmaReadFifo::maxReqSize
const Addr maxReqSize
Maximum request size in bytes.
Definition: dma_device.hh:458
MemCmd::Command
Command
List of all commands associated with a packet.
Definition: packet.hh:79
DmaDevice::dmaPort
DmaPort dmaPort
Definition: dma_device.hh:168
DrainState
DrainState
Object drain/handover states.
Definition: drain.hh:71
Fifo::write
void write(InputIterator in, size_t len)
Definition: circlebuf.hh:161
DmaReadFifo::onIdle
virtual void onIdle()
Last response received callback.
Definition: dma_device.hh:458
Fifo::read
void read(OutputIterator out, size_t len)
Definition: circlebuf.hh:158
cp
Definition: cprintf.cc:40
PioDevice
This device is the base class which all devices senstive to an address range inherit from.
Definition: io_device.hh:99
dma_device.hh
EventManager::schedule
void schedule(Event &event, Tick when)
Definition: eventq.hh:1005
Fifo::size
size_t size() const
Definition: circlebuf.hh:150
RequestPort::sendTimingReq
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the responder port by calling its corresponding receive function.
Definition: port.hh:492
Event
Definition: eventq.hh:246
DmaReadFifo::drain
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
Definition: dma_device.cc:474
System
Definition: system.hh:73
PioDevice::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: io_device.cc:64
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:234
DmaReadFifo::resumeFillFunctional
void resumeFillFunctional()
Try to bypass DMA requests in KVM execution mode.
Definition: dma_device.cc:396
Packet::cmdString
const std::string & cmdString() const
Return the string name of the cmd field (for debugging and tracing).
Definition: packet.hh:551
DmaPort::handleResp
void handleResp(PacketPtr pkt, Tick delay=0)
Handle a response packet by updating the corresponding DMA request state to reflect the bytes receive...
Definition: dma_device.cc:63
MipsISA::event
Bitfield< 10, 5 > event
Definition: pra_constants.hh:297
Port
Ports are used to interface objects to each other.
Definition: port.hh:56
DmaDevice::DmaDevice
DmaDevice(const Params *p)
Definition: dma_device.cc:117
port_proxy.hh
Clocked::clockEdge
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
Definition: clocked_object.hh:174
DmaDevice::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: dma_device.cc:277
DmaReadFifo::DmaDoneEvent::reset
void reset(size_t size)
Definition: dma_device.cc:500
System::bypassCaches
bool bypassCaches() const
Should caches be bypassed?
Definition: system.hh:279
Drainable::signalDrainDone
void signalDrainDone() const
Signal that an object is drained.
Definition: drain.hh:301
DmaReadFifo::DmaDoneEvent::kill
void kill()
Definition: dma_device.cc:487
DmaReadFifo
Buffered DMA engine helper class.
Definition: dma_device.hh:325
RequestPort
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Definition: port.hh:74
DmaReadFifo::fifoSize
const size_t fifoSize
Maximum FIFO size in bytes.
Definition: dma_device.hh:465
DmaReadFifo::dmaDone
void dmaDone()
DMA request done, handle incoming data and issue new request.
Definition: dma_device.cc:443
ProbePoints::Packet
ProbePointArg< PacketInfo > Packet
Packet probe point.
Definition: mem.hh:103
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
DmaPort::sys
System *const sys
The system that device/port are in.
Definition: dma_device.hh:114
ChunkGenerator::done
bool done() const
Are we done? That is, did the last call to next() advance past the end of the region?
Definition: chunk_generator.hh:137
name
const std::string & name()
Definition: trace.cc:50
SERIALIZE_SCALAR
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:790
DmaPort::dmaAction
RequestPtr dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, uint8_t *data, Tick delay, Request::Flags flag=0)
Definition: dma_device.cc:197
DmaReadFifo::DmaDoneEvent::DmaDoneEvent
DmaDoneEvent(DmaReadFifo *_parent, size_t max_size)
Definition: dma_device.cc:480
DmaReadFifo::resumeFill
void resumeFill()
Try to issue new DMA requests or bypass DMA requests.
Definition: dma_device.cc:377
DmaDevice::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: dma_device.cc:122
ArmISA::e
Bitfield< 9 > e
Definition: miscregs_types.hh:61
Drainable::drainState
DrainState drainState() const
Return the current drain state of an object.
Definition: drain.hh:320
DmaReadFifo::resumeFillTiming
void resumeFillTiming()
Try to issue new DMA requests during normal execution.
Definition: dma_device.cc:417
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:133
DmaPort::DmaReqState::completionEvent
Event * completionEvent
Event to call on the device when this transaction (all packets) complete.
Definition: dma_device.hh:92
DmaPort::recvReqRetry
void recvReqRetry() override
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition: dma_device.cc:141
DmaReadFifo::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: dma_device.cc:327
DmaPort::recvTimingResp
bool recvTimingResp(PacketPtr pkt) override
Receive a timing response from the peer.
Definition: dma_device.cc:106
panic_if
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:197
DmaReadFifo::pendingRequests
std::deque< DmaDoneEventUPtr > pendingRequests
Definition: dma_device.hh:522
DmaReadFifo::onEndOfBlock
virtual void onEndOfBlock()
End of block callback.
Definition: dma_device.hh:445
DmaReadFifo::DmaDoneEvent::cancel
void cancel()
Definition: dma_device.cc:494
Packet::dataStatic
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
Definition: packet.hh:1107
clocked_object.hh
SERIALIZE_CONTAINER
#define SERIALIZE_CONTAINER(member)
Definition: serialize.hh:848
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
DmaPort::pendingCount
uint32_t pendingCount
Number of outstanding packets the dma port has.
Definition: dma_device.hh:127
ArmISA::len
Bitfield< 18, 16 > len
Definition: miscregs_types.hh:439
addr
ip6_addr_t addr
Definition: inet.hh:423
Port::isConnected
bool isConnected() const
Is this port currently connected to a peer?
Definition: port.hh:128
DmaPort::sendDma
void sendDma()
For timing, attempt to send the first item on the transmit list, and if it is successful and there ar...
Definition: dma_device.cc:244
DmaReadFifo::atEndOfBlock
bool atEndOfBlock() const
Has the DMA engine sent out the last request for the active block?
Definition: dma_device.hh:420
Cycles
Cycles is a wrapper class for representing cycle counts, i.e.
Definition: types.hh:83
chunk_generator.hh
DmaReadFifo::size
size_t size() const
Get the amount of data stored in the FIFO.
Definition: dma_device.hh:384
DmaPort::DmaReqState::totBytes
const Addr totBytes
Total number of bytes that this transaction involves.
Definition: dma_device.hh:95
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
DmaReadFifo::isActive
bool isActive() const
Is the DMA engine active (i.e., are there still in-flight accesses)?
Definition: dma_device.hh:428
ChunkGenerator
This class takes an arbitrary memory region (address/length pair) and generates a series of appropria...
Definition: chunk_generator.hh:55
DmaPort::defaultSSid
const uint32_t defaultSSid
Default substreamId.
Definition: dma_device.hh:137
Packet::senderState
SenderState * senderState
This packet's sender state.
Definition: packet.hh:508
RequestPort::sendAtomic
Tick sendAtomic(PacketPtr pkt)
Send an atomic request packet, where the data is moved and the state is updated in zero time,...
Definition: port.hh:461
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
DmaPort::DmaPort
DmaPort(ClockedObject *dev, System *s, uint32_t sid=0, uint32_t ssid=0)
Definition: dma_device.cc:52
System::cacheLineSize
unsigned int cacheLineSize() const
Get the cache line size of the system.
Definition: system.hh:307
ArmISA::s
Bitfield< 4 > s
Definition: miscregs_types.hh:556
CheckpointIn
Definition: serialize.hh:67
DmaPort::inRetry
bool inRetry
If the port is currently waiting for a retry before it can send whatever it is that it's sending.
Definition: dma_device.hh:131
PortProxy::readBlob
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Definition: port_proxy.hh:177
DmaReadFifo::DmaReadFifo
DmaReadFifo(DmaPort &port, size_t size, unsigned max_req_size, unsigned max_pending, Request::Flags flags=0)
Definition: dma_device.cc:285
System::isAtomicMode
bool isAtomicMode() const
Is the system in atomic mode?
Definition: system.hh:258
DmaPort
Definition: dma_device.hh:55
DmaDevice::Params
DmaDeviceParams Params
Definition: dma_device.hh:171
DrainState::Draining
@ Draining
Draining buffers pending serialization/handover.
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
DmaReadFifo::DmaDoneEvent::process
void process()
Definition: dma_device.cc:509
curTick
Tick curTick()
The current simulated tick.
Definition: core.hh:45

Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17