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 virtual FaultBase
45 void ev5_trap(ExecContext * xc);
47 virtual FaultVect vect() = 0;
50 class AlphaMachineCheckFault :
51 public MachineCheckFault,
55 static FaultVect _vect;
56 static FaultStat _stat;
59 void ev5_trap(ExecContext * xc);
61 FaultVect vect() {return _vect;}
62 FaultStat & stat() {return _stat;}
65 class AlphaAlignmentFault :
66 public AlignmentFault,
70 static FaultVect _vect;
71 static FaultStat _stat;
74 void ev5_trap(ExecContext * xc);
76 FaultVect vect() {return _vect;}
77 FaultStat & stat() {return _stat;}
80 static inline Fault genMachineCheckFault()
82 return new AlphaMachineCheckFault;
85 static inline Fault genAlignmentFault()
87 return new AlphaAlignmentFault;
90 class ResetFault : public AlphaFault
93 static FaultName _name;
94 static FaultVect _vect;
95 static FaultStat _stat;
97 FaultName name() {return _name;}
98 FaultVect vect() {return _vect;}
99 FaultStat & stat() {return _stat;}
102 class ArithmeticFault : public AlphaFault
105 static FaultName _name;
106 static FaultVect _vect;
107 static FaultStat _stat;
109 FaultName name() {return _name;}
110 FaultVect vect() {return _vect;}
111 FaultStat & stat() {return _stat;}
114 class InterruptFault : public AlphaFault
117 static FaultName _name;
118 static FaultVect _vect;
119 static FaultStat _stat;
121 FaultName name() {return _name;}
122 FaultVect vect() {return _vect;}
123 FaultStat & stat() {return _stat;}
126 class NDtbMissFault : public AlphaFault
129 static FaultName _name;
130 static FaultVect _vect;
131 static FaultStat _stat;
133 FaultName name() {return _name;}
134 FaultVect vect() {return _vect;}
135 FaultStat & stat() {return _stat;}
138 class PDtbMissFault : public AlphaFault
141 static FaultName _name;
142 static FaultVect _vect;
143 static FaultStat _stat;
145 FaultName name() {return _name;}
146 FaultVect vect() {return _vect;}
147 FaultStat & stat() {return _stat;}
150 class DtbPageFault : public AlphaFault
153 static FaultName _name;
154 static FaultVect _vect;
155 static FaultStat _stat;
157 FaultName name() {return _name;}
158 FaultVect vect() {return _vect;}
159 FaultStat & stat() {return _stat;}
162 class DtbAcvFault : public AlphaFault
165 static FaultName _name;
166 static FaultVect _vect;
167 static FaultStat _stat;
169 FaultName name() {return _name;}
170 FaultVect vect() {return _vect;}
171 FaultStat & stat() {return _stat;}
174 class ItbMissFault : public AlphaFault
177 static FaultName _name;
178 static FaultVect _vect;
179 static FaultStat _stat;
181 FaultName name() {return _name;}
182 FaultVect vect() {return _vect;}
183 FaultStat & stat() {return _stat;}
186 class ItbPageFault : public AlphaFault
189 static FaultName _name;
190 static FaultVect _vect;
191 static FaultStat _stat;
193 FaultName name() {return _name;}
194 FaultVect vect() {return _vect;}
195 FaultStat & stat() {return _stat;}
198 class ItbAcvFault : public AlphaFault
201 static FaultName _name;
202 static FaultVect _vect;
203 static FaultStat _stat;
205 FaultName name() {return _name;}
206 FaultVect vect() {return _vect;}
207 FaultStat & stat() {return _stat;}
210 class UnimplementedOpcodeFault : public AlphaFault
213 static FaultName _name;
214 static FaultVect _vect;
215 static FaultStat _stat;
217 FaultName name() {return _name;}
218 FaultVect vect() {return _vect;}
219 FaultStat & stat() {return _stat;}
222 class FloatEnableFault : public AlphaFault
225 static FaultName _name;
226 static FaultVect _vect;
227 static FaultStat _stat;
229 FaultName name() {return _name;}
230 FaultVect vect() {return _vect;}
231 FaultStat & stat() {return _stat;}
234 class PalFault : public AlphaFault
237 static FaultName _name;
238 static FaultVect _vect;
239 static FaultStat _stat;
241 FaultName name() {return _name;}
242 FaultVect vect() {return _vect;}
243 FaultStat & stat() {return _stat;}
246 class IntegerOverflowFault : public AlphaFault
249 static FaultName _name;
250 static FaultVect _vect;
251 static FaultStat _stat;
253 FaultName name() {return _name;}
254 FaultVect vect() {return _vect;}
255 FaultStat & stat() {return _stat;}
258 } // AlphaISA namespace
260 #endif // __FAULTS_HH__