faults.hh revision 2203
12817Sksewell@umich.edu/*
213610Sgiacomo.gabrielli@arm.com * Copyright (c) 2003-2005 The Regents of The University of Michigan
39920Syasuko.eckert@amd.com * All rights reserved.
48733Sgeoffrey.blake@arm.com *
58733Sgeoffrey.blake@arm.com * Redistribution and use in source and binary forms, with or without
68733Sgeoffrey.blake@arm.com * modification, are permitted provided that the following conditions are
78733Sgeoffrey.blake@arm.com * met: redistributions of source code must retain the above copyright
88733Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer;
98733Sgeoffrey.blake@arm.com * redistributions in binary form must reproduce the above copyright
108733Sgeoffrey.blake@arm.com * notice, this list of conditions and the following disclaimer in the
118733Sgeoffrey.blake@arm.com * documentation and/or other materials provided with the distribution;
128733Sgeoffrey.blake@arm.com * neither the name of the copyright holders nor the names of its
138733Sgeoffrey.blake@arm.com * contributors may be used to endorse or promote products derived from
148733Sgeoffrey.blake@arm.com * this software without specific prior written permission.
152817Sksewell@umich.edu *
162817Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172817Sksewell@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182817Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192817Sksewell@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202817Sksewell@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212817Sksewell@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222817Sksewell@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232817Sksewell@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242817Sksewell@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252817Sksewell@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262817Sksewell@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272817Sksewell@umich.edu */
282817Sksewell@umich.edu
292817Sksewell@umich.edu#ifndef __ALPHA_FAULTS_HH__
302817Sksewell@umich.edu#define __ALPHA_FAULTS_HH__
312817Sksewell@umich.edu
322817Sksewell@umich.edu#include "sim/faults.hh"
332817Sksewell@umich.edu
342817Sksewell@umich.edu// The design of the "name" and "vect" functions is in sim/faults.hh
352817Sksewell@umich.edu
362817Sksewell@umich.edunamespace AlphaISA
372817Sksewell@umich.edu{
382817Sksewell@umich.edu
392817Sksewell@umich.edutypedef const Addr FaultVect;
402817Sksewell@umich.edu
412817Sksewell@umich.educlass AlphaFault : public virtual FaultBase
422817Sksewell@umich.edu{
432817Sksewell@umich.edu  protected:
442817Sksewell@umich.edu    virtual bool skipFaultingInstruction() {return false;}
452817Sksewell@umich.edu    virtual bool setRestartAddress() {return true;}
462817Sksewell@umich.edu  public:
476658Snate@binkert.org#if FULL_SYSTEM
488229Snate@binkert.org    void invoke(ExecContext * xc);
492935Sksewell@umich.edu#endif
502817Sksewell@umich.edu    virtual FaultVect vect() = 0;
512834Sksewell@umich.edu};
522834Sksewell@umich.edu
532834Sksewell@umich.educlass MachineCheckFault : public AlphaFault
548902Sandreas.hansson@arm.com{
552834Sksewell@umich.edu  private:
562817Sksewell@umich.edu    static FaultName _name;
572817Sksewell@umich.edu    static FaultVect _vect;
582817Sksewell@umich.edu    static FaultStat _stat;
592817Sksewell@umich.edu  public:
602817Sksewell@umich.edu    FaultName name() {return _name;}
612817Sksewell@umich.edu    FaultVect vect() {return _vect;}
622817Sksewell@umich.edu    FaultStat & stat() {return _stat;}
632817Sksewell@umich.edu    bool isMachineCheckFault() {return true;}
642817Sksewell@umich.edu};
652817Sksewell@umich.edu
662817Sksewell@umich.educlass AlignmentFault : public AlphaFault
672817Sksewell@umich.edu{
682817Sksewell@umich.edu  private:
692817Sksewell@umich.edu    static FaultName _name;
702817Sksewell@umich.edu    static FaultVect _vect;
712817Sksewell@umich.edu    static FaultStat _stat;
722817Sksewell@umich.edu  public:
732817Sksewell@umich.edu    FaultName name() {return _name;}
742817Sksewell@umich.edu    FaultVect vect() {return _vect;}
752817Sksewell@umich.edu    FaultStat & stat() {return _stat;}
762817Sksewell@umich.edu    bool isAlignmentFault() {return true;}
772817Sksewell@umich.edu};
782817Sksewell@umich.edu
792817Sksewell@umich.edustatic inline Fault genMachineCheckFault()
802817Sksewell@umich.edu{
813784Sgblack@eecs.umich.edu    return new MachineCheckFault;
8213628SAndrea.Mondelli@ucf.edu}
833784Sgblack@eecs.umich.edu
843784Sgblack@eecs.umich.edustatic inline Fault genAlignmentFault()
8513628SAndrea.Mondelli@ucf.edu{
863784Sgblack@eecs.umich.edu    return new AlignmentFault;
8713628SAndrea.Mondelli@ucf.edu}
888733Sgeoffrey.blake@arm.com
8913693Sgiacomo.gabrielli@arm.comclass ResetFault : public AlphaFault
9013693Sgiacomo.gabrielli@arm.com{
9113693Sgiacomo.gabrielli@arm.com  private:
9213693Sgiacomo.gabrielli@arm.com    static FaultName _name;
9313693Sgiacomo.gabrielli@arm.com    static FaultVect _vect;
9413693Sgiacomo.gabrielli@arm.com    static FaultStat _stat;
959023Sgblack@eecs.umich.edu  public:
9613628SAndrea.Mondelli@ucf.edu    FaultName name() {return _name;}
979023Sgblack@eecs.umich.edu    FaultVect vect() {return _vect;}
989023Sgblack@eecs.umich.edu    FaultStat & stat() {return _stat;}
999023Sgblack@eecs.umich.edu};
1008541Sgblack@eecs.umich.edu
1012817Sksewell@umich.educlass ArithmeticFault : public AlphaFault
10213865Sgabeblack@google.com{
1032817Sksewell@umich.edu  protected:
1042817Sksewell@umich.edu    bool skipFaultingInstruction() {return true;}
10513865Sgabeblack@google.com  private:
1062817Sksewell@umich.edu    static FaultName _name;
10710190Sakash.bagdia@arm.com    static FaultVect _vect;
10813865Sgabeblack@google.com    static FaultStat _stat;
10910190Sakash.bagdia@arm.com  public:
11013865Sgabeblack@google.com    FaultName name() {return _name;}
1115714Shsul@eecs.umich.edu    FaultVect vect() {return _vect;}
11213865Sgabeblack@google.com    FaultStat & stat() {return _stat;}
1135714Shsul@eecs.umich.edu#if FULL_SYSTEM
1145715Shsul@eecs.umich.edu    void invoke(ExecContext * xc);
11513865Sgabeblack@google.com#endif
11613865Sgabeblack@google.com};
1175715Shsul@eecs.umich.edu
1182817Sksewell@umich.educlass InterruptFault : public AlphaFault
11913865Sgabeblack@google.com{
1202817Sksewell@umich.edu  protected:
1212817Sksewell@umich.edu    bool setRestartAddress() {return false;}
12213905Sgabeblack@google.com  private:
12313865Sgabeblack@google.com    static FaultName _name;
12413865Sgabeblack@google.com    static FaultVect _vect;
12513865Sgabeblack@google.com    static FaultStat _stat;
12613865Sgabeblack@google.com  public:
1272817Sksewell@umich.edu    FaultName name() {return _name;}
1288541Sgblack@eecs.umich.edu    FaultVect vect() {return _vect;}
12913865Sgabeblack@google.com    FaultStat & stat() {return _stat;}
1308754Sgblack@eecs.umich.edu};
13113865Sgabeblack@google.com
13211886Sbrandon.potter@amd.comclass NDtbMissFault : public AlphaFault
13313865Sgabeblack@google.com{
1342817Sksewell@umich.edu  private:
13514022Sgabeblack@google.com    static FaultName _name;
1363675Sktlim@umich.edu    static FaultVect _vect;
13713865Sgabeblack@google.com    static FaultStat _stat;
13813865Sgabeblack@google.com  public:
13913865Sgabeblack@google.com    FaultName name() {return _name;}
14013865Sgabeblack@google.com    FaultVect vect() {return _vect;}
14113865Sgabeblack@google.com    FaultStat & stat() {return _stat;}
1428799Sgblack@eecs.umich.edu};
14314022Sgabeblack@google.com
14413865Sgabeblack@google.comclass PDtbMissFault : public AlphaFault
14513865Sgabeblack@google.com{
14613865Sgabeblack@google.com  private:
14713865Sgabeblack@google.com    static FaultName _name;
1482817Sksewell@umich.edu    static FaultVect _vect;
1492817Sksewell@umich.edu    static FaultStat _stat;
15013865Sgabeblack@google.com  public:
1512817Sksewell@umich.edu    FaultName name() {return _name;}
1522817Sksewell@umich.edu    FaultVect vect() {return _vect;}
15313865Sgabeblack@google.com    FaultStat & stat() {return _stat;}
15413865Sgabeblack@google.com};
15513865Sgabeblack@google.com
15613865Sgabeblack@google.comclass DtbPageFault : public AlphaFault
15713865Sgabeblack@google.com{
1582817Sksewell@umich.edu  private:
15910407Smitch.hayenga@arm.com    static FaultName _name;
16013865Sgabeblack@google.com    static FaultVect _vect;
1612817Sksewell@umich.edu    static FaultStat _stat;
1622817Sksewell@umich.edu  public:
16313865Sgabeblack@google.com    FaultName name() {return _name;}
1642817Sksewell@umich.edu    FaultVect vect() {return _vect;}
1652817Sksewell@umich.edu    FaultStat & stat() {return _stat;}
16613865Sgabeblack@google.com};
1672817Sksewell@umich.edu
1682817Sksewell@umich.educlass DtbAcvFault : public AlphaFault
1692817Sksewell@umich.edu{
1702817Sksewell@umich.edu  private:
17113865Sgabeblack@google.com    static FaultName _name;
1728777Sgblack@eecs.umich.edu    static FaultVect _vect;
1732817Sksewell@umich.edu    static FaultStat _stat;
17413865Sgabeblack@google.com  public:
1752817Sksewell@umich.edu    FaultName name() {return _name;}
1762817Sksewell@umich.edu    FaultVect vect() {return _vect;}
17713865Sgabeblack@google.com    FaultStat & stat() {return _stat;}
1782817Sksewell@umich.edu};
1792817Sksewell@umich.edu
18013865Sgabeblack@google.comclass ItbMissFault : public AlphaFault
1812817Sksewell@umich.edu{
18213865Sgabeblack@google.com  private:
1832817Sksewell@umich.edu    static FaultName _name;
1842817Sksewell@umich.edu    static FaultVect _vect;
18513865Sgabeblack@google.com    static FaultStat _stat;
1862817Sksewell@umich.edu  public:
18713865Sgabeblack@google.com    FaultName name() {return _name;}
1882817Sksewell@umich.edu    FaultVect vect() {return _vect;}
1892817Sksewell@umich.edu    FaultStat & stat() {return _stat;}
19013865Sgabeblack@google.com};
1912817Sksewell@umich.edu
1922817Sksewell@umich.educlass ItbPageFault : public AlphaFault
19313865Sgabeblack@google.com{
1942817Sksewell@umich.edu  private:
1952817Sksewell@umich.edu    static FaultName _name;
19613865Sgabeblack@google.com    static FaultVect _vect;
19713865Sgabeblack@google.com    static FaultStat _stat;
19813557Sgabeblack@google.com  public:
19912106SRekai.GonzalezAlberquilla@arm.com    FaultName name() {return _name;}
20012106SRekai.GonzalezAlberquilla@arm.com    FaultVect vect() {return _vect;}
20112106SRekai.GonzalezAlberquilla@arm.com    FaultStat & stat() {return _stat;}
20213865Sgabeblack@google.com};
20313865Sgabeblack@google.com
20413557Sgabeblack@google.comclass ItbAcvFault : public AlphaFault
20512106SRekai.GonzalezAlberquilla@arm.com{
20612106SRekai.GonzalezAlberquilla@arm.com  private:
2079426SAndreas.Sandberg@ARM.com    static FaultName _name;
2082817Sksewell@umich.edu    static FaultVect _vect;
20913865Sgabeblack@google.com    static FaultStat _stat;
21013865Sgabeblack@google.com  public:
21113557Sgabeblack@google.com    FaultName name() {return _name;}
21213611Sgabeblack@google.com    FaultVect vect() {return _vect;}
21313611Sgabeblack@google.com    FaultStat & stat() {return _stat;}
2149426SAndreas.Sandberg@ARM.com};
2152817Sksewell@umich.edu
21613865Sgabeblack@google.comclass UnimplementedOpcodeFault : public AlphaFault
21713628SAndrea.Mondelli@ucf.edu{
21813557Sgabeblack@google.com  private:
21912109SRekai.GonzalezAlberquilla@arm.com    static FaultName _name;
22012109SRekai.GonzalezAlberquilla@arm.com    static FaultVect _vect;
22112109SRekai.GonzalezAlberquilla@arm.com    static FaultStat _stat;
22212109SRekai.GonzalezAlberquilla@arm.com  public:
22312109SRekai.GonzalezAlberquilla@arm.com    FaultName name() {return _name;}
22412109SRekai.GonzalezAlberquilla@arm.com    FaultVect vect() {return _vect;}
22513865Sgabeblack@google.com    FaultStat & stat() {return _stat;}
22613628SAndrea.Mondelli@ucf.edu};
22713557Sgabeblack@google.com
22812109SRekai.GonzalezAlberquilla@arm.comclass FloatEnableFault : public AlphaFault
22912109SRekai.GonzalezAlberquilla@arm.com{
23012109SRekai.GonzalezAlberquilla@arm.com  private:
23112109SRekai.GonzalezAlberquilla@arm.com    static FaultName _name;
23212109SRekai.GonzalezAlberquilla@arm.com    static FaultVect _vect;
23312109SRekai.GonzalezAlberquilla@arm.com    static FaultStat _stat;
23413865Sgabeblack@google.com  public:
23513628SAndrea.Mondelli@ucf.edu    FaultName name() {return _name;}
23612109SRekai.GonzalezAlberquilla@arm.com    FaultVect vect() {return _vect;}
23712109SRekai.GonzalezAlberquilla@arm.com    FaultStat & stat() {return _stat;}
23812109SRekai.GonzalezAlberquilla@arm.com};
23912109SRekai.GonzalezAlberquilla@arm.com
24012109SRekai.GonzalezAlberquilla@arm.comclass PalFault : public AlphaFault
24112109SRekai.GonzalezAlberquilla@arm.com{
24213865Sgabeblack@google.com  protected:
24313628SAndrea.Mondelli@ucf.edu    bool skipFaultingInstruction() {return true;}
24412109SRekai.GonzalezAlberquilla@arm.com  private:
24512109SRekai.GonzalezAlberquilla@arm.com    static FaultName _name;
24612109SRekai.GonzalezAlberquilla@arm.com    static FaultVect _vect;
24712109SRekai.GonzalezAlberquilla@arm.com    static FaultStat _stat;
24812109SRekai.GonzalezAlberquilla@arm.com  public:
24912109SRekai.GonzalezAlberquilla@arm.com    FaultName name() {return _name;}
25013865Sgabeblack@google.com    FaultVect vect() {return _vect;}
25113628SAndrea.Mondelli@ucf.edu    FaultStat & stat() {return _stat;}
25212109SRekai.GonzalezAlberquilla@arm.com};
25312109SRekai.GonzalezAlberquilla@arm.com
25412109SRekai.GonzalezAlberquilla@arm.comclass IntegerOverflowFault : public AlphaFault
25512109SRekai.GonzalezAlberquilla@arm.com{
25612109SRekai.GonzalezAlberquilla@arm.com  private:
25712109SRekai.GonzalezAlberquilla@arm.com    static FaultName _name;
25813865Sgabeblack@google.com    static FaultVect _vect;
25913628SAndrea.Mondelli@ucf.edu    static FaultStat _stat;
26012109SRekai.GonzalezAlberquilla@arm.com  public:
26112109SRekai.GonzalezAlberquilla@arm.com    FaultName name() {return _name;}
26212109SRekai.GonzalezAlberquilla@arm.com    FaultVect vect() {return _vect;}
26312109SRekai.GonzalezAlberquilla@arm.com    FaultStat & stat() {return _stat;}
26412109SRekai.GonzalezAlberquilla@arm.com};
26512109SRekai.GonzalezAlberquilla@arm.com
26613865Sgabeblack@google.com} // AlphaISA namespace
26713865Sgabeblack@google.com
26813865Sgabeblack@google.com#endif // __FAULTS_HH__
26913865Sgabeblack@google.com