Deleted Added
sdiff udiff text old ( 6128:fdfbd4c6e449 ) new ( 6129:05405c5b8c16 )
full compact
1/*
2 * Copyright (c) 2003-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;

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

60#include <vector>
61
62#include "base/cast.hh"
63#include "base/cprintf.hh"
64#include "base/intmath.hh"
65#include "base/refcnt.hh"
66#include "base/str.hh"
67#include "base/stats/flags.hh"
68#include "base/stats/info.hh"
69#include "base/stats/types.hh"
70#include "base/stats/visit.hh"
71#include "sim/host.hh"
72
73class Callback;
74
75/** The current simulated tick. */
76extern Tick curTick;
77
78/* A namespace for all of the Statistics */
79namespace Stats {
80
81template <class Stat, class Base>
82class InfoProxy : public Base
83{
84 protected:
85 Stat &s;
86
87 public:
88 InfoProxy(Stat &stat) : s(stat) {}

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

93 void
94 visit(Visit &visitor)
95 {
96 visitor.visit(*static_cast<Base *>(this));
97 }
98 bool zero() const { return s.zero(); }
99};
100
101template <class Stat>
102class ScalarInfoProxy : public InfoProxy<Stat, ScalarInfo>
103{
104 public:
105 ScalarInfoProxy(Stat &stat) : InfoProxy<Stat, ScalarInfo>(stat) {}
106
107 Counter value() const { return this->s.value(); }
108 Result result() const { return this->s.result(); }
109 Result total() const { return this->s.total(); }
110};
111
112template <class Stat>
113class VectorInfoProxy : public InfoProxy<Stat, VectorInfo>
114{
115 protected:
116 mutable VCounter cvec;
117 mutable VResult rvec;
118
119 public:

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

133 {
134 this->s.result(rvec);
135 return rvec;
136 }
137
138 Result total() const { return this->s.total(); }
139};
140
141template <class Stat>
142class DistInfoProxy : public InfoProxy<Stat, DistInfo>
143{
144 public:
145 DistInfoProxy(Stat &stat) : InfoProxy<Stat, DistInfo>(stat) {}
146};
147
148template <class Stat>
149class VectorDistInfoProxy : public InfoProxy<Stat, VectorDistInfo>
150{
151 public:
152 VectorDistInfoProxy(Stat &stat) : InfoProxy<Stat, VectorDistInfo>(stat) {}
153
154 size_type size() const { return this->s.size(); }
155};
156
157template <class Stat>
158class Vector2dInfoProxy : public InfoProxy<Stat, Vector2dInfo>
159{
160 public:
161 Vector2dInfoProxy(Stat &stat) : InfoProxy<Stat, Vector2dInfo>(stat) {}
162};
163
164class InfoAccess

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

1258};
1259
1260//////////////////////////////////////////////////////////////////////
1261//
1262// Non formula statistics
1263//
1264//////////////////////////////////////////////////////////////////////
1265
1266/**
1267 * Templatized storage and interface for a distrbution stat.
1268 */
1269class DistStor
1270{
1271 public:
1272 /** The parameters for a distribution stat. */
1273 struct Params : public DistParams

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

2370 VectorAverageDeviation &
2371 init(size_type size)
2372 {
2373 this->doInit(size);
2374 return this->self();
2375 }
2376};
2377
2378template <class Stat>
2379class FormulaInfoProxy : public InfoProxy<Stat, FormulaInfo>
2380{
2381 protected:
2382 mutable VResult vec;
2383 mutable VCounter cvec;
2384
2385 public:

--- 370 unchanged lines hidden ---