gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
faults.hh
Go to the documentation of this file.
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  * Authors: Gabe Black
29  * Kevin Lim
30  */
31 
32 #ifndef __ARCH_ALPHA_FAULTS_HH__
33 #define __ARCH_ALPHA_FAULTS_HH__
34 
35 #include "arch/alpha/pagetable.hh"
36 #include "mem/request.hh"
37 #include "sim/faults.hh"
38 
39 // The design of the "name" and "vect" functions is in sim/faults.hh
40 
41 namespace AlphaISA {
42 
43 typedef Addr FaultVect;
44 
45 class AlphaFault : public FaultBase
46 {
47  protected:
48  virtual bool skipFaultingInstruction() {return false;}
49  virtual bool setRestartAddress() {return true;}
50  public:
51  virtual ~AlphaFault() {}
52  void invoke(ThreadContext * tc, const StaticInstPtr &inst =
54  virtual FaultVect vect() = 0;
55  virtual FaultStat & countStat() = 0;
56 };
57 
59 {
60  private:
61  static FaultName _name;
62  static FaultVect _vect;
63  static FaultStat _count;
64 
65  public:
66  FaultName name() const {return _name;}
67  FaultVect vect() {return _vect;}
68  FaultStat & countStat() {return _count;}
69 };
70 
71 class AlignmentFault : public AlphaFault
72 {
73  private:
74  static FaultName _name;
75  static FaultVect _vect;
76  static FaultStat _count;
77 
78  public:
79  FaultName name() const {return _name;}
80  FaultVect vect() {return _vect;}
81  FaultStat & countStat() {return _count;}
82  bool isAlignmentFault() const {return true;}
83 };
84 
85 class ResetFault : public AlphaFault
86 {
87  private:
88  static FaultName _name;
89  static FaultVect _vect;
90  static FaultStat _count;
91 
92  public:
93  FaultName name() const {return _name;}
94  FaultVect vect() {return _vect;}
95  FaultStat & countStat() {return _count;}
96 };
97 
99 {
100  private:
101  static FaultName _name;
102  static FaultVect _vect;
104 
105  protected:
106  bool skipFaultingInstruction() {return true;}
107 
108  public:
109  FaultName name() const {return _name;}
110  FaultVect vect() {return _vect;}
111  FaultStat & countStat() {return _count;}
112  void invoke(ThreadContext * tc, const StaticInstPtr &inst =
114 };
115 
117 {
118  private:
119  static FaultName _name;
120  static FaultVect _vect;
122 
123  protected:
124  bool setRestartAddress() {return false;}
125 
126  public:
127  FaultName name() const {return _name;}
128  FaultVect vect() {return _vect;}
129  FaultStat & countStat() {return _count;}
130 };
131 
132 class DtbFault : public AlphaFault
133 {
134  protected:
137  uint64_t flags;
138 
139  public:
140  DtbFault(VAddr _vaddr, Request::Flags _reqFlags, uint64_t _flags)
141  : vaddr(_vaddr), reqFlags(_reqFlags), flags(_flags)
142  { }
143  FaultName name() const = 0;
144  FaultVect vect() = 0;
145  FaultStat & countStat() = 0;
146  void invoke(ThreadContext * tc, const StaticInstPtr &inst =
148 };
149 
150 class NDtbMissFault : public DtbFault
151 {
152  private:
153  static FaultName _name;
154  static FaultVect _vect;
156 
157  public:
159  : DtbFault(vaddr, reqFlags, flags)
160  { }
161  FaultName name() const {return _name;}
162  FaultVect vect() {return _vect;}
163  FaultStat & countStat() {return _count;}
164  void invoke(ThreadContext * tc, const StaticInstPtr &inst =
166 };
167 
168 class PDtbMissFault : public DtbFault
169 {
170  private:
171  static FaultName _name;
172  static FaultVect _vect;
174 
175  public:
177  : DtbFault(vaddr, reqFlags, flags)
178  { }
179  FaultName name() const {return _name;}
180  FaultVect vect() {return _vect;}
181  FaultStat & countStat() {return _count;}
182 };
183 
184 class DtbPageFault : public DtbFault
185 {
186  private:
187  static FaultName _name;
188  static FaultVect _vect;
190 
191  public:
193  : DtbFault(vaddr, reqFlags, flags)
194  { }
195  FaultName name() const {return _name;}
196  FaultVect vect() {return _vect;}
197  FaultStat & countStat() {return _count;}
198 };
199 
200 class DtbAcvFault : public DtbFault
201 {
202  private:
203  static FaultName _name;
204  static FaultVect _vect;
206 
207  public:
209  : DtbFault(vaddr, reqFlags, flags)
210  { }
211  FaultName name() const {return _name;}
212  FaultVect vect() {return _vect;}
213  FaultStat & countStat() {return _count;}
214 };
215 
217 {
218  private:
219  static FaultName _name;
220  static FaultVect _vect;
222 
223  public:
225  : DtbFault(vaddr, reqFlags, flags)
226  { }
227  FaultName name() const {return _name;}
228  FaultVect vect() {return _vect;}
229  FaultStat & countStat() {return _count;}
230 };
231 
232 class ItbFault : public AlphaFault
233 {
234  protected:
236 
237  public:
238  ItbFault(Addr _pc) : pc(_pc) { }
239  FaultName name() const = 0;
240  FaultVect vect() = 0;
241  FaultStat & countStat() = 0;
242  void invoke(ThreadContext * tc, const StaticInstPtr &inst =
244 };
245 
246 class ItbPageFault : public ItbFault
247 {
248  private:
249  static FaultName _name;
250  static FaultVect _vect;
252 
253  public:
255  FaultName name() const {return _name;}
256  FaultVect vect() {return _vect;}
257  FaultStat & countStat() {return _count;}
258  void invoke(ThreadContext * tc, const StaticInstPtr &inst =
260 };
261 
262 class ItbAcvFault : public ItbFault
263 {
264  private:
265  static FaultName _name;
266  static FaultVect _vect;
268 
269  public:
271  FaultName name() const {return _name;}
272  FaultVect vect() {return _vect;}
273  FaultStat & countStat() {return _count;}
274 };
275 
277 {
278  private:
279  static FaultName _name;
280  static FaultVect _vect;
282 
283  public:
284  FaultName name() const {return _name;}
285  FaultVect vect() {return _vect;}
286  FaultStat & countStat() {return _count;}
287 };
288 
290 {
291  private:
292  static FaultName _name;
293  static FaultVect _vect;
295 
296  public:
297  FaultName name() const {return _name;}
298  FaultVect vect() {return _vect;}
299  FaultStat & countStat() {return _count;}
300 };
301 
302 class PalFault : public AlphaFault
303 {
304  private:
305  static FaultName _name;
306  static FaultVect _vect;
308 
309  protected:
310  bool skipFaultingInstruction() {return true;}
311 
312  public:
313  FaultName name() const {return _name;}
314  FaultVect vect() {return _vect;}
315  FaultStat & countStat() {return _count;}
316 };
317 
319 {
320  private:
321  static FaultName _name;
322  static FaultVect _vect;
324 
325  public:
326  FaultName name() const {return _name;}
327  FaultVect vect() {return _vect;}
328  FaultStat & countStat() {return _count;}
329 };
330 
331 } // namespace AlphaISA
332 
333 #endif // __ARCH_ALPHA_FAULTS_HH__
static FaultVect _vect
Definition: faults.hh:75
FaultName name() const
Definition: faults.hh:79
static FaultName _name
Definition: faults.hh:171
FaultName name() const
Definition: faults.hh:195
void invoke(ThreadContext *tc, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr)
Definition: faults.cc:172
virtual FaultStat & countStat()=0
FaultStat & countStat()=0
static FaultName _name
Definition: faults.hh:249
static FaultName _name
Definition: faults.hh:88
void invoke(ThreadContext *tc, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr)
Definition: faults.cc:203
static FaultStat _count
Definition: faults.hh:189
FaultName name() const
Definition: faults.hh:271
static FaultName _name
Definition: faults.hh:321
ItbPageFault(Addr pc)
Definition: faults.hh:254
FaultStat & countStat()
Definition: faults.hh:163
DtbAlignmentFault(VAddr vaddr, Request::Flags reqFlags, uint64_t flags)
Definition: faults.hh:224
static FaultName _name
Definition: faults.hh:101
static FaultName _name
Definition: faults.hh:305
ItbAcvFault(Addr pc)
Definition: faults.hh:270
FaultStat & countStat()
Definition: faults.hh:197
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
FaultName name() const
Definition: faults.hh:127
FaultName name() const =0
virtual FaultVect vect()=0
static FaultVect _vect
Definition: faults.hh:154
FaultVect vect()
Definition: faults.hh:80
static FaultStat _count
Definition: faults.hh:121
static FaultStat _count
Definition: faults.hh:90
FaultStat & countStat()
Definition: faults.hh:213
static FaultName _name
Definition: faults.hh:219
FaultName name() const
Definition: faults.hh:179
static FaultStat _count
Definition: faults.hh:323
static FaultName _name
Definition: faults.hh:119
FaultName name() const
Definition: faults.hh:227
void invoke(ThreadContext *tc, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr)
Definition: faults.cc:134
static FaultVect _vect
Definition: faults.hh:172
static FaultStat _count
Definition: faults.hh:221
static FaultVect _vect
Definition: faults.hh:120
ThreadContext is the external interface to all thread state for anything outside of the CPU...
FaultName name() const
Definition: faults.hh:297
FaultName name() const
Definition: faults.hh:211
static FaultVect _vect
Definition: faults.hh:266
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2475
static FaultVect _vect
Definition: faults.hh:102
static FaultVect _vect
Definition: faults.hh:306
static FaultVect _vect
Definition: faults.hh:89
FaultStat & countStat()
Definition: faults.hh:95
FaultVect vect()=0
ItbFault(Addr _pc)
Definition: faults.hh:238
FaultStat & countStat()
Definition: faults.hh:229
FaultStat & countStat()
Definition: faults.hh:257
FaultName name() const
Definition: faults.hh:93
static FaultName _name
Definition: faults.hh:203
FaultVect vect()
Definition: faults.hh:256
virtual ~AlphaFault()
Definition: faults.hh:51
FaultName name() const
Definition: faults.hh:109
static FaultVect _vect
Definition: faults.hh:293
static FaultVect _vect
Definition: faults.hh:188
FaultVect vect()
Definition: faults.hh:314
const char * FaultName
Definition: faults.hh:39
FaultStat & countStat()
Definition: faults.hh:273
void invoke(ThreadContext *tc, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr)
Definition: faults.cc:143
void invoke(ThreadContext *tc, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr)
Definition: faults.cc:110
FaultVect vect()
Definition: faults.hh:94
FaultStat & countStat()=0
bool isAlignmentFault() const
Definition: faults.hh:82
Request::Flags reqFlags
Definition: faults.hh:136
FaultName name() const
Definition: faults.hh:66
FaultName name() const
Definition: faults.hh:326
DtbFault(VAddr _vaddr, Request::Flags _reqFlags, uint64_t _flags)
Definition: faults.hh:140
DtbAcvFault(VAddr vaddr, Request::Flags reqFlags, uint64_t flags)
Definition: faults.hh:208
FaultVect vect()
Definition: faults.hh:272
static FaultVect _vect
Definition: faults.hh:250
FaultName name() const
Definition: faults.hh:313
FaultVect vect()
Definition: faults.hh:212
FaultStat & countStat()
Definition: faults.hh:181
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
FaultName name() const =0
static FaultStat _count
Definition: faults.hh:205
FaultVect vect()=0
FaultName name() const
Definition: faults.hh:161
static FaultVect _vect
Definition: faults.hh:322
FaultStat & countStat()
Definition: faults.hh:129
void invoke(ThreadContext *tc, const StaticInstPtr &inst=StaticInst::nullStaticInstPtr)
Definition: faults.cc:184
static FaultVect _vect
Definition: faults.hh:62
static FaultStat _count
Definition: faults.hh:267
FaultStat & countStat()
Definition: faults.hh:111
static FaultStat _count
Definition: faults.hh:251
static FaultName _name
Definition: faults.hh:61
static FaultName _name
Definition: faults.hh:74
static FaultVect _vect
Definition: faults.hh:204
FaultStat & countStat()
Definition: faults.hh:81
static FaultStat _count
Definition: faults.hh:63
FaultStat & countStat()
Definition: faults.hh:315
FaultStat & countStat()
Definition: faults.hh:299
static FaultName _name
Definition: faults.hh:265
uint64_t flags
Definition: faults.hh:137
virtual bool setRestartAddress()
Definition: faults.hh:49
NDtbMissFault(VAddr vaddr, Request::Flags reqFlags, uint64_t flags)
Definition: faults.hh:158
FaultVect vect()
Definition: faults.hh:162
static FaultName _name
Definition: faults.hh:187
static FaultName _name
Definition: faults.hh:153
static FaultStat _count
Definition: faults.hh:173
FaultVect vect()
Definition: faults.hh:180
FaultName name() const
Definition: faults.hh:255
FaultVect vect()
Definition: faults.hh:196
static StaticInstPtr nullStaticInstPtr
Pointer to a statically allocated "null" instruction object.
Definition: static_inst.hh:197
static FaultStat _count
Definition: faults.hh:103
bool skipFaultingInstruction()
Definition: faults.hh:310
bool skipFaultingInstruction()
Definition: faults.hh:106
static FaultVect _vect
Definition: faults.hh:220
static FaultStat _count
Definition: faults.hh:307
virtual bool skipFaultingInstruction()
Definition: faults.hh:48
static FaultStat _count
Definition: faults.hh:76
FaultStat & countStat()
Definition: faults.hh:68
DtbPageFault(VAddr vaddr, Request::Flags reqFlags, uint64_t flags)
Definition: faults.hh:192
PDtbMissFault(VAddr vaddr, Request::Flags reqFlags, uint64_t flags)
Definition: faults.hh:176
static FaultStat _count
Definition: faults.hh:294
Addr FaultVect
Definition: faults.hh:43
static FaultName _name
Definition: faults.hh:292
static FaultStat _count
Definition: faults.hh:155

Generated on Fri Jun 9 2017 13:03:34 for gem5 by doxygen 1.8.6