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"
40 using namespace Statistics
;
43 Tick ticksPerSecond
= ULL(2000000000);
48 Scalar
<Counter
, MainBin
> s4
;
49 Vector
<Counter
, MainBin
> s5
;
50 Distribution
<Counter
, MainBin
> s6
;
53 StandardDeviation
<> s9
;
54 AverageDeviation
<> s10
;
57 VectorDistribution
<> s13
;
58 VectorStandardDeviation
<> s14
;
59 VectorAverageDeviation
<> s15
;
80 double operator()() { return 9.7; }
88 panic("incorrect usage.\n"
90 "\t%s [-v]\n", progname
);
94 main(int argc
, char *argv
[])
98 PrintDescriptions
= false;
99 while ((c
= getopt(argc
, argv
, "v")) != -1) {
100 cprintf("c == %c\n", c
);
103 PrintDescriptions
= true;
114 s12
.init(1, 100, 13);
115 s13
.init(4, 0, 99, 10);
122 .desc("this is statistic 1")
127 .desc("this is statistic 2")
133 .desc("this is statistic 3")
139 .desc("this is statistic 4")
145 .desc("this is statistic 5")
156 .desc("this is statistic 6")
162 .desc("this is statistic 7")
170 .desc("this is statistic 8")
178 .desc("this is statistic 9")
185 .desc("this is statistic 10")
191 .desc("this is statistic 12")
196 .desc("this is statistic 13")
201 .desc("this is statistic 14")
206 .desc("this is statistic 15")
211 .desc("this is statistic 16")
219 .desc("this is formula 1")
225 .desc("this is formula 2")
232 .desc("this is formula 3")
243 .desc("this is formula 4")
248 .desc("this is formula 5")
253 .desc("this is formula 6")
261 f2
= (-s1
) / (-s2
) * -s3
+ ULL(100) + s4
;
263 f4
= functor(testfunc
);
265 f5
= functor(testclass
);
266 f6
+= constant(10.0);
294 s10
.sample(1000000000);
295 curTick
+= ULL(1000000);
370 curTick
+= ULL(1000000);
372 curTick
+= ULL(1000000);
374 curTick
+= ULL(1000000);
376 curTick
+= ULL(1000000);
378 curTick
+= ULL(1000000);
385 curTick
+= ULL(1000000);
387 curTick
+= ULL(1000000);
389 curTick
+= ULL(1000000);
391 curTick
+= ULL(1000000);
394 curTick
+= ULL(1000000);
396 curTick
+= ULL(1000000);
398 curTick
+= ULL(1000000);
400 curTick
+= ULL(1000000);
406 curTick
+= ULL(1000000);
413 curTick
+= ULL(1000000);
501 cout
<< "dump 1" << endl
;
503 cout
<< endl
<< endl
;
506 cout
<< "dump 2" << endl
;
508 cout
<< endl
<< endl
;
510 cout
<< "dump 3" << endl
;
513 cout
<< endl
<< endl
;