fix ide stats and make sinic compile after merge.
authorAli Saidi <saidi@eecs.umich.edu>
Thu, 18 May 2006 16:52:16 +0000 (12:52 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Thu, 18 May 2006 16:52:16 +0000 (12:52 -0400)
dev/ide_disk.cc:
    fix dma stats
dev/sinic.cc:
    make sinic compile

--HG--
extra : convert_revision : fbea04ca58f6ab52e98108f7c2b12917c2fe22d6

dev/ide_disk.cc
dev/sinic.cc

index 6f4234a1dc32b348b4ae902b8b8bdc32c6561a80..909f35c6029d8b2258f648d53fb3c286c602d12f 100644 (file)
@@ -353,6 +353,36 @@ IdeDisk::doDmaDataRead()
     dmaReadWaitEvent.schedule(curTick + totalDiskDelay);
 }
 
+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()
@@ -373,6 +403,10 @@ IdeDisk::doDmaRead()
         assert(dmaReadCG->complete() < MAX_DMA_SIZE);
         ctrl->dmaRead(pciToDma(dmaReadCG->addr()), dmaReadCG->size(),
                 &dmaReadWaitEvent, dataBuffer + dmaReadCG->complete());
+        dmaReadBytes += dmaReadCG->size();
+        dmaReadTxs++;
+        if (dmaReadCG->size() == TheISA::PageBytes)
+            dmaReadFullPages++;
         dmaReadCG->next();
     } else {
         assert(dmaReadCG->done());
@@ -445,6 +479,10 @@ IdeDisk::doDmaWrite()
         assert(dmaWriteCG->complete() < MAX_DMA_SIZE);
         ctrl->dmaWrite(pciToDma(dmaWriteCG->addr()), dmaWriteCG->size(),
                 &dmaWriteWaitEvent, dataBuffer + dmaWriteCG->complete());
+        dmaWriteBytes += dmaWriteCG->size();
+        dmaWriteTxs++;
+        if (dmaWriteCG->size() == TheISA::PageBytes)
+            dmaWriteFullPages++;
         dmaWriteCG->next();
     } else {
         assert(dmaWriteCG->done());
index 66ca88dbe757f1f12984efb51e434c3f733aeb67..bc6891f56b422a847193fa0b10352711cf3cc723 100644 (file)
@@ -81,8 +81,9 @@ Base::Base(Params *p)
 }
 
 Device::Device(Params *p)
-    : Base(p), plat(p->plat), physmem(p->physmem), rxUnique(0), txUnique(0),
+    : Base(p), rxUnique(0), txUnique(0),
       virtualRegs(p->virtual_count < 1 ? 1 : p->virtual_count),
+      rxFifo(p->rx_fifo_size), txFifo(p->tx_fifo_size),
       rxKickTick(0), txKickTick(0),
       txEvent(this), rxDmaEvent(this), txDmaEvent(this),
       dmaReadDelay(p->dma_read_delay), dmaReadFactor(p->dma_read_factor),
@@ -462,14 +463,15 @@ Device::write(Packet &pkt)
         vnic.RxDone = Regs::RxDone_Busy;
         vnic.RxData = pkt.get<uint64_t>();
 
-        if (Regs::get_RxData_Vaddr(reg64)) {
-            Addr vaddr = Regs::get_RxData_Addr(reg64);
+        if (Regs::get_RxData_Vaddr(pkt.get<uint64_t>())) {
+            panic("vtophys not implemented in newmem");
+/*            Addr vaddr = Regs::get_RxData_Addr(reg64);
             Addr paddr = vtophys(req->xc, vaddr);
             DPRINTF(EthernetPIO, "write RxData vnic %d (rxunique %d): "
                     "vaddr=%#x, paddr=%#x\n",
                     index, vnic.rxUnique, vaddr, paddr);
 
-            vnic.RxData = Regs::set_RxData_Addr(vnic.RxData, paddr);
+            vnic.RxData = Regs::set_RxData_Addr(vnic.RxData, paddr);*/
         } else {
             DPRINTF(EthernetPIO, "write RxData vnic %d (rxunique %d)\n",
                     index, vnic.rxUnique);