class AlphaITB : public AlphaTLB
{
protected:
- mutable Statistics::Scalar<> hits;
- mutable Statistics::Scalar<> misses;
- mutable Statistics::Scalar<> acv;
- mutable Statistics::Formula accesses;
+ mutable Stats::Scalar<> hits;
+ mutable Stats::Scalar<> misses;
+ mutable Stats::Scalar<> acv;
+ mutable Stats::Formula accesses;
protected:
void fault(Addr pc, ExecContext *xc) const;
class AlphaDTB : public AlphaTLB
{
protected:
- mutable Statistics::Scalar<> read_hits;
- mutable Statistics::Scalar<> read_misses;
- mutable Statistics::Scalar<> read_acv;
- mutable Statistics::Scalar<> read_accesses;
- mutable Statistics::Scalar<> write_hits;
- mutable Statistics::Scalar<> write_misses;
- mutable Statistics::Scalar<> write_acv;
- mutable Statistics::Scalar<> write_accesses;
- Statistics::Formula hits;
- Statistics::Formula misses;
- Statistics::Formula acv;
- Statistics::Formula accesses;
+ mutable Stats::Scalar<> read_hits;
+ mutable Stats::Scalar<> read_misses;
+ mutable Stats::Scalar<> read_acv;
+ mutable Stats::Scalar<> read_accesses;
+ mutable Stats::Scalar<> write_hits;
+ mutable Stats::Scalar<> write_misses;
+ mutable Stats::Scalar<> write_acv;
+ mutable Stats::Scalar<> write_accesses;
+ Stats::Formula hits;
+ Stats::Formula misses;
+ Stats::Formula acv;
+ Stats::Formula accesses;
protected:
void fault(Addr pc, uint64_t flags, ExecContext *xc) const;
#include "sim/stats.hh"
using namespace std;
-using namespace Statistics;
+using namespace Stats;
namespace AlphaPseudo
{
Tick when = curTick + NS2Ticks(delay);
Tick repeat = NS2Ticks(period);
- using namespace Statistics;
+ using namespace Stats;
SetupEvent(Reset, when, repeat);
}
Tick when = curTick + NS2Ticks(delay);
Tick repeat = NS2Ticks(period);
- using namespace Statistics;
+ using namespace Stats;
SetupEvent(Dump, when, repeat);
}
Tick when = curTick + NS2Ticks(delay);
Tick repeat = NS2Ticks(period);
- using namespace Statistics;
+ using namespace Stats;
SetupEvent(Dump|Reset, when, repeat);
}
void HybridPredictor::regStats()
{
- using namespace Statistics;
+ using namespace Stats;
string p_name;
stringstream description;
void HybridPredictor::regFormulas()
{
- using namespace Statistics;
+ using namespace Stats;
string p_name;
stringstream description;
//
// Stats
//
- Statistics::Scalar<> pred_one; //num_one_preds
- Statistics::Scalar<> pred_zero; //num_zero_preds
- Statistics::Scalar<> correct_pred_one; //num_one_correct
- Statistics::Scalar<> correct_pred_zero; //num_zero_correct
- Statistics::Scalar<> record_one; //num_one_updates
- Statistics::Scalar<> record_zero; //num_zero_updates
-
- Statistics::Formula total_preds;
- Statistics::Formula frac_preds_zero;
- Statistics::Formula frac_preds_one;
- Statistics::Formula total_correct;
- Statistics::Formula total_accuracy;
- Statistics::Formula zero_accuracy;
- Statistics::Formula one_accuracy;
- Statistics::Formula zero_coverage;
- Statistics::Formula one_coverage;
+ Stats::Scalar<> pred_one; //num_one_preds
+ Stats::Scalar<> pred_zero; //num_zero_preds
+ Stats::Scalar<> correct_pred_one; //num_one_correct
+ Stats::Scalar<> correct_pred_zero; //num_zero_correct
+ Stats::Scalar<> record_one; //num_one_updates
+ Stats::Scalar<> record_zero; //num_zero_updates
+
+ Stats::Formula total_preds;
+ Stats::Formula frac_preds_zero;
+ Stats::Formula frac_preds_one;
+ Stats::Formula total_correct;
+ Stats::Formula total_accuracy;
+ Stats::Formula zero_accuracy;
+ Stats::Formula one_accuracy;
+ Stats::Formula zero_coverage;
+ Stats::Formula one_coverage;
public:
HybridPredictor(const char *_p_name, const char *_z_name,
void SaturatingCounterPred::regStats()
{
- using namespace Statistics;
+ using namespace Stats;
stringstream name, description;
//
void SaturatingCounterPred::regFormulas()
{
- using namespace Statistics;
+ using namespace Stats;
stringstream name, description;
//
unsigned *table;
// Statistics
- Statistics::Scalar<> predicted_one; // Total predictions of one, preds_one
- Statistics::Scalar<> predicted_zero; // Total predictions of zero, preds_zero
- Statistics::Scalar<> correct_pred_one; // Total correct predictions of one, correct_one
- Statistics::Scalar<> correct_pred_zero; // Total correct predictions of zero, correct_zero
-
- Statistics::Scalar<> record_zero; //updates_zero
- Statistics::Scalar<> record_one; //updates_one
-
- Statistics::Formula preds_total;
- Statistics::Formula pred_frac_zero;
- Statistics::Formula pred_frac_one;
- Statistics::Formula correct_total;
- Statistics::Formula updates_total;
- Statistics::Formula pred_rate;
- Statistics::Formula frac_correct_zero;
- Statistics::Formula frac_correct_one;
- Statistics::Formula coverage_zero;
- Statistics::Formula coverage_one;
+ Stats::Scalar<> predicted_one; // Total predictions of one, preds_one
+ Stats::Scalar<> predicted_zero; // Total predictions of zero, preds_zero
+ Stats::Scalar<> correct_pred_one; // Total correct predictions of one, correct_one
+ Stats::Scalar<> correct_pred_zero; // Total correct predictions of zero, correct_zero
+
+ Stats::Scalar<> record_zero; //updates_zero
+ Stats::Scalar<> record_one; //updates_one
+
+ Stats::Formula preds_total;
+ Stats::Formula pred_frac_zero;
+ Stats::Formula pred_frac_one;
+ Stats::Formula correct_total;
+ Stats::Formula updates_total;
+ Stats::Formula pred_rate;
+ Stats::Formula frac_correct_zero;
+ Stats::Formula frac_correct_one;
+ Stats::Formula coverage_zero;
+ Stats::Formula coverage_one;
private:
bool pred_one(unsigned &counter) { return counter > thresh; }
using namespace std;
-namespace Statistics {
+namespace Stats {
StatData *
DataAccess::find() const
resetQueue.add(cb);
}
-/* namespace Statistics */ }
+/* namespace Stats */ }
extern Tick curTick;
/* A namespace for all of the Statistics */
-namespace Statistics {
+namespace Stats {
/* Contains the statistic implementation details */
//////////////////////////////////////////////////////////////////////
return NodePtr(new SumNode<std::plus<Result> >(val));
}
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __BASE_STATISTICS_HH__
#ifndef __BASE_STATS_FLAGS_HH__
#define __BASE_STATS_FLAGS_HH__
-namespace Statistics {
+namespace Stats {
/**
* Define the storage for format flags.
extern DisplayMode DefaultMode;
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __BASE_STATS_FLAGS_HH__
using namespace std;
-namespace Statistics {
+namespace Stats {
struct MySqlData
{
output(data);
}
-/* namespace Statistics */ }
+/* namespace Stats */ }
#include "base/stats/output.hh"
namespace MySQL { class Connection; }
-namespace Statistics {
+namespace Stats {
class DistDataData;
class MySqlData;
void configure(const FormulaData &data);
};
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __BASE_STATS_MYSQL_HH__
#include "base/stats/visit.hh"
-namespace Statistics {
+namespace Stats {
struct Output : public Visit
{
virtual bool valid() const = 0;
};
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __BASE_STATS_OUTPUT_HH__
using namespace std;
-namespace Statistics {
+namespace Stats {
namespace Database {
StatData *
}
/* namespace Database */ }
-/* namespace Statistics */ }
+/* namespace Stats */ }
class Python;
-namespace Statistics {
+namespace Stats {
class MainBin;
class StatData;
inline std::string name() { return "Statistics Database"; }
/* namespace Database */ }
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __BASE_STATS_STATDB_HH__
}
#endif
-namespace Statistics {
+namespace Stats {
Text::Text()
: mystream(false), stream(NULL), compat(false), descriptions(false)
print(stream);
}
- if (flags & ::Statistics::total) {
+ if (flags & ::Stats::total) {
print.name = base + "total";
print.desc = desc;
print.value = total;
print(stream);
}
} else {
- if (flags & ::Statistics::total) {
+ if (flags & ::Stats::total) {
print.value = total;
print(stream);
}
print(*stream);
}
- if ((data.flags & ::Statistics::total) && (data.x > 1)) {
+ if ((data.flags & ::Stats::total) && (data.x > 1)) {
print.name = data.name;
print.desc = data.desc;
print.vec = tot_vec;
visit((const VectorData &)data);
}
-/* namespace Statistics */ }
+/* namespace Stats */ }
#include "base/stats/output.hh"
-namespace Statistics {
+namespace Stats {
class Text : public Output
{
virtual void output();
};
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __BASE_STATS_TEXT_HH__
#include <vector>
#include <inttypes.h>
-namespace Statistics {
+namespace Stats {
/** All counters are of 64-bit values. */
typedef double Counter;
/** vector of results. */
typedef std::vector<Result> VResult;
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __BASE_STATS_TYPES_HH__
#include "base/stats/visit.hh"
-namespace Statistics {
+namespace Stats {
namespace Detail {
Visit::Visit()
{}
/* namespace Detail */ }
-/* namespace Statistics */ }
+/* namespace Stats */ }
#include "base/time.hh"
#include "sim/host.hh"
-namespace Statistics {
+namespace Stats {
class StatData;
class ScalarData;
virtual void visit(const FormulaData &data) = 0;
};
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __BASE_STATS_VISIT_HH__
void
BaseCPU::regStats()
{
- using namespace Statistics;
+ using namespace Stats;
numCycles
.name(name() + ".numCycles")
public:
// Number of CPU cycles simulated
- Statistics::Scalar<> numCycles;
+ Stats::Scalar<> numCycles;
};
#endif // __BASE_CPU_HH__
SERIALIZE_SCALAR(ctx);
}
if (system->bin) {
- Statistics::MainBin *cur = Statistics::MainBin::curBin();
+ Stats::MainBin *cur = Stats::MainBin::curBin();
string bin_name = cur->name();
SERIALIZE_SCALAR(bin_name);
}
void
MemTest::regStats()
{
- using namespace Statistics;
+ using namespace Stats;
numReadsStat
Tick noResponseCycles;
uint64_t numReads;
- Statistics::Scalar<> numReadsStat;
- Statistics::Scalar<> numWritesStat;
- Statistics::Scalar<> numCopiesStat;
+ Stats::Scalar<> numReadsStat;
+ Stats::Scalar<> numWritesStat;
+ Stats::Scalar<> numCopiesStat;
// called by MemCompleteEvent::process()
void completeRequest(MemReqPtr &req, uint8_t *data);
void
SimpleCPU::regStats()
{
- using namespace Statistics;
+ using namespace Stats;
BaseCPU::regStats();
// number of simulated instructions
Counter numInst;
Counter startNumInst;
- Statistics::Scalar<> numInsts;
+ Stats::Scalar<> numInsts;
virtual Counter totalInstructions() const
{
}
// number of simulated memory references
- Statistics::Scalar<> numMemRefs;
+ Stats::Scalar<> numMemRefs;
// number of simulated loads
Counter numLoad;
Counter startNumLoad;
// number of idle cycles
- Statistics::Average<> notIdleFraction;
- Statistics::Formula idleFraction;
+ Stats::Average<> notIdleFraction;
+ Stats::Formula idleFraction;
// number of cycles stalled for I-cache misses
- Statistics::Scalar<> icacheStallCycles;
+ Stats::Scalar<> icacheStallCycles;
Counter lastIcacheStall;
// number of cycles stalled for D-cache misses
- Statistics::Scalar<> dcacheStallCycles;
+ Stats::Scalar<> dcacheStallCycles;
Counter lastDcacheStall;
void processCacheCompletion();
.prereq(rxBytes)
;
- txBandwidth = txBytes * Statistics::constant(8) / simSeconds;
- rxBandwidth = rxBytes * Statistics::constant(8) / simSeconds;
+ txBandwidth = txBytes * Stats::constant(8) / simSeconds;
+ rxBandwidth = rxBytes * Stats::constant(8) / simSeconds;
txPacketRate = txPackets / simSeconds;
rxPacketRate = rxPackets / simSeconds;
}
void regStats();
private:
- Statistics::Scalar<> txBytes;
- Statistics::Scalar<> rxBytes;
- Statistics::Scalar<> txPackets;
- Statistics::Scalar<> rxPackets;
- Statistics::Formula txBandwidth;
- Statistics::Formula rxBandwidth;
- Statistics::Formula txPacketRate;
- Statistics::Formula rxPacketRate;
+ Stats::Scalar<> txBytes;
+ Stats::Scalar<> rxBytes;
+ Stats::Scalar<> txPackets;
+ Stats::Scalar<> rxPackets;
+ Stats::Formula txBandwidth;
+ Stats::Formula rxBandwidth;
+ Stats::Formula txPacketRate;
+ Stats::Formula rxPacketRate;
private:
Tick pioLatency;
private:
std::string _name;
- Statistics::MainBin *myBin;
+ Stats::MainBin *myBin;
};
#endif // __SYSTEM_EVENTS_HH__
sayHello(cerr);
// Initialize statistics database
- Statistics::InitSimStats();
+ Stats::InitSimStats();
vector<char *> cppArgs;
#endif
// Check to make sure that the stats package is properly initialized
- Statistics::check();
+ Stats::check();
// Reset to put the stats in a consistent state.
- Statistics::reset();
+ Stats::reset();
// Nothing to simulate if we don't have at least one CPU somewhere.
if (BaseCPU::numSimulatedCPUs() == 0) {
if (async_dump) {
async_dump = false;
- using namespace Statistics;
+ using namespace Stats;
SetupEvent(Dump, curTick);
}
if (async_dumpreset) {
async_dumpreset = false;
- using namespace Statistics;
+ using namespace Stats;
SetupEvent(Dump | Reset, curTick);
}
void
Process::regStats()
{
- using namespace Statistics;
+ using namespace Stats;
num_syscalls
.name(name() + ".PROG:num_syscalls")
std::string prog_fname; // file name
Addr prog_entry; // entry point (initial PC)
- Statistics::Scalar<> num_syscalls; // number of syscalls executed
+ Stats::Scalar<> num_syscalls; // number of syscalls executed
protected:
(*i)->regFormulas();
}
- Statistics::registerResetCallback(&StatResetCB);
+ Stats::registerResetCallback(&StatResetCB);
}
//
using namespace std;
-Statistics::Formula hostInstRate;
-Statistics::Formula hostTickRate;
-Statistics::Value hostMemory;
-Statistics::Value hostSeconds;
+Stats::Formula hostInstRate;
+Stats::Formula hostTickRate;
+Stats::Value hostMemory;
+Stats::Value hostSeconds;
-Statistics::Value simTicks;
-Statistics::Value simInsts;
-Statistics::Value simFreq;
-Statistics::Formula simSeconds;
+Stats::Value simTicks;
+Stats::Value simInsts;
+Stats::Value simFreq;
+Stats::Formula simSeconds;
-namespace Statistics {
+namespace Stats {
Time statTime(true);
Tick startTick;
void
StatEvent::process()
{
- if (flags & Statistics::Dump)
+ if (flags & Stats::Dump)
DumpNow();
- if (flags & Statistics::Reset)
+ if (flags & Stats::Reset)
reset();
if (repeat)
new StatEvent(flags, when, repeat);
}
-/* namespace Statistics */ }
+/* namespace Stats */ }
extern "C" void
debugDumpStats()
{
- Statistics::DumpNow();
+ Stats::DumpNow();
}
#include <fstream>
#include <list>
-namespace Statistics {
+namespace Stats {
enum {
Reset = 0x1,
void InitSimStats();
-/* namespace Statistics */ }
+/* namespace Stats */ }
#endif // __SIM_STAT_CONTROL_HH__
#include "base/statistics.hh"
-extern Statistics::Formula simSeconds;
-extern Statistics::Value simTicks;
+extern Stats::Formula simSeconds;
+extern Stats::Value simTicks;
#endif // __SIM_SIM_STATS_HH__
// add self to global system list
systemList.push_back(this);
if (bin == true) {
- Kernel = new Statistics::MainBin("non TCPIP Kernel stats");
+ Kernel = new Stats::MainBin("non TCPIP Kernel stats");
Kernel->activate();
- User = new Statistics::MainBin("User stats");
+ User = new Stats::MainBin("User stats");
int end = binned_fns.size();
assert(!(end & 1));
- Statistics::MainBin *Bin;
+ Stats::MainBin *Bin;
fnEvents.resize(end>>1);
for (int i = 0; i < end; i +=2) {
- Bin = new Statistics::MainBin(binned_fns[i]);
+ Bin = new Stats::MainBin(binned_fns[i]);
fnBins.insert(make_pair(binned_fns[i], Bin));
fnEvents[(i>>1)] = new FnEvent(&pcEventQueue, binned_fns[i], this);
}
}
-Statistics::MainBin *
+Stats::MainBin *
System::getBin(const std::string &name)
{
- std::map<const std::string, Statistics::MainBin *>::const_iterator i;
+ std::map<const std::string, Stats::MainBin *>::const_iterator i;
i = fnBins.find(name);
if (i == fnBins.end())
panic("trying to getBin %s that is not on system map!", name);
{
// lisa's binning stuff
private:
- std::map<const std::string, Statistics::MainBin *> fnBins;
+ std::map<const std::string, Stats::MainBin *> fnBins;
std::map<const Addr, SWContext *> swCtxMap;
protected:
std::vector<FnEvent *> fnEvents;
public:
- Statistics::Scalar<> fnCalls;
- Statistics::MainBin *Kernel;
- Statistics::MainBin *User;
+ Stats::Scalar<> fnCalls;
+ Stats::MainBin *Kernel;
+ Stats::MainBin *User;
- Statistics::MainBin * getBin(const std::string &name);
+ Stats::MainBin * getBin(const std::string &name);
bool findCaller(std::string, std::string) const;
SWContext *findContext(Addr pcb);
#include "sim/host.hh"
using namespace std;
-using namespace Statistics;
+using namespace Stats;
Tick curTick = 0;
Tick ticksPerSecond = ULL(2000000000);