#include <algorithm>
+#include "base/cp_annotate.hh"
#include "base/trace.hh"
#include "dev/copy_engine.hh"
#include "mem/packet.hh"
void
CopyEngine::CopyEngineChannel::fetchDescriptor(Addr address)
{
+ anDq();
+ anBegin("FetchDescriptor");
DPRINTF(DMACopyEngine, "Reading descriptor from at memory location %#x(%#x)\n",
address, ce->platform->pciToDma(address));
assert(address);
if (inDrain()) return;
writeCompletionStatus();
} else {
+ anBegin("Idle");
+ anWait();
busy = false;
nextState = Idle;
inDrain();
void
CopyEngine::CopyEngineChannel::readCopyBytes()
{
+ anBegin("ReadCopyBytes");
DPRINTF(DMACopyEngine, "Reading %d bytes from buffer to memory location %#x(%#x)\n",
curDmaDesc->len, curDmaDesc->dest,
ce->platform->pciToDma(curDmaDesc->src));
void
CopyEngine::CopyEngineChannel::writeCopyBytes()
{
+ anBegin("WriteCopyBytes");
DPRINTF(DMACopyEngine, "Writing %d bytes from buffer to memory location %#x(%#x)\n",
curDmaDesc->len, curDmaDesc->dest,
ce->platform->pciToDma(curDmaDesc->dest));
cr.status.compl_desc_addr(lastDescriptorAddr >> 6);
completionDataReg = cr.status() | 1;
+ anQ("DMAUsedDescQ", channelId, 1);
+ anQ("AppRecvQ", curDmaDesc->user1, curDmaDesc->len);
if (curDmaDesc->command & DESC_CTRL_CP_STS) {
nextState = CompletionWrite;
if (inDrain()) return;
busy = false;
if (underReset) {
+ anBegin("Reset");
+ anWait();
underReset = false;
refreshNext = false;
busy = false;
} else {
inDrain();
nextState = Idle;
+ anWait();
+ anBegin("Idle");
}
}
void
CopyEngine::CopyEngineChannel::writeCompletionStatus()
{
+ anBegin("WriteCompletionStatus");
DPRINTF(DMACopyEngine, "Writing completion status %#x to address %#x(%#x)\n",
completionDataReg, cr.completionAddr,
ce->platform->pciToDma(cr.completionAddr));
void
CopyEngine::CopyEngineChannel::fetchNextAddr(Addr address)
{
+ anBegin("FetchNextAddr");
DPRINTF(DMACopyEngine, "Fetching next address...\n");
busy = true;
cePort->dmaAction(MemCmd::ReadReq, ce->platform->pciToDma(address +
DPRINTF(DMACopyEngine, "Got NULL descriptor, nothing more to do\n");
busy = false;
nextState = Idle;
+ anWait();
+ anBegin("Idle");
inDrain();
return;
}