2 * Copyright (c) 2003 The Regents of The University of Michigan
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;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include "base/cprintf.hh"
35 #include "base/misc.hh"
36 #include "base/statistics.hh"
37 #include "sim/host.hh"
38 #include "sim/sim_stats.hh"
41 using namespace Statistics
;
44 Tick ticksPerSecond
= ULL(2000000000);
49 Scalar
<Counter
, MainBin
> s4
;
50 Vector
<Counter
, MainBin
> s5
;
51 Distribution
<Counter
, MainBin
> s6
;
54 StandardDeviation
<> s9
;
55 AverageDeviation
<> s10
;
58 VectorDistribution
<> s13
;
59 VectorStandardDeviation
<> s14
;
60 VectorAverageDeviation
<> s15
;
81 double operator()() { return 9.7; }
89 panic("incorrect usage.\n"
91 "\t%s [-v]\n", progname
);
95 main(int argc
, char *argv
[])
99 PrintDescriptions
= false;
100 while ((c
= getopt(argc
, argv
, "v")) != -1) {
101 cprintf("c == %c\n", c
);
104 PrintDescriptions
= true;
115 s12
.init(1, 100, 13);
116 s13
.init(4, 0, 99, 10);
123 .desc("this is statistic 1")
128 .desc("this is statistic 2")
134 .desc("this is statistic 3")
140 .desc("this is statistic 4")
146 .desc("this is statistic 5")
157 .desc("this is statistic 6")
163 .desc("this is statistic 7")
171 .desc("this is statistic 8")
179 .desc("this is statistic 9")
186 .desc("this is statistic 10")
192 .desc("this is statistic 12")
197 .desc("this is statistic 13")
202 .desc("this is statistic 14")
207 .desc("this is statistic 15")
212 .desc("this is statistic 16")
220 .desc("this is formula 1")
226 .desc("this is formula 2")
233 .desc("this is formula 3")
244 .desc("this is formula 4")
249 .desc("this is formula 5")
254 .desc("this is formula 6")
259 MainBin::activate(bin1
);
262 f2
= (-s1
) / (-s2
) * -s3
+ ULL(100) + s4
;
264 f4
= functor(testfunc
);
266 f5
= functor(testclass
);
267 f6
+= constant(10.0);
290 s10
.sample(1000000000);
291 curTick
+= ULL(1000000);
366 curTick
+= ULL(1000000);
368 curTick
+= ULL(1000000);
370 curTick
+= ULL(1000000);
372 curTick
+= ULL(1000000);
374 curTick
+= ULL(1000000);
381 curTick
+= ULL(1000000);
383 curTick
+= ULL(1000000);
385 curTick
+= ULL(1000000);
387 curTick
+= ULL(1000000);
390 curTick
+= ULL(1000000);
392 curTick
+= ULL(1000000);
394 curTick
+= ULL(1000000);
396 curTick
+= ULL(1000000);
402 curTick
+= ULL(1000000);
409 curTick
+= ULL(1000000);
455 MainBin::activate(bin2
);
496 MainBin::activate(bin1
);
497 cout
<< "dump 1" << endl
;
499 cout
<< endl
<< endl
;
501 MainBin::activate(bin2
);
502 cout
<< "dump 2" << endl
;
504 cout
<< endl
<< endl
;
506 cout
<< "dump 3" << endl
;
509 cout
<< endl
<< endl
;