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.
41 printf("usage: m5 ivlb <interval>\n"
42 " m5 ivle <interval>\n"
46 " m5 resetstats [delay [period]]\n"
47 " m5 dumpstats [delay [period]]\n"
48 " m5 dumpresetstats [delay [period]]\n"
49 " m5 checkpoint [delay [period]]\n"
51 "All times in nanoseconds!\n");
55 #define COMPARE(X) (strcmp(X, command) == 0)
58 main(int argc
, char *argv
[])
71 if (COMPARE("ivlb")) {
75 arg1
= strtoul(argv
[2], NULL
, 0);
80 if (COMPARE("ivle")) {
84 arg1
= strtoul(argv
[2], NULL
, 0);
89 if (COMPARE("initparam")) {
93 printf("%ld", initparam());
97 if (COMPARE("sw99param")) {
102 // run-time, rampup-time, rampdown-time, warmup-time, connections
103 printf("%d %d %d %d %d", (param
>> 48) & 0xfff,
104 (param
>> 36) & 0xfff, (param
>> 24) & 0xfff,
105 (param
>> 12) & 0xfff, (param
>> 0) & 0xfff);
110 if (COMPARE("exit")) {
113 arg1
= strtoul(argv
[2], NULL
, 0);
123 if (COMPARE("resetstats")) {
126 arg2
= strtoul(argv
[3], NULL
, 0);
128 arg1
= strtoul(argv
[2], NULL
, 0);
130 reset_stats(arg1
, arg2
);
138 if (COMPARE("dumpstats")) {
141 arg2
= strtoul(argv
[3], NULL
, 0);
143 arg1
= strtoul(argv
[2], NULL
, 0);
145 dump_stats(arg1
, arg2
);
153 if (COMPARE("dumpresetstats")) {
156 arg2
= strtoul(argv
[3], NULL
, 0);
158 arg1
= strtoul(argv
[2], NULL
, 0);
160 dumpreset_stats(arg1
, arg2
);
168 if (COMPARE("checkpoint")) {
171 arg2
= strtoul(argv
[3], NULL
, 0);
173 arg1
= strtoul(argv
[2], NULL
, 0);
175 checkpoint(arg1
, arg2
);