faults.hh revision 2167
12139SN/A/*
22139SN/A * Copyright (c) 2003-2005 The Regents of The University of Michigan
32139SN/A * All rights reserved.
42139SN/A *
52139SN/A * Redistribution and use in source and binary forms, with or without
62139SN/A * modification, are permitted provided that the following conditions are
72139SN/A * met: redistributions of source code must retain the above copyright
82139SN/A * notice, this list of conditions and the following disclaimer;
92139SN/A * redistributions in binary form must reproduce the above copyright
102139SN/A * notice, this list of conditions and the following disclaimer in the
112139SN/A * documentation and/or other materials provided with the distribution;
122139SN/A * neither the name of the copyright holders nor the names of its
132139SN/A * contributors may be used to endorse or promote products derived from
142139SN/A * this software without specific prior written permission.
152139SN/A *
162139SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172139SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182139SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192139SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202139SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212139SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222139SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232139SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242139SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252139SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262139SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272139SN/A */
282665Ssaidi@eecs.umich.edu
292665Ssaidi@eecs.umich.edu#ifndef __ALPHA_FAULTS_HH__
302139SN/A#define __ALPHA_FAULTS_HH__
314202Sbinkertn@umich.edu
322139SN/A#include "sim/faults.hh"
334202Sbinkertn@umich.edu
342152SN/A// The design of the "name" and "vect" functions is in sim/faults.hh
352152SN/A
362139SN/Anamespace AlphaISA
372139SN/A{
382139SN/A
392139SN/Atypedef const Addr FaultVect;
402139SN/A
412152SN/Aclass AlphaFault : public FaultBase
422152SN/A{
432139SN/A  private:
442139SN/A    static FaultName _name;
452139SN/A    static FaultVect _vect;
464781Snate@binkert.org    static FaultStat _stat;
474781Snate@binkert.org  public:
484781Snate@binkert.org    FaultName name() {return _name;}
496313Sgblack@eecs.umich.edu    virtual FaultVect vect() {return _vect;}
504781Snate@binkert.org    virtual FaultStat & stat() {return _stat;}
514781Snate@binkert.org};
523170Sstever@eecs.umich.edu
535664Sgblack@eecs.umich.educlass AlphaMachineCheckFault : public MachineCheckFault
543806Ssaidi@eecs.umich.edu{
556179Sksewell@umich.edu  private:
564781Snate@binkert.org    static FaultVect _vect;
574781Snate@binkert.org  public:
584781Snate@binkert.org    FaultVect vect() {return _vect;}
594781Snate@binkert.org};
604781Snate@binkert.org
614781Snate@binkert.orgclass AlphaAlignmentFault : public AlignmentFault
624781Snate@binkert.org{
634781Snate@binkert.org  private:
644781Snate@binkert.org    static FaultVect _vect;
652139SN/A  public:
662139SN/A    FaultVect vect() {return _vect;}
673546Sgblack@eecs.umich.edu};
684202Sbinkertn@umich.edu
692152SN/Astatic inline Fault genMachineCheckFault()
702152SN/A{
712152SN/A    return new AlphaMachineCheckFault;
722152SN/A}
732152SN/A
742152SN/Astatic inline Fault genAlignmentFault()
752152SN/A{
762152SN/A    return new AlphaAlignmentFault;
772152SN/A}
782152SN/A
792152SN/Aclass ResetFault : public AlphaFault
802152SN/A{
812504SN/A  private:
822504SN/A    static FaultName _name;
832504SN/A    static FaultVect _vect;
842504SN/A    static FaultStat _stat;
852152SN/A  public:
862504SN/A    FaultName name() {return _name;}
872152SN/A    FaultVect vect() {return _vect;}
882152SN/A    FaultStat & stat() {return _stat;}
892152SN/A};
902152SN/A
912152SN/Aclass ArithmeticFault : public AlphaFault
922152SN/A{
932152SN/A  private:
942152SN/A    static FaultName _name;
952632Sstever@eecs.umich.edu    static FaultVect _vect;
962155SN/A    static FaultStat _stat;
972155SN/A  public:
982155SN/A    FaultName name() {return _name;}
992155SN/A    FaultVect vect() {return _vect;}
1002155SN/A    FaultStat & stat() {return _stat;}
1012155SN/A};
1025228Sgblack@eecs.umich.edu
1032155SN/Aclass InterruptFault : public AlphaFault
1042155SN/A{
1052155SN/A  private:
1062152SN/A    static FaultName _name;
1072766Sktlim@umich.edu    static FaultVect _vect;
1082766Sktlim@umich.edu    static FaultStat _stat;
1092766Sktlim@umich.edu  public:
1102766Sktlim@umich.edu    FaultName name() {return _name;}
1112766Sktlim@umich.edu    FaultVect vect() {return _vect;}
1122152SN/A    FaultStat & stat() {return _stat;}
1132152SN/A};
1142152SN/A
1152155SN/Aclass NDtbMissFault : public AlphaFault
1162152SN/A{
1172152SN/A  private:
1182718Sstever@eecs.umich.edu    static FaultName _name;
1192921Sktlim@umich.edu    static FaultVect _vect;
1202921Sktlim@umich.edu    static FaultStat _stat;
1212921Sktlim@umich.edu  public:
1222921Sktlim@umich.edu    FaultName name() {return _name;}
1232921Sktlim@umich.edu    FaultVect vect() {return _vect;}
1242921Sktlim@umich.edu    FaultStat & stat() {return _stat;}
1252921Sktlim@umich.edu};
1262921Sktlim@umich.edu
1272921Sktlim@umich.educlass PDtbMissFault : public AlphaFault
1282152SN/A{
1292152SN/A  private:
1305944Sgblack@eecs.umich.edu    static FaultName _name;
1315944Sgblack@eecs.umich.edu    static FaultVect _vect;
1325944Sgblack@eecs.umich.edu    static FaultStat _stat;
1335944Sgblack@eecs.umich.edu  public:
1345944Sgblack@eecs.umich.edu    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