doDmaWrite();
}
+void
+IdeDisk::regStats()
+{
+ using namespace Stats;
+ dmaReadFullPages
+ .name(name() + ".dma_read_full_pages")
+ .desc("Number of full page size DMA reads (not PRD).")
+ ;
+ dmaReadBytes
+ .name(name() + ".dma_read_bytes")
+ .desc("Number of bytes transfered via DMA reads (not PRD).")
+ ;
+ dmaReadTxs
+ .name(name() + ".dma_read_txs")
+ .desc("Number of DMA read transactions (not PRD).")
+ ;
+
+ dmaWriteFullPages
+ .name(name() + ".dma_write_full_pages")
+ .desc("Number of full page size DMA writes.")
+ ;
+ dmaWriteBytes
+ .name(name() + ".dma_write_bytes")
+ .desc("Number of bytes transfered via DMA writes.")
+ ;
+ dmaWriteTxs
+ .name(name() + ".dma_write_txs")
+ .desc("Number of DMA write transactions.")
+ ;
+}
+
void
IdeDisk::doDmaRead()
{
dmaInterfaceBytes = bytesInPage;
+ if (bytesInPage == TheISA::VMPageSize)
+ dmaReadFullPages++;
+ dmaReadBytes += bytesInPage;
+ dmaReadTxs++;
dmaInterface->doDMA(Read, dmaAddr, bytesInPage,
curTick + totalDiskDelay, &dmaReadEvent);
} else {
bytesInPage = bytesInDmaPage(curAddr, bytesLeft);
dmaInterfaceBytes += bytesInPage;
+ if (bytesInPage == TheISA::VMPageSize)
+ dmaReadFullPages++;
+ dmaReadBytes += bytesInPage;
+ dmaReadTxs++;
+
dmaInterface->doDMA(Read, dmaAddr, bytesInPage,
curTick, &dmaReadEvent);
dmaInterfaceBytes = bytesInPage;
+ if (bytesInPage == TheISA::VMPageSize)
+ dmaWriteFullPages++;
+ dmaWriteBytes += bytesInPage;
+ dmaWriteTxs++;
+
dmaInterface->doDMA(WriteInvalidate, dmaAddr,
bytesInPage, curTick + totalDiskDelay,
&dmaWriteEvent);
bytesInPage = bytesInDmaPage(curAddr, bytesLeft);
dmaInterfaceBytes += bytesInPage;
+ if (bytesInPage == TheISA::VMPageSize)
+ dmaWriteFullPages++;
+ dmaWriteBytes += bytesInPage;
+ dmaWriteTxs++;
+
dmaInterface->doDMA(WriteInvalidate, dmaAddr,
bytesInPage, curTick,
&dmaWriteEvent);
#ifndef __IDE_DISK_HH__
#define __IDE_DISK_HH__
+#include "base/statistics.hh"
#include "dev/disk_image.hh"
#include "dev/ide_atareg.h"
#include "dev/ide_ctrl.hh"
/** Interrupt pending */
bool intrPending;
+ Stats::Scalar<> dmaReadFullPages;
+ Stats::Scalar<> dmaReadBytes;
+ Stats::Scalar<> dmaReadTxs;
+ Stats::Scalar<> dmaWriteFullPages;
+ Stats::Scalar<> dmaWriteBytes;
+ Stats::Scalar<> dmaWriteTxs;
+
public:
/**
* Create and initialize this Disk.
*/
void reset(int id);
+ /**
+ * Register statistics.
+ */
+ void regStats();
+
+
/**
* Set the controller for this device
* @param c The IDE controller