dev: Add m5 op to toggle synchronization for dist-gem5.
[gem5.git] / util / m5 / m5ops.h
1 /*
2 * Copyright (c) 2016 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Copyright (c) 2003-2006 The Regents of The University of Michigan
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution;
24 * neither the name of the copyright holders nor the names of its
25 * contributors may be used to endorse or promote products derived from
26 * this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Authors: Nathan Binkert
41 * Ali Saidi
42 * Andreas Sandberg
43 */
44
45 #define arm_func 0x00
46 #define quiesce_func 0x01
47 #define quiescens_func 0x02
48 #define quiescecycle_func 0x03
49 #define quiescetime_func 0x04
50 #define rpns_func 0x07
51 #define wakecpu_func 0x09
52 #define deprecated1_func 0x10 // obsolete ivlb
53 #define deprecated2_func 0x11 // obsolete ivle
54 #define deprecated3_func 0x20 // deprecated exit function
55 #define exit_func 0x21
56 #define fail_func 0x22
57 #define initparam_func 0x30
58 #define loadsymbol_func 0x31
59 #define resetstats_func 0x40
60 #define dumpstats_func 0x41
61 #define dumprststats_func 0x42
62 #define ckpt_func 0x43
63 #define writefile_func 0x4F
64 #define readfile_func 0x50
65 #define debugbreak_func 0x51
66 #define switchcpu_func 0x52
67 #define addsymbol_func 0x53
68 #define panic_func 0x54
69
70 #define reserved2_func 0x56 // Reserved for user
71 #define reserved3_func 0x57 // Reserved for user
72 #define reserved4_func 0x58 // Reserved for user
73 #define reserved5_func 0x59 // Reserved for user
74
75 #define work_begin_func 0x5a
76 #define work_end_func 0x5b
77
78 #define syscall_func 0x60 // Reserved for user
79 #define pagefault_func 0x61 // Reserved for user
80 #define togglesync_func 0x62
81
82 // These operations are for critical path annotation
83 #define annotate_func 0x55
84 #define an_bsm 0x1
85 #define an_esm 0x2
86 #define an_begin 0x3
87 #define an_end 0x4
88 #define an_q 0x6
89 #define an_dq 0x7
90 #define an_wf 0x8
91 #define an_we 0x9
92 #define an_rq 0xA
93 #define an_ws 0xB
94 #define an_sq 0xC
95 #define an_aq 0xD
96 #define an_pq 0xE
97 #define an_l 0xF
98 #define an_identify 0x10
99 #define an_getid 0x11
100
101
102 #define FOREACH_M5OP \
103 M5OP(arm, arm_func, 0); \
104 M5OP(quiesce, quiesce_func, 0); \
105 M5OP(quiesceNs, quiescens_func, 0); \
106 M5OP(quiesceCycle, quiescecycle_func, 0); \
107 M5OP(quiesceTime, quiescetime_func, 0); \
108 M5OP(rpns, rpns_func, 0); \
109 M5OP(wakeCPU, wakecpu_func, 0); \
110 M5OP(m5_exit, exit_func, 0); \
111 M5OP(m5_fail, fail_func, 0); \
112 M5OP(m5_initparam, initparam_func, 0); \
113 M5OP(m5_loadsymbol, loadsymbol_func, 0); \
114 M5OP(m5_reset_stats, resetstats_func, 0); \
115 M5OP(m5_dump_stats, dumpstats_func, 0); \
116 M5OP(m5_dumpreset_stats, dumprststats_func, 0); \
117 M5OP(m5_checkpoint, ckpt_func, 0); \
118 M5OP(m5_readfile, readfile_func, 0); \
119 M5OP(m5_writefile, writefile_func, 0); \
120 M5OP(m5_debugbreak, debugbreak_func, 0); \
121 M5OP(m5_switchcpu, switchcpu_func, 0); \
122 M5OP(m5_addsymbol, addsymbol_func, 0); \
123 M5OP(m5_panic, panic_func, 0); \
124 M5OP(m5_work_begin, work_begin_func, 0); \
125 M5OP(m5_work_end, work_end_func, 0); \
126 M5OP(m5_togglesync, togglesync_func, 0);
127
128 #define FOREACH_M5_ANNOTATION \
129 M5_ANNOTATION(m5a_bsm, an_bsm); \
130 M5_ANNOTATION(m5a_esm, an_esm); \
131 M5_ANNOTATION(m5a_begin, an_begin); \
132 M5_ANNOTATION(m5a_end, an_end); \
133 M5_ANNOTATION(m5a_q, an_q); \
134 M5_ANNOTATION(m5a_dq, an_dq); \
135 M5_ANNOTATION(m5a_wf, an_wf); \
136 M5_ANNOTATION(m5a_we, an_we); \
137 M5_ANNOTATION(m5a_rq, an_rq); \
138 M5_ANNOTATION(m5a_ws, an_ws); \
139 M5_ANNOTATION(m5a_sq, an_sq); \
140 M5_ANNOTATION(m5a_aq, an_aq); \
141 M5_ANNOTATION(m5a_pq, an_pq); \
142 M5_ANNOTATION(m5a_l, an_l); \
143 M5_ANNOTATION(m5a_identify, an_identify); \
144 M5_ANNOTATION(m5a_getid, an_getid);