summaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
Diffstat (limited to 'dev')
-rw-r--r--dev/ide_disk.cc33
-rw-r--r--dev/ide_disk.hh4
2 files changed, 37 insertions, 0 deletions
diff --git a/dev/ide_disk.cc b/dev/ide_disk.cc
index c13556ed6..701d3bf7d 100644
--- a/dev/ide_disk.cc
+++ b/dev/ide_disk.cc
@@ -406,6 +406,39 @@ IdeDisk::regStats()
.name(name() + ".dma_write_txs")
.desc("Number of DMA write transactions.")
;
+
+ rdBandwidth
+ .name(name() + ".rdBandwidth")
+ .desc("Read Bandwidth (bits/s)")
+ .precision(0)
+ .prereq(dmaReadBytes)
+ ;
+
+ wrBandwidth
+ .name(name() + ".wrBandwidth")
+ .desc("Write Bandwidth (bits/s)")
+ .precision(0)
+ .prereq(dmaWriteBytes)
+ ;
+
+ totBandwidth
+ .name(name() + ".totBandwidth")
+ .desc("Total Bandwidth (bits/s)")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
+ totBytes
+ .name(name() + ".totBytes")
+ .desc("Total Bytes")
+ .precision(0)
+ .prereq(totBytes)
+ ;
+
+ rdBandwidth = dmaReadBytes * Stats::constant(8) / simSeconds;
+ wrBandwidth = dmaWriteBytes * Stats::constant(8) / simSeconds;
+ totBandwidth = rdBandwidth + wrBandwidth;
+ totBytes = dmaReadBytes + dmaWriteBytes;
}
void
diff --git a/dev/ide_disk.hh b/dev/ide_disk.hh
index 402ae44ee..91ea33f4a 100644
--- a/dev/ide_disk.hh
+++ b/dev/ide_disk.hh
@@ -244,6 +244,10 @@ class IdeDisk : public SimObject
Stats::Scalar<> dmaWriteFullPages;
Stats::Scalar<> dmaWriteBytes;
Stats::Scalar<> dmaWriteTxs;
+ Stats::Formula rdBandwidth;
+ Stats::Formula wrBandwidth;
+ Stats::Formula totBandwidth;
+ Stats::Formula totBytes;
public:
/**