changeset 62e1504b9c64 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=62e1504b9c64
description:
dev: Add an underrun statistic to the HDLCD controller
Add a stat that counts buffer underruns in the HDLCD controller. The
stat counts at most one underrun per frame since the controller aborts
the current frame if it underruns.
diffstat:
src/dev/arm/hdlcd.cc | 13 +++++++++++++
src/dev/arm/hdlcd.hh | 7 +++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diffs (54 lines):
diff -r f37a6b82f98f -r 62e1504b9c64 src/dev/arm/hdlcd.cc
--- a/src/dev/arm/hdlcd.cc Fri Sep 11 15:55:46 2015 +0100
+++ b/src/dev/arm/hdlcd.cc Fri Sep 11 15:56:09 2015 +0100
@@ -95,6 +95,18 @@
}
void
+HDLcd::regStats()
+{
+ using namespace Stats;
+
+ stats.underruns
+ .name(name() + ".underruns")
+ .desc("number of buffer underruns")
+ .flags(nozero)
+ ;
+}
+
+void
HDLcd::serialize(CheckpointOut &cp) const
{
DPRINTF(Checkpoint, "Serializing ARM HDLCD\n");
@@ -503,6 +515,7 @@
HDLcd::pxlUnderrun()
{
DPRINTF(HDLcd, "Buffer underrun, stopping DMA fill.\n");
+ ++stats.underruns;
intRaise(INT_UNDERRUN);
dmaEngine->abortFrame();
}
diff -r f37a6b82f98f -r 62e1504b9c64 src/dev/arm/hdlcd.hh
--- a/src/dev/arm/hdlcd.hh Fri Sep 11 15:55:46 2015 +0100
+++ b/src/dev/arm/hdlcd.hh Fri Sep 11 15:56:09 2015 +0100
@@ -95,6 +95,8 @@
HDLcd(const HDLcdParams *p);
~HDLcd();
+ void regStats() M5_ATTR_OVERRIDE;
+
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
@@ -381,6 +383,11 @@
};
std::unique_ptr<DmaEngine> dmaEngine;
+
+ protected: // Statistics
+ struct {
+ Stats::Scalar underruns;
+ } stats;
};
#endif
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev