2 * Copyright (c) 2003-2005 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.
29 #ifndef __ALPHA_FAULTS_HH__
30 #define __ALPHA_FAULTS_HH__
32 #include "sim/faults.hh"
34 // The design of the "name" and "vect" functions is in sim/faults.hh
39 typedef const Addr FaultVect;
41 class AlphaFault : public FaultBase
44 static FaultName _name;
45 static FaultVect _vect;
46 static FaultStat _stat;
49 void ev5_trap(ExecContext * xc);
51 FaultName name() {return _name;}
52 virtual FaultVect vect() {return _vect;}
53 virtual FaultStat & stat() {return _stat;}
56 class AlphaMachineCheckFault : public MachineCheckFault
59 static FaultVect _vect;
60 static FaultStat _stat;
63 void ev5_trap(ExecContext * xc);
65 FaultVect vect() {return _vect;}
66 FaultStat & stat() {return _stat;}
69 class AlphaAlignmentFault : public AlignmentFault
72 static FaultVect _vect;
73 static FaultStat _stat;
76 void ev5_trap(ExecContext * xc);
78 FaultVect vect() {return _vect;}
79 FaultStat & stat() {return _stat;}
82 static inline Fault genMachineCheckFault()
84 return new AlphaMachineCheckFault;
87 static inline Fault genAlignmentFault()
89 return new AlphaAlignmentFault;
92 class ResetFault : public AlphaFault
95 static FaultName _name;
96 static FaultVect _vect;
97 static FaultStat _stat;
99 FaultName name() {return _name;}
100 FaultVect vect() {return _vect;}
101 FaultStat & stat() {return _stat;}
104 class ArithmeticFault : public AlphaFault
107 static FaultName _name;
108 static FaultVect _vect;
109 static FaultStat _stat;
111 FaultName name() {return _name;}
112 FaultVect vect() {return _vect;}
113 FaultStat & stat() {return _stat;}
116 class InterruptFault : public AlphaFault
119 static FaultName _name;
120 static FaultVect _vect;
121 static FaultStat _stat;
123 FaultName name() {return _name;}
124 FaultVect vect() {return _vect;}
125 FaultStat & stat() {return _stat;}
128 class NDtbMissFault : public AlphaFault
131 static FaultName _name;
132 static FaultVect _vect;
133 static FaultStat _stat;
135 FaultName name() {return _name;}
136 FaultVect vect() {return _vect;}
137 FaultStat & stat() {return _stat;}
140 class PDtbMissFault : public AlphaFault
143 static FaultName _name;
144 static FaultVect _vect;
145 static FaultStat _stat;
147 FaultName name() {return _name;}
148 FaultVect vect() {return _vect;}
149 FaultStat & stat() {return _stat;}
152 class DtbPageFault : public AlphaFault
155 static FaultName _name;
156 static FaultVect _vect;
157 static FaultStat _stat;
159 FaultName name() {return _name;}
160 FaultVect vect() {return _vect;}
161 FaultStat & stat() {return _stat;}
164 class DtbAcvFault : public AlphaFault
167 static FaultName _name;
168 static FaultVect _vect;
169 static FaultStat _stat;
171 FaultName name() {return _name;}
172 FaultVect vect() {return _vect;}
173 FaultStat & stat() {return _stat;}
176 class ItbMissFault : public AlphaFault
179 static FaultName _name;
180 static FaultVect _vect;
181 static FaultStat _stat;
183 FaultName name() {return _name;}
184 FaultVect vect() {return _vect;}
185 FaultStat & stat() {return _stat;}
188 class ItbPageFault : public AlphaFault
191 static FaultName _name;
192 static FaultVect _vect;
193 static FaultStat _stat;
195 FaultName name() {return _name;}
196 FaultVect vect() {return _vect;}
197 FaultStat & stat() {return _stat;}
200 class ItbAcvFault : public AlphaFault
203 static FaultName _name;
204 static FaultVect _vect;
205 static FaultStat _stat;
207 FaultName name() {return _name;}
208 FaultVect vect() {return _vect;}
209 FaultStat & stat() {return _stat;}
212 class UnimplementedOpcodeFault : public AlphaFault
215 static FaultName _name;
216 static FaultVect _vect;
217 static FaultStat _stat;
219 FaultName name() {return _name;}
220 FaultVect vect() {return _vect;}
221 FaultStat & stat() {return _stat;}
224 class FloatEnableFault : public AlphaFault
227 static FaultName _name;
228 static FaultVect _vect;
229 static FaultStat _stat;
231 FaultName name() {return _name;}
232 FaultVect vect() {return _vect;}
233 FaultStat & stat() {return _stat;}
236 class PalFault : public AlphaFault
239 static FaultName _name;
240 static FaultVect _vect;
241 static FaultStat _stat;
243 FaultName name() {return _name;}
244 FaultVect vect() {return _vect;}
245 FaultStat & stat() {return _stat;}
248 class IntegerOverflowFault : public AlphaFault
251 static FaultName _name;
252 static FaultVect _vect;
253 static FaultStat _stat;
255 FaultName name() {return _name;}
256 FaultVect vect() {return _vect;}
257 FaultStat & stat() {return _stat;}
260 } // AlphaISA namespace
262 #endif // __FAULTS_HH__