summaryrefslogtreecommitdiff
path: root/src/dev/copy_engine.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2009-02-26 19:29:17 -0500
committerAli Saidi <saidi@eecs.umich.edu>2009-02-26 19:29:17 -0500
commitbebbc9dc8901d82954988d019d54bf5dee2d1a90 (patch)
tree54e552c9ab15e3fa204dd3674e49a08dda801466 /src/dev/copy_engine.cc
parentd447ccb2c61a9225e5663ac29c999ac0a52a412f (diff)
downloadgem5-bebbc9dc8901d82954988d019d54bf5dee2d1a90.tar.xz
CPA: Add annotations to IGbE and CopyEngine device models.
Diffstat (limited to 'src/dev/copy_engine.cc')
-rw-r--r--src/dev/copy_engine.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/dev/copy_engine.cc b/src/dev/copy_engine.cc
index 46d3127e7..3c759ac1d 100644
--- a/src/dev/copy_engine.cc
+++ b/src/dev/copy_engine.cc
@@ -34,6 +34,7 @@
#include <algorithm>
+#include "base/cp_annotate.hh"
#include "base/trace.hh"
#include "dev/copy_engine.hh"
#include "mem/packet.hh"
@@ -427,6 +428,8 @@ CopyEngine::regStats()
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);
@@ -455,6 +458,8 @@ CopyEngine::CopyEngineChannel::fetchDescComplete()
if (inDrain()) return;
writeCompletionStatus();
} else {
+ anBegin("Idle");
+ anWait();
busy = false;
nextState = Idle;
inDrain();
@@ -473,6 +478,7 @@ CopyEngine::CopyEngineChannel::fetchDescComplete()
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));
@@ -493,6 +499,7 @@ CopyEngine::CopyEngineChannel::readCopyBytesComplete()
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));
@@ -513,6 +520,8 @@ CopyEngine::CopyEngineChannel::writeCopyBytesComplete()
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;
@@ -529,6 +538,8 @@ CopyEngine::CopyEngineChannel::continueProcessing()
busy = false;
if (underReset) {
+ anBegin("Reset");
+ anWait();
underReset = false;
refreshNext = false;
busy = false;
@@ -549,12 +560,15 @@ CopyEngine::CopyEngineChannel::continueProcessing()
} 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));
@@ -574,6 +588,7 @@ CopyEngine::CopyEngineChannel::writeStatusComplete()
void
CopyEngine::CopyEngineChannel::fetchNextAddr(Addr address)
{
+ anBegin("FetchNextAddr");
DPRINTF(DMACopyEngine, "Fetching next address...\n");
busy = true;
cePort->dmaAction(MemCmd::ReadReq, ce->platform->pciToDma(address +
@@ -590,6 +605,8 @@ CopyEngine::CopyEngineChannel::fetchAddrComplete()
DPRINTF(DMACopyEngine, "Got NULL descriptor, nothing more to do\n");
busy = false;
nextState = Idle;
+ anWait();
+ anBegin("Idle");
inDrain();
return;
}