stat_control.cc (5606:6da7a58b0bc8) stat_control.cc (5883:c810b7d4383d)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 30 unchanged lines hidden (view full) ---

39#include "base/hostinfo.hh"
40#include "base/statistics.hh"
41#include "base/time.hh"
42#include "cpu/base.hh"
43#include "sim/eventq.hh"
44
45using namespace std;
46
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 30 unchanged lines hidden (view full) ---

39#include "base/hostinfo.hh"
40#include "base/statistics.hh"
41#include "base/time.hh"
42#include "cpu/base.hh"
43#include "sim/eventq.hh"
44
45using namespace std;
46
47Stats::Formula hostInstRate;
48Stats::Formula hostTickRate;
49Stats::Value hostMemory;
50Stats::Value hostSeconds;
51
52Stats::Value simTicks;
53Stats::Value simInsts;
54Stats::Value simFreq;
55Stats::Formula simSeconds;
56
57namespace Stats {
58
59Time statTime(true);
60Tick startTick;
61
62struct SimTicksReset : public Callback

--- 16 unchanged lines hidden (view full) ---

79Tick
80statElapsedTicks()
81{
82 return curTick - startTick;
83}
84
85SimTicksReset simTicksReset;
86
47Stats::Formula simSeconds;
48
49namespace Stats {
50
51Time statTime(true);
52Tick startTick;
53
54struct SimTicksReset : public Callback

--- 16 unchanged lines hidden (view full) ---

71Tick
72statElapsedTicks()
73{
74 return curTick - startTick;
75}
76
77SimTicksReset simTicksReset;
78
87void
88initSimStats()
79struct Global
89{
80{
81 Stats::Formula hostInstRate;
82 Stats::Formula hostTickRate;
83 Stats::Value hostMemory;
84 Stats::Value hostSeconds;
85
86 Stats::Value simTicks;
87 Stats::Value simInsts;
88 Stats::Value simFreq;
89
90 Global();
91};
92
93Global::Global()
94{
90 simInsts
91 .functor(BaseCPU::numSimulatedInstructions)
92 .name("sim_insts")
93 .desc("Number of instructions simulated")
94 .precision(0)
95 .prereq(simInsts)
96 ;
97

--- 43 unchanged lines hidden (view full) ---

141
142 simSeconds = simTicks / simFreq;
143 hostInstRate = simInsts / hostSeconds;
144 hostTickRate = simTicks / hostSeconds;
145
146 registerResetCallback(&simTicksReset);
147}
148
95 simInsts
96 .functor(BaseCPU::numSimulatedInstructions)
97 .name("sim_insts")
98 .desc("Number of instructions simulated")
99 .precision(0)
100 .prereq(simInsts)
101 ;
102

--- 43 unchanged lines hidden (view full) ---

146
147 simSeconds = simTicks / simFreq;
148 hostInstRate = simInsts / hostSeconds;
149 hostTickRate = simTicks / hostSeconds;
150
151 registerResetCallback(&simTicksReset);
152}
153
154void
155initSimStats()
156{
157 static Global global;
158}
159
149class _StatEvent : public Event
150{
151 private:
152 bool dump;
153 bool reset;
154 Tick repeat;
155
156 public:

--- 30 unchanged lines hidden ---
160class _StatEvent : public Event
161{
162 private:
163 bool dump;
164 bool reset;
165 Tick repeat;
166
167 public:

--- 30 unchanged lines hidden ---