faults.hh revision 2147
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 reasoning behind 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 ResetFault : public AlphaFault
51{
52  private:
53    static FaultName _name;
54    static FaultVect _vect;
55    static FaultStat _stat;
56  public:
57    FaultName name() {return _name;}
58    FaultVect vect() {return _vect;}
59    FaultStat & stat() {return _stat;}
60};
61
62class ArithmeticFault : public AlphaFault
63{
64  private:
65    static FaultName _name;
66    static FaultVect _vect;
67    static FaultStat _stat;
68  public:
69    FaultName name() {return _name;}
70    FaultVect vect() {return _vect;}
71    FaultStat & stat() {return _stat;}
72};
73
74class InterruptFault : public AlphaFault
75{
76  private:
77    static FaultName _name;
78    static FaultVect _vect;
79    static FaultStat _stat;
80  public:
81    FaultName name() {return _name;}
82    FaultVect vect() {return _vect;}
83    FaultStat & stat() {return _stat;}
84};
85
86class NDtbMissFault : public AlphaFault
87{
88  private:
89    static FaultName _name;
90    static FaultVect _vect;
91    static FaultStat _stat;
92  public:
93    FaultName name() {return _name;}
94    FaultVect vect() {return _vect;}
95    FaultStat & stat() {return _stat;}
96};
97
98class PDtbMissFault : public AlphaFault
99{
100  private:
101    static FaultName _name;
102    static FaultVect _vect;
103    static FaultStat _stat;
104  public:
105    FaultName name() {return _name;}
106    FaultVect vect() {return _vect;}
107    FaultStat & stat() {return _stat;}
108};
109
110class DtbPageFault : public AlphaFault
111{
112  private:
113    static FaultName _name;
114    static FaultVect _vect;
115    static FaultStat _stat;
116  public:
117    FaultName name() {return _name;}
118    FaultVect vect() {return _vect;}
119    FaultStat & stat() {return _stat;}
120};
121
122class DtbAcvFault : public AlphaFault
123{
124  private:
125    static FaultName _name;
126    static FaultVect _vect;
127    static FaultStat _stat;
128  public:
129    FaultName name() {return _name;}
130    FaultVect vect() {return _vect;}
131    FaultStat & stat() {return _stat;}
132};
133
134class ItbMissFault : public AlphaFault
135{
136  private:
137    static FaultName _name;
138    static FaultVect _vect;
139    static FaultStat _stat;
140  public:
141    FaultName name() {return _name;}
142    FaultVect vect() {return _vect;}
143    FaultStat & stat() {return _stat;}
144};
145
146class ItbPageFault : public AlphaFault
147{
148  private:
149    static FaultName _name;
150    static FaultVect _vect;
151    static FaultStat _stat;
152  public:
153    FaultName name() {return _name;}
154    FaultVect vect() {return _vect;}
155    FaultStat & stat() {return _stat;}
156};
157
158class ItbAcvFault : public AlphaFault
159{
160  private:
161    static FaultName _name;
162    static FaultVect _vect;
163    static FaultStat _stat;
164  public:
165    FaultName name() {return _name;}
166    FaultVect vect() {return _vect;}
167    FaultStat & stat() {return _stat;}
168};
169
170class UnimplementedOpcodeFault : public AlphaFault
171{
172  private:
173    static FaultName _name;
174    static FaultVect _vect;
175    static FaultStat _stat;
176  public:
177    FaultName name() {return _name;}
178    FaultVect vect() {return _vect;}
179    FaultStat & stat() {return _stat;}
180};
181
182class FloatEnableFault : public AlphaFault
183{
184  private:
185    static FaultName _name;
186    static FaultVect _vect;
187    static FaultStat _stat;
188  public:
189    FaultName name() {return _name;}
190    FaultVect vect() {return _vect;}
191    FaultStat & stat() {return _stat;}
192};
193
194class PalFault : public AlphaFault
195{
196  private:
197    static FaultName _name;
198    static FaultVect _vect;
199    static FaultStat _stat;
200  public:
201    FaultName name() {return _name;}
202    FaultVect vect() {return _vect;}
203    FaultStat & stat() {return _stat;}
204};
205
206class IntegerOverflowFault : public AlphaFault
207{
208  private:
209    static FaultName _name;
210    static FaultVect _vect;
211    static FaultStat _stat;
212  public:
213    FaultName name() {return _name;}
214    FaultVect vect() {return _vect;}
215    FaultStat & stat() {return _stat;}
216};
217
218//Fault * ListOfFaults[];
219//int NumFaults;
220
221#endif // __FAULTS_HH__
222