faults.hh revision 2166
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
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.
15 *
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.
27 */
28
29#ifndef __ALPHA_FAULTS_HH__
30#define __ALPHA_FAULTS_HH__
31
32#include "sim/faults.hh"
33
34// The design of the "name" and "vect" functions is in sim/faults.hh
35
36typedef const Addr FaultVect;
37
38class AlphaFault : public FaultBase
39{
40  private:
41    static FaultName _name;
42    static FaultVect _vect;
43    static FaultStat _stat;
44  public:
45    FaultName name() {return _name;}
46    virtual FaultVect vect() {return _vect;}
47    virtual FaultStat & stat() {return _stat;}
48};
49
50class AlphaMachineCheckFault : public MachineCheckFault
51{
52  private:
53    static FaultVect _vect;
54  public:
55    FaultVect vect() {return _vect;}
56};
57
58class AlphaAlignmentFault : public AlignmentFault
59{
60  private:
61    static FaultVect _vect;
62  public:
63    FaultVect vect() {return _vect;}
64};
65
66static inline Fault genMachineCheckFault()
67{
68    return new AlphaMachineCheckFault;
69}
70
71static inline Fault genAlignmentFault()
72{
73    return new AlphaAlignmentFault;
74}
75
76class ResetFault : public AlphaFault
77{
78  private:
79    static FaultName _name;
80    static FaultVect _vect;
81    static FaultStat _stat;
82  public:
83    FaultName name() {return _name;}
84    FaultVect vect() {return _vect;}
85    FaultStat & stat() {return _stat;}
86};
87
88class ArithmeticFault : public AlphaFault
89{
90  private:
91    static FaultName _name;
92    static FaultVect _vect;
93    static FaultStat _stat;
94  public:
95    FaultName name() {return _name;}
96    FaultVect vect() {return _vect;}
97    FaultStat & stat() {return _stat;}
98};
99
100class InterruptFault : public AlphaFault
101{
102  private:
103    static FaultName _name;
104    static FaultVect _vect;
105    static FaultStat _stat;
106  public:
107    FaultName name() {return _name;}
108    FaultVect vect() {return _vect;}
109    FaultStat & stat() {return _stat;}
110};
111
112class NDtbMissFault : public AlphaFault
113{
114  private:
115    static FaultName _name;
116    static FaultVect _vect;
117    static FaultStat _stat;
118  public:
119    FaultName name() {return _name;}
120    FaultVect vect() {return _vect;}
121    FaultStat & stat() {return _stat;}
122};
123
124class PDtbMissFault : public AlphaFault
125{
126  private:
127    static FaultName _name;
128    static FaultVect _vect;
129    static FaultStat _stat;
130  public:
131    FaultName name() {return _name;}
132    FaultVect vect() {return _vect;}
133    FaultStat & stat() {return _stat;}
134};
135
136class DtbPageFault : public AlphaFault
137{
138  private:
139    static FaultName _name;
140    static FaultVect _vect;
141    static FaultStat _stat;
142  public:
143    FaultName name() {return _name;}
144    FaultVect vect() {return _vect;}
145    FaultStat & stat() {return _stat;}
146};
147
148class DtbAcvFault : public AlphaFault
149{
150  private:
151    static FaultName _name;
152    static FaultVect _vect;
153    static FaultStat _stat;
154  public:
155    FaultName name() {return _name;}
156    FaultVect vect() {return _vect;}
157    FaultStat & stat() {return _stat;}
158};
159
160class ItbMissFault : public AlphaFault
161{
162  private:
163    static FaultName _name;
164    static FaultVect _vect;
165    static FaultStat _stat;
166  public:
167    FaultName name() {return _name;}
168    FaultVect vect() {return _vect;}
169    FaultStat & stat() {return _stat;}
170};
171
172class ItbPageFault : public AlphaFault
173{
174  private:
175    static FaultName _name;
176    static FaultVect _vect;
177    static FaultStat _stat;
178  public:
179    FaultName name() {return _name;}
180    FaultVect vect() {return _vect;}
181    FaultStat & stat() {return _stat;}
182};
183
184class ItbAcvFault : public AlphaFault
185{
186  private:
187    static FaultName _name;
188    static FaultVect _vect;
189    static FaultStat _stat;
190  public:
191    FaultName name() {return _name;}
192    FaultVect vect() {return _vect;}
193    FaultStat & stat() {return _stat;}
194};
195
196class UnimplementedOpcodeFault : public AlphaFault
197{
198  private:
199    static FaultName _name;
200    static FaultVect _vect;
201    static FaultStat _stat;
202  public:
203    FaultName name() {return _name;}
204    FaultVect vect() {return _vect;}
205    FaultStat & stat() {return _stat;}
206};
207
208class FloatEnableFault : public AlphaFault
209{
210  private:
211    static FaultName _name;
212    static FaultVect _vect;
213    static FaultStat _stat;
214  public:
215    FaultName name() {return _name;}
216    FaultVect vect() {return _vect;}
217    FaultStat & stat() {return _stat;}
218};
219
220class PalFault : public AlphaFault
221{
222  private:
223    static FaultName _name;
224    static FaultVect _vect;
225    static FaultStat _stat;
226  public:
227    FaultName name() {return _name;}
228    FaultVect vect() {return _vect;}
229    FaultStat & stat() {return _stat;}
230};
231
232class IntegerOverflowFault : public AlphaFault
233{
234  private:
235    static FaultName _name;
236    static FaultVect _vect;
237    static FaultStat _stat;
238  public:
239    FaultName name() {return _name;}
240    FaultVect vect() {return _vect;}
241    FaultStat & stat() {return _stat;}
242};
243
244#endif // __FAULTS_HH__
245