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