faults.hh revision 2201
16145Snate@binkert.org/*
26145Snate@binkert.org * Copyright (c) 2003-2005 The Regents of The University of Michigan
36145Snate@binkert.org * All rights reserved.
46145Snate@binkert.org *
56145Snate@binkert.org * Redistribution and use in source and binary forms, with or without
66145Snate@binkert.org * modification, are permitted provided that the following conditions are
76145Snate@binkert.org * met: redistributions of source code must retain the above copyright
86145Snate@binkert.org * notice, this list of conditions and the following disclaimer;
96145Snate@binkert.org * redistributions in binary form must reproduce the above copyright
106145Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
116145Snate@binkert.org * documentation and/or other materials provided with the distribution;
126145Snate@binkert.org * neither the name of the copyright holders nor the names of its
136145Snate@binkert.org * contributors may be used to endorse or promote products derived from
146145Snate@binkert.org * this software without specific prior written permission.
156145Snate@binkert.org *
166145Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
176145Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
186145Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
196145Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
206145Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
216145Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
226145Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236145Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246145Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256145Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
266145Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276145Snate@binkert.org */
286145Snate@binkert.org
297832Snate@binkert.org#ifndef __ALPHA_FAULTS_HH__
307832Snate@binkert.org#define __ALPHA_FAULTS_HH__
318645Snilay@cs.wisc.edu
327054Snate@binkert.org#include "sim/faults.hh"
338232Snate@binkert.org
346154Snate@binkert.org// The design of the "name" and "vect" functions is in sim/faults.hh
358229Snate@binkert.org
366154Snate@binkert.orgnamespace AlphaISA
377054Snate@binkert.org{
386154Snate@binkert.org
396145Snate@binkert.orgtypedef const Addr FaultVect;
407055Snate@binkert.org
417055Snate@binkert.orgclass AlphaFault : public virtual FaultBase
426145Snate@binkert.org{
436145Snate@binkert.org  protected:
446145Snate@binkert.org    virtual bool skipFaultingInstruction() {return false;}
456145Snate@binkert.org    virtual bool setRestartAddress() {return true;}
466145Snate@binkert.org  public:
476145Snate@binkert.org#if FULL_SYSTEM
486145Snate@binkert.org    void invoke(ExecContext * xc);
499499Snilay@cs.wisc.edu#endif
509230Snilay@cs.wisc.edu    virtual FaultVect vect() = 0;
519465Snilay@cs.wisc.edu};
529230Snilay@cs.wisc.edu
536145Snate@binkert.orgclass AlphaMachineCheckFault :
548259SBrad.Beckmann@amd.com    public MachineCheckFault,
557054Snate@binkert.org    public AlphaFault
566145Snate@binkert.org{
576145Snate@binkert.org  private:
589499Snilay@cs.wisc.edu    static FaultVect _vect;
599230Snilay@cs.wisc.edu    static FaultStat _stat;
609465Snilay@cs.wisc.edu  public:
619230Snilay@cs.wisc.edu    FaultVect vect() {return _vect;}
626145Snate@binkert.org    FaultStat & stat() {return _stat;}
638259SBrad.Beckmann@amd.com};
647054Snate@binkert.org
656145Snate@binkert.orgclass AlphaAlignmentFault :
666145Snate@binkert.org    public AlignmentFault,
677054Snate@binkert.org    public AlphaFault
689499Snilay@cs.wisc.edu{
699499Snilay@cs.wisc.edu  private:
706145Snate@binkert.org    static FaultVect _vect;
717054Snate@binkert.org    static FaultStat _stat;
727054Snate@binkert.org  public:
736145Snate@binkert.org    FaultVect vect() {return _vect;}
747832Snate@binkert.org    FaultStat & stat() {return _stat;}
757054Snate@binkert.org};
767054Snate@binkert.org
778259SBrad.Beckmann@amd.comstatic inline Fault genMachineCheckFault()
786145Snate@binkert.org{
797054Snate@binkert.org    return new AlphaMachineCheckFault;
806145Snate@binkert.org}
819863Snilay@cs.wisc.edu
826145Snate@binkert.orgstatic inline Fault genAlignmentFault()
836145Snate@binkert.org{
847054Snate@binkert.org    return new AlphaAlignmentFault;
857454Snate@binkert.org}
869508Snilay@cs.wisc.edu
876145Snate@binkert.orgclass ResetFault : public AlphaFault
887054Snate@binkert.org{
897054Snate@binkert.org  private:
909508Snilay@cs.wisc.edu    static FaultName _name;
917054Snate@binkert.org    static FaultVect _vect;
926145Snate@binkert.org    static FaultStat _stat;
936145Snate@binkert.org  public:
947054Snate@binkert.org    FaultName name() {return _name;}
959508Snilay@cs.wisc.edu    FaultVect vect() {return _vect;}
966145Snate@binkert.org    FaultStat & stat() {return _stat;}
977454Snate@binkert.org};
987454Snate@binkert.org
997454Snate@binkert.orgclass ArithmeticFault : public AlphaFault
1006145Snate@binkert.org{
1017054Snate@binkert.org  protected:
1027054Snate@binkert.org    bool skipFaultingInstruction() {return true;}
1039465Snilay@cs.wisc.edu  private:
1048608Snilay@cs.wisc.edu    static FaultName _name;
1058608Snilay@cs.wisc.edu    static FaultVect _vect;
1067054Snate@binkert.org    static FaultStat _stat;
1077054Snate@binkert.org  public:
1086145Snate@binkert.org    FaultName name() {return _name;}
1096145Snate@binkert.org    FaultVect vect() {return _vect;}
1107054Snate@binkert.org    FaultStat & stat() {return _stat;}
1117054Snate@binkert.org    void invoke(ExecContext * xc);
1126145Snate@binkert.org};
1137054Snate@binkert.org
1147054Snate@binkert.orgclass InterruptFault : public AlphaFault
1157054Snate@binkert.org{
1166145Snate@binkert.org  protected:
1177054Snate@binkert.org    bool setRestartAddress() {return false;}
1187054Snate@binkert.org  private:
1197054Snate@binkert.org    static FaultName _name;
1207054Snate@binkert.org    static FaultVect _vect;
1217054Snate@binkert.org    static FaultStat _stat;
1227054Snate@binkert.org  public:
1236145Snate@binkert.org    FaultName name() {return _name;}
1247054Snate@binkert.org    FaultVect vect() {return _vect;}
1257054Snate@binkert.org    FaultStat & stat() {return _stat;}
1267054Snate@binkert.org};
1277054Snate@binkert.org
1287054Snate@binkert.orgclass NDtbMissFault : public AlphaFault
1297054Snate@binkert.org{
1306145Snate@binkert.org  private:
1316145Snate@binkert.org    static FaultName _name;
1327054Snate@binkert.org    static FaultVect _vect;
1337054Snate@binkert.org    static FaultStat _stat;
1347054Snate@binkert.org  public:
1357054Snate@binkert.org    FaultName name() {return _name;}
1367054Snate@binkert.org    FaultVect vect() {return _vect;}
1377054Snate@binkert.org    FaultStat & stat() {return _stat;}
1387054Snate@binkert.org};
1397054Snate@binkert.org
1407054Snate@binkert.orgclass PDtbMissFault : public AlphaFault
1417054Snate@binkert.org{
1427054Snate@binkert.org  private:
1437054Snate@binkert.org    static FaultName _name;
1447054Snate@binkert.org    static FaultVect _vect;
1457054Snate@binkert.org    static FaultStat _stat;
1467054Snate@binkert.org  public:
1477054Snate@binkert.org    FaultName name() {return _name;}
1487054Snate@binkert.org    FaultVect vect() {return _vect;}
1497054Snate@binkert.org    FaultStat & stat() {return _stat;}
1507453Snate@binkert.org};
1517054Snate@binkert.org
1527054Snate@binkert.orgclass DtbPageFault : public AlphaFault
1537054Snate@binkert.org{
1547780Snilay@cs.wisc.edu  private:
1557780Snilay@cs.wisc.edu    static FaultName _name;
1567054Snate@binkert.org    static FaultVect _vect;
1579508Snilay@cs.wisc.edu    static FaultStat _stat;
1587054Snate@binkert.org  public:
1597054Snate@binkert.org    FaultName name() {return _name;}
16010074Snilay@cs.wisc.edu    FaultVect vect() {return _vect;}
16110226Snilay@cs.wisc.edu    FaultStat & stat() {return _stat;}
1627054Snate@binkert.org};
1637054Snate@binkert.org
1649863Snilay@cs.wisc.educlass DtbAcvFault : public AlphaFault
1657054Snate@binkert.org{
1667780Snilay@cs.wisc.edu  private:
1677054Snate@binkert.org    static FaultName _name;
1687054Snate@binkert.org    static FaultVect _vect;
1697054Snate@binkert.org    static FaultStat _stat;
1707054Snate@binkert.org  public:
1717054Snate@binkert.org    FaultName name() {return _name;}
1727054Snate@binkert.org    FaultVect vect() {return _vect;}
1737054Snate@binkert.org    FaultStat & stat() {return _stat;}
1747054Snate@binkert.org};
1757054Snate@binkert.org
1767054Snate@binkert.orgclass ItbMissFault : public AlphaFault
1777054Snate@binkert.org{
1787780Snilay@cs.wisc.edu  private:
1797054Snate@binkert.org    static FaultName _name;
1807054Snate@binkert.org    static FaultVect _vect;
1817054Snate@binkert.org    static FaultStat _stat;
1827054Snate@binkert.org  public:
1836145Snate@binkert.org    FaultName name() {return _name;}
1846145Snate@binkert.org    FaultVect vect() {return _vect;}
1857054Snate@binkert.org    FaultStat & stat() {return _stat;}
1867054Snate@binkert.org};
1877054Snate@binkert.org
1886145Snate@binkert.orgclass ItbPageFault : public AlphaFault
1897054Snate@binkert.org{
1907054Snate@binkert.org  private:
1916145Snate@binkert.org    static FaultName _name;
1927054Snate@binkert.org    static FaultVect _vect;
1939863Snilay@cs.wisc.edu    static FaultStat _stat;
1947054Snate@binkert.org  public:
1957054Snate@binkert.org    FaultName name() {return _name;}
1967054Snate@binkert.org    FaultVect vect() {return _vect;}
1977054Snate@binkert.org    FaultStat & stat() {return _stat;}
1987054Snate@binkert.org};
1997780Snilay@cs.wisc.edu
2007054Snate@binkert.orgclass ItbAcvFault : public AlphaFault
2017780Snilay@cs.wisc.edu{
2027054Snate@binkert.org  private:
2037054Snate@binkert.org    static FaultName _name;
2047054Snate@binkert.org    static FaultVect _vect;
2059499Snilay@cs.wisc.edu    static FaultStat _stat;
2067054Snate@binkert.org  public:
2076145Snate@binkert.org    FaultName name() {return _name;}
2086145Snate@binkert.org    FaultVect vect() {return _vect;}
2097054Snate@binkert.org    FaultStat & stat() {return _stat;}
2109863Snilay@cs.wisc.edu};
2116145Snate@binkert.org
2129863Snilay@cs.wisc.educlass UnimplementedOpcodeFault : public AlphaFault
2139863Snilay@cs.wisc.edu{
2149863Snilay@cs.wisc.edu  private:
2159863Snilay@cs.wisc.edu    static FaultName _name;
2169863Snilay@cs.wisc.edu    static FaultVect _vect;
2179863Snilay@cs.wisc.edu    static FaultStat _stat;
2189863Snilay@cs.wisc.edu  public:
2199863Snilay@cs.wisc.edu    FaultName name() {return _name;}
2209863Snilay@cs.wisc.edu    FaultVect vect() {return _vect;}
2219863Snilay@cs.wisc.edu    FaultStat & stat() {return _stat;}
2229863Snilay@cs.wisc.edu};
2239863Snilay@cs.wisc.edu
2249863Snilay@cs.wisc.educlass FloatEnableFault : public AlphaFault
2259863Snilay@cs.wisc.edu{
2269863Snilay@cs.wisc.edu  private:
2279863Snilay@cs.wisc.edu    static FaultName _name;
2289863Snilay@cs.wisc.edu    static FaultVect _vect;
2299863Snilay@cs.wisc.edu    static FaultStat _stat;
2309863Snilay@cs.wisc.edu  public:
2319863Snilay@cs.wisc.edu    FaultName name() {return _name;}
2326145Snate@binkert.org    FaultVect vect() {return _vect;}
2336145Snate@binkert.org    FaultStat & stat() {return _stat;}
2347054Snate@binkert.org};
2357054Snate@binkert.org
2366145Snate@binkert.orgclass PalFault : public AlphaFault
2379863Snilay@cs.wisc.edu{
2386145Snate@binkert.org  protected:
2396145Snate@binkert.org    bool skipFaultingInstruction() {return true;}
2409863Snilay@cs.wisc.edu  private:
2419863Snilay@cs.wisc.edu    static FaultName _name;
2426145Snate@binkert.org    static FaultVect _vect;
2439863Snilay@cs.wisc.edu    static FaultStat _stat;
2449863Snilay@cs.wisc.edu  public:
2456145Snate@binkert.org    FaultName name() {return _name;}
2466145Snate@binkert.org    FaultVect vect() {return _vect;}
2477054Snate@binkert.org    FaultStat & stat() {return _stat;}
2487054Snate@binkert.org};
2496145Snate@binkert.org
2508054Sksewell@umich.educlass IntegerOverflowFault : public AlphaFault
2516145Snate@binkert.org{
2526145Snate@binkert.org  private:
2537054Snate@binkert.org    static FaultName _name;
2547054Snate@binkert.org    static FaultVect _vect;
2557054Snate@binkert.org    static FaultStat _stat;
2567054Snate@binkert.org  public:
2576145Snate@binkert.org    FaultName name() {return _name;}
2589275Snilay@cs.wisc.edu    FaultVect vect() {return _vect;}
2597054Snate@binkert.org    FaultStat & stat() {return _stat;}
2606145Snate@binkert.org};
2617054Snate@binkert.org
2627054Snate@binkert.org} // AlphaISA namespace
2637054Snate@binkert.org
2647054Snate@binkert.org#endif // __FAULTS_HH__
2657054Snate@binkert.org