.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
Stats::Scalar<> dmaWriteFullPages;
Stats::Scalar<> dmaWriteBytes;
Stats::Scalar<> dmaWriteTxs;
+ Stats::Formula rdBandwidth;
+ Stats::Formula wrBandwidth;
+ Stats::Formula totBandwidth;
+ Stats::Formula totBytes;
public:
/**
Tick repeat;
public:
- StatEvent(int _flags, Tick _when, Tick _repeat);
+ StatEvent(EventQueue *queue, int _flags, Tick _when, Tick _repeat);
virtual void process();
virtual const char *description();
};
-StatEvent::StatEvent(int _flags, Tick _when, Tick _repeat)
- : Event(&mainEventQueue, Stat_Event_Pri),
+StatEvent::StatEvent(EventQueue *queue, int _flags, Tick _when, Tick _repeat)
+ : Event(queue, Stat_Event_Pri),
flags(_flags), repeat(_repeat)
{
setFlags(AutoDelete);
}
void
-SetupEvent(int flags, Tick when, Tick repeat)
+SetupEvent(int flags, Tick when, Tick repeat, EventQueue *queue)
{
- new StatEvent(flags, when, repeat);
+ if (queue == NULL)
+ queue = &mainEventQueue;
+
+ new StatEvent(queue, flags, when, repeat);
}
/* namespace Stats */ }
#include <fstream>
#include <list>
+class EventQueue;
+
namespace Stats {
enum {
extern std::list<Output *> OutputList;
void DumpNow();
-void SetupEvent(int flags, Tick when, Tick repeat = 0);
+void SetupEvent(int flags, Tick when, Tick repeat = 0, EventQueue *queue = NULL);
void InitSimStats();