faults.hh revision 2222
18528SN/A/*
28528SN/A * Copyright (c) 2003-2005 The Regents of The University of Michigan
38528SN/A * All rights reserved.
48825Snilay@cs.wisc.edu *
58528SN/A * Redistribution and use in source and binary forms, with or without
68528SN/A * modification, are permitted provided that the following conditions are
78528SN/A * met: redistributions of source code must retain the above copyright
88528SN/A * notice, this list of conditions and the following disclaimer;
98528SN/A * redistributions in binary form must reproduce the above copyright
108528SN/A * notice, this list of conditions and the following disclaimer in the
118891SAli.Saidi@ARM.com * documentation and/or other materials provided with the distribution;
128891SAli.Saidi@ARM.com * neither the name of the copyright holders nor the names of its
139575Ssaidi@eecs.umich.edu * contributors may be used to endorse or promote products derived from
148528SN/A * this software without specific prior written permission.
159348SAli.Saidi@ARM.com *
169575Ssaidi@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
179055Ssaidi@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
189348SAli.Saidi@ARM.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
198528SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
208528SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
218528SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
229575Ssaidi@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
238528SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
248528SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
258528SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
269449SAli.Saidi@ARM.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279575Ssaidi@eecs.umich.edu */
289079SAli.Saidi@ARM.com
298660SN/A#ifndef __ALPHA_FAULTS_HH__
308528SN/A#define __ALPHA_FAULTS_HH__
318528SN/A
328528SN/A#include "sim/faults.hh"
338528SN/A
348528SN/A// The design of the "name" and "vect" functions is in sim/faults.hh
358528SN/A
368528SN/Anamespace AlphaISA
378528SN/A{
388528SN/A
398891SAli.Saidi@ARM.comtypedef const Addr FaultVect;
408528SN/A
418528SN/Aclass AlphaFault : public FaultBase
428528SN/A{
439348SAli.Saidi@ARM.com  protected:
448528SN/A    virtual bool skipFaultingInstruction() {return false;}
458891SAli.Saidi@ARM.com    virtual bool setRestartAddress() {return true;}
468721SN/A  public:
478721SN/A#if FULL_SYSTEM
488891SAli.Saidi@ARM.com    void invoke(ExecContext * xc);
498891SAli.Saidi@ARM.com#endif
508528SN/A    virtual FaultVect vect() = 0;
518528SN/A    virtual FaultStat & countStat() = 0;
528528SN/A};
538528SN/A
548528SN/Aclass MachineCheckFault : public AlphaFault
558528SN/A{
568528SN/A  private:
578528SN/A    static FaultName _name;
588528SN/A    static FaultVect _vect;
598528SN/A    static FaultStat _count;
608528SN/A  public:
618528SN/A    FaultName name() {return _name;}
628528SN/A    FaultVect vect() {return _vect;}
638528SN/A    FaultStat & countStat() {return _count;}
648528SN/A    bool isMachineCheckFault() {return true;}
658528SN/A};
668528SN/A
678528SN/Aclass AlignmentFault : public AlphaFault
689575Ssaidi@eecs.umich.edu{
698528SN/A  private:
708528SN/A    static FaultName _name;
718528SN/A    static FaultVect _vect;
728528SN/A    static FaultStat _count;
739481Snilay@cs.wisc.edu  public:
748528SN/A    FaultName name() {return _name;}
758528SN/A    FaultVect vect() {return _vect;}
768528SN/A    FaultStat & countStat() {return _count;}
778528SN/A    bool isAlignmentFault() {return true;}
788528SN/A};
798528SN/A
808528SN/Astatic inline Fault genMachineCheckFault()
818528SN/A{
829481Snilay@cs.wisc.edu    return new MachineCheckFault;
838528SN/A}
848528SN/A
858528SN/Astatic inline Fault genAlignmentFault()
868528SN/A{
878528SN/A    return new AlignmentFault;
888528SN/A}
898528SN/A
908528SN/Aclass ResetFault : public AlphaFault
918528SN/A{
928528SN/A  private:
938528SN/A    static FaultName _name;
948528SN/A    static FaultVect _vect;
958528SN/A    static FaultStat _count;
968528SN/A  public:
978528SN/A    FaultName name() {return _name;}
988528SN/A    FaultVect vect() {return _vect;}
998528SN/A    FaultStat & countStat() {return _count;}
1008528SN/A};
1018528SN/A
1028528SN/Aclass ArithmeticFault : public AlphaFault
1038528SN/A{
1048528SN/A  protected:
1058528SN/A    bool skipFaultingInstruction() {return true;}
1068528SN/A  private:
1078528SN/A    static FaultName _name;
1088528SN/A    static FaultVect _vect;
1098528SN/A    static FaultStat _count;
1108528SN/A  public:
1118528SN/A    FaultName name() {return _name;}
1129449SAli.Saidi@ARM.com    FaultVect vect() {return _vect;}
1138528SN/A    FaultStat & countStat() {return _count;}
1148528SN/A#if FULL_SYSTEM
1158528SN/A    void invoke(ExecContext * xc);
1168528SN/A#endif
1178528SN/A};
1188528SN/A
1198528SN/Aclass InterruptFault : public AlphaFault
1208825Snilay@cs.wisc.edu{
1218528SN/A  protected:
1228528SN/A    bool setRestartAddress() {return false;}
1238528SN/A  private:
1248528SN/A    static FaultName _name;
1258528SN/A    static FaultVect _vect;
1268528SN/A    static FaultStat _count;
1278528SN/A  public:
1288528SN/A    FaultName name() {return _name;}
1298528SN/A    FaultVect vect() {return _vect;}
1308528SN/A    FaultStat & countStat() {return _count;}
1318528SN/A};
1328528SN/A
1338528SN/Aclass NDtbMissFault : public AlphaFault
1348528SN/A{
1358528SN/A  private:
1368528SN/A    static FaultName _name;
1378528SN/A    static FaultVect _vect;
1388528SN/A    static FaultStat _count;
1398528SN/A  public:
1408528SN/A    FaultName name() {return _name;}
1418528SN/A    FaultVect vect() {return _vect;}
1428528SN/A    FaultStat & countStat() {return _count;}
1438528SN/A};
1448528SN/A
1459449SAli.Saidi@ARM.comclass PDtbMissFault : public AlphaFault
1468528SN/A{
1478528SN/A  private:
1488528SN/A    static FaultName _name;
1498528SN/A    static FaultVect _vect;
1508528SN/A    static FaultStat _count;
1518825Snilay@cs.wisc.edu  public:
1528528SN/A    FaultName name() {return _name;}
1538528SN/A    FaultVect vect() {return _vect;}
1548528SN/A    FaultStat & countStat() {return _count;}
1559481Snilay@cs.wisc.edu};
1569481Snilay@cs.wisc.edu
1579481Snilay@cs.wisc.educlass DtbPageFault : public AlphaFault
1589481Snilay@cs.wisc.edu{
1599481Snilay@cs.wisc.edu  private:
1609481Snilay@cs.wisc.edu    static FaultName _name;
1619481Snilay@cs.wisc.edu    static FaultVect _vect;
1629481Snilay@cs.wisc.edu    static FaultStat _count;
1639481Snilay@cs.wisc.edu  public:
1649481Snilay@cs.wisc.edu    FaultName name() {return _name;}
1659481Snilay@cs.wisc.edu    FaultVect vect() {return _vect;}
1669481Snilay@cs.wisc.edu    FaultStat & countStat() {return _count;}
1679481Snilay@cs.wisc.edu};
1689481Snilay@cs.wisc.edu
1699481Snilay@cs.wisc.educlass DtbAcvFault : public AlphaFault
1709481Snilay@cs.wisc.edu{
1719481Snilay@cs.wisc.edu  private:
1729481Snilay@cs.wisc.edu    static FaultName _name;
1738528SN/A    static FaultVect _vect;
1748528SN/A    static FaultStat _count;
1758891SAli.Saidi@ARM.com  public:
1768528SN/A    FaultName name() {return _name;}
1778528SN/A    FaultVect vect() {return _vect;}
1789348SAli.Saidi@ARM.com    FaultStat & countStat() {return _count;}
1798528SN/A};
1809348SAli.Saidi@ARM.com
1818528SN/Aclass ItbMissFault : public AlphaFault
1828528SN/A{
1838528SN/A  private:
1848528SN/A    static FaultName _name;
1858835SAli.Saidi@ARM.com    static FaultVect _vect;
1869348SAli.Saidi@ARM.com    static FaultStat _count;
1878528SN/A  public:
1888835SAli.Saidi@ARM.com    FaultName name() {return _name;}
1898528SN/A    FaultVect vect() {return _vect;}
1908528SN/A    FaultStat & countStat() {return _count;}
1918528SN/A};
1928528SN/A
1938891SAli.Saidi@ARM.comclass ItbPageFault : public AlphaFault
1948528SN/A{
1958528SN/A  private:
1968528SN/A    static FaultName _name;
1978528SN/A    static FaultVect _vect;
1988528SN/A    static FaultStat _count;
1998528SN/A  public:
2008528SN/A    FaultName name() {return _name;}
2018528SN/A    FaultVect vect() {return _vect;}
2028528SN/A    FaultStat & countStat() {return _count;}
2039348SAli.Saidi@ARM.com};
2049265SAli.Saidi@ARM.com
2058528SN/Aclass ItbAcvFault : public AlphaFault
2068891SAli.Saidi@ARM.com{
2078528SN/A  private:
2088528SN/A    static FaultName _name;
2098528SN/A    static FaultVect _vect;
2108528SN/A    static FaultStat _count;
2118528SN/A  public:
2128528SN/A    FaultName name() {return _name;}
2138528SN/A    FaultVect vect() {return _vect;}
2148528SN/A    FaultStat & countStat() {return _count;}
2158528SN/A};
2168528SN/A
2178528SN/Aclass UnimplementedOpcodeFault : public AlphaFault
2188528SN/A{
2198528SN/A  private:
2208528SN/A    static FaultName _name;
2218528SN/A    static FaultVect _vect;
2228528SN/A    static FaultStat _count;
2238528SN/A  public:
2248528SN/A    FaultName name() {return _name;}
2258528SN/A    FaultVect vect() {return _vect;}
2268528SN/A    FaultStat & countStat() {return _count;}
2278528SN/A};
2288528SN/A
2298528SN/Aclass FloatEnableFault : public AlphaFault
2308528SN/A{
2318528SN/A  private:
2328528SN/A    static FaultName _name;
2338528SN/A    static FaultVect _vect;
2348528SN/A    static FaultStat _count;
2358528SN/A  public:
2368528SN/A    FaultName name() {return _name;}
2378528SN/A    FaultVect vect() {return _vect;}
2388528SN/A    FaultStat & countStat() {return _count;}
2398528SN/A};
2408528SN/A
2418528SN/Aclass PalFault : public AlphaFault
2428528SN/A{
2438528SN/A  protected:
2448528SN/A    bool skipFaultingInstruction() {return true;}
2458528SN/A  private:
2468528SN/A    static FaultName _name;
2478528SN/A    static FaultVect _vect;
2488528SN/A    static FaultStat _count;
2498528SN/A  public:
2508528SN/A    FaultName name() {return _name;}
2518528SN/A    FaultVect vect() {return _vect;}
2528528SN/A    FaultStat & countStat() {return _count;}
2538528SN/A};
2548528SN/A
2558528SN/Aclass IntegerOverflowFault : public AlphaFault
2568528SN/A{
2578528SN/A  private:
2588528SN/A    static FaultName _name;
2598528SN/A    static FaultVect _vect;
2608528SN/A    static FaultStat _count;
2618528SN/A  public:
2628528SN/A    FaultName name() {return _name;}
2638528SN/A    FaultVect vect() {return _vect;}
2648528SN/A    FaultStat & countStat() {return _count;}
2658528SN/A};
2668528SN/A
2678528SN/A} // AlphaISA namespace
2688528SN/A
2698528SN/A#endif // __FAULTS_HH__
2708528SN/A