blob: b1b8a66e42a47c12e0268cfa22d512eb8ab0a9aa [file] [log] [blame]
Kevin Limf15e4922006-03-04 15:18:40 -05001/*
Geoffrey Blakeaf6aaf22012-01-31 07:46:03 -08002 * Copyright (c) 2011 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
Kevin Lim20eced32006-03-05 00:34:54 -050014 * Copyright (c) 2001-2006 The Regents of The University of Michigan
Kevin Limf15e4922006-03-04 15:18:40 -050015 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution;
24 * neither the name of the copyright holders nor the names of its
25 * contributors may be used to endorse or promote products derived from
26 * this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Ali Saidicb0cf2d2006-05-31 19:26:56 -040039 *
40 * Authors: Steve Reinhardt
41 * Nathan Binkert
Kevin Limf15e4922006-03-04 15:18:40 -050042 */
43
Kevin Lim54d42202006-06-07 15:29:53 -040044#ifndef __CPU_SIMPLE_THREAD_HH__
45#define __CPU_SIMPLE_THREAD_HH__
Kevin Limf15e4922006-03-04 15:18:40 -050046
Gabe Black32daf6f2009-07-08 23:02:20 -070047#include "arch/isa.hh"
Kevin Limf15e4922006-03-04 15:18:40 -050048#include "arch/isa_traits.hh"
Gabe Blackb398b8f2009-07-08 23:02:21 -070049#include "arch/registers.hh"
Gabe Black537239b2007-08-26 20:24:18 -070050#include "arch/tlb.hh"
Gabe Blacka480ba02009-07-08 23:02:20 -070051#include "arch/types.hh"
Nathan Binkert8d2e51c2009-05-17 14:34:52 -070052#include "base/types.hh"
Nathan Binkertd9f39c82009-09-23 08:34:21 -070053#include "config/the_isa.hh"
Gabe Blackb7b545b2011-09-09 02:30:01 -070054#include "cpu/decode.hh"
Kevin Limeb0e4162006-06-06 17:32:21 -040055#include "cpu/thread_context.hh"
Kevin Lim54d42202006-06-07 15:29:53 -040056#include "cpu/thread_state.hh"
Nathan Binkerteddac532011-04-15 10:44:32 -070057#include "debug/FloatRegs.hh"
58#include "debug/IntRegs.hh"
Gabe Black8ad2b8c2011-10-31 02:58:22 -070059#include "mem/page_table.hh"
Gabe Black872bbdf2006-03-09 18:35:28 -050060#include "mem/request.hh"
Kevin Limf15e4922006-03-04 15:18:40 -050061#include "sim/byteswap.hh"
Kevin Lim20eced32006-03-05 00:34:54 -050062#include "sim/eventq.hh"
Gabe Black8ad2b8c2011-10-31 02:58:22 -070063#include "sim/process.hh"
Kevin Limf15e4922006-03-04 15:18:40 -050064#include "sim/serialize.hh"
Gabe Black8ad2b8c2011-10-31 02:58:22 -070065#include "sim/system.hh"
Kevin Limf15e4922006-03-04 15:18:40 -050066
Kevin Limf15e4922006-03-04 15:18:40 -050067class BaseCPU;
Geoffrey Blake043709f2012-03-09 09:59:27 -050068class CheckerCPU;
Kevin Limf15e4922006-03-04 15:18:40 -050069
70class FunctionProfile;
71class ProfileNode;
Ali Saidibb80f712006-04-06 00:51:46 -040072
Gabe Black4bfb8542006-11-07 05:36:54 -050073namespace TheISA {
74 namespace Kernel {
75 class Statistics;
Andreas Hansson72538292012-03-19 06:36:09 -040076 }
77}
Kevin Lim4a5b51b2006-05-30 14:17:41 -040078
Kevin Lim54d42202006-06-07 15:29:53 -040079/**
80 * The SimpleThread object provides a combination of the ThreadState
81 * object and the ThreadContext interface. It implements the
82 * ThreadContext interface so that a ProxyThreadContext class can be
83 * made using SimpleThread as the template parameter (see
84 * thread_context.hh). It adds to the ThreadState object by adding all
85 * the objects needed for simple functional execution, including a
86 * simple architectural register file, and pointers to the ITB and DTB
87 * in full system mode. For CPU models that do not need more advanced
88 * ways to hold state (i.e. a separate physical register file, or
89 * separate fetch and commit PC's), this SimpleThread class provides
90 * all the necessary state for full architecture-level functional
91 * simulation. See the AtomicSimpleCPU or TimingSimpleCPU for
92 * examples.
93 */
Kevin Limf15e4922006-03-04 15:18:40 -050094
Kevin Lim54d42202006-06-07 15:29:53 -040095class SimpleThread : public ThreadState
Kevin Limf15e4922006-03-04 15:18:40 -050096{
97 protected:
Kevin Limf15e4922006-03-04 15:18:40 -050098 typedef TheISA::MachInst MachInst;
Kevin Limf15e4922006-03-04 15:18:40 -050099 typedef TheISA::MiscReg MiscReg;
Gabe Black8e4ec552006-03-14 15:55:00 -0500100 typedef TheISA::FloatReg FloatReg;
101 typedef TheISA::FloatRegBits FloatRegBits;
Kevin Limf15e4922006-03-04 15:18:40 -0500102 public:
Kevin Limeb0e4162006-06-06 17:32:21 -0400103 typedef ThreadContext::Status Status;
Kevin Limf15e4922006-03-04 15:18:40 -0500104
Kevin Limf15e4922006-03-04 15:18:40 -0500105 protected:
Gabe Black0cb180e2009-07-08 23:02:20 -0700106 union {
107 FloatReg f[TheISA::NumFloatRegs];
108 FloatRegBits i[TheISA::NumFloatRegs];
109 } floatRegs;
Gabe Blacka480ba02009-07-08 23:02:20 -0700110 TheISA::IntReg intRegs[TheISA::NumIntRegs];
Gabe Black32daf6f2009-07-08 23:02:20 -0700111 TheISA::ISA isa; // one "instance" of the current ISA.
Kevin Limf15e4922006-03-04 15:18:40 -0500112
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700113 TheISA::PCState _pcState;
Gabe Black43345bf2009-07-08 23:02:21 -0700114
Min Kyu Jeong5f91ec32010-08-23 11:18:40 -0500115 /** Did this instruction execute or is it predicated false */
116 bool predicate;
117
Kevin Limf15e4922006-03-04 15:18:40 -0500118 public:
Korey Sewellb2e51522011-06-19 21:43:33 -0400119 std::string name() const
120 {
Andreas Hansson4fdecae2012-01-31 11:50:07 -0500121 return csprintf("%s.[tid:%i]", baseCpu->name(), tc->threadId());
Korey Sewellb2e51522011-06-19 21:43:33 -0400122 }
123
Kevin Lim54d42202006-06-07 15:29:53 -0400124 ProxyThreadContext<SimpleThread> *tc;
Kevin Lim20eced32006-03-05 00:34:54 -0500125
Gabe Black872bbdf2006-03-09 18:35:28 -0500126 System *system;
127
Gabe Black7b5a96f2009-04-08 22:21:27 -0700128 TheISA::TLB *itb;
129 TheISA::TLB *dtb;
Kevin Limf15e4922006-03-04 15:18:40 -0500130
Gabe Blackb7b545b2011-09-09 02:30:01 -0700131 Decoder decoder;
132
Kevin Lim54d42202006-06-07 15:29:53 -0400133 // constructor: initialize SimpleThread from given process structure
Gabe Blackde21bb92011-11-18 01:33:28 -0800134 // FS
Kevin Lim54d42202006-06-07 15:29:53 -0400135 SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system,
Gabe Black7b5a96f2009-04-08 22:21:27 -0700136 TheISA::TLB *_itb, TheISA::TLB *_dtb,
Kevin Lim54d42202006-06-07 15:29:53 -0400137 bool use_kernel_stats = true);
Gabe Blackde21bb92011-11-18 01:33:28 -0800138 // SE
Gabe Blacke80ebc32012-02-10 02:05:31 -0800139 SimpleThread(BaseCPU *_cpu, int _thread_num, System *_system,
140 Process *_process, TheISA::TLB *_itb, TheISA::TLB *_dtb);
Kevin Lime7ccc942006-07-06 17:53:26 -0400141
Kevin Limfff75312006-07-06 23:13:38 -0400142 SimpleThread();
Kevin Lime7ccc942006-07-06 17:53:26 -0400143
Kevin Lim54d42202006-06-07 15:29:53 -0400144 virtual ~SimpleThread();
Kevin Limf15e4922006-03-04 15:18:40 -0500145
Kevin Limeb0e4162006-06-06 17:32:21 -0400146 virtual void takeOverFrom(ThreadContext *oldContext);
Kevin Limf15e4922006-03-04 15:18:40 -0500147
148 void regStats(const std::string &name);
149
Kevin Limfff75312006-07-06 23:13:38 -0400150 void copyTC(ThreadContext *context);
151
Kevin Lime7ccc942006-07-06 17:53:26 -0400152 void copyState(ThreadContext *oldContext);
153
Kevin Limf15e4922006-03-04 15:18:40 -0500154 void serialize(std::ostream &os);
155 void unserialize(Checkpoint *cp, const std::string &section);
156
Kevin Lim54d42202006-06-07 15:29:53 -0400157 /***************************************************************
158 * SimpleThread functions to provide CPU with access to various
Gabe Black56050792009-02-25 10:15:44 -0800159 * state.
Kevin Lim54d42202006-06-07 15:29:53 -0400160 **************************************************************/
Kevin Limf15e4922006-03-04 15:18:40 -0500161
Kevin Lim54d42202006-06-07 15:29:53 -0400162 /** Returns the pointer to this SimpleThread's ThreadContext. Used
163 * when a ThreadContext must be passed to objects outside of the
164 * CPU.
165 */
Kevin Limeb0e4162006-06-06 17:32:21 -0400166 ThreadContext *getTC() { return tc; }
Kevin Limf15e4922006-03-04 15:18:40 -0500167
Gabe Black8b4796a2008-02-26 23:38:51 -0500168 void demapPage(Addr vaddr, uint64_t asn)
169 {
170 itb->demapPage(vaddr, asn);
171 dtb->demapPage(vaddr, asn);
172 }
173
174 void demapInstPage(Addr vaddr, uint64_t asn)
175 {
176 itb->demapPage(vaddr, asn);
177 }
178
179 void demapDataPage(Addr vaddr, uint64_t asn)
180 {
181 dtb->demapPage(vaddr, asn);
182 }
183
Kevin Lim54d42202006-06-07 15:29:53 -0400184 void dumpFuncProfile();
Ali Saidibb80f712006-04-06 00:51:46 -0400185
Ali Saidib760b992008-10-20 16:22:59 -0400186 Fault hwrei();
187
188 bool simPalCheck(int palFunc);
189
Kevin Lim54d42202006-06-07 15:29:53 -0400190 /*******************************************
191 * ThreadContext interface functions.
192 ******************************************/
193
Andreas Hansson4fdecae2012-01-31 11:50:07 -0500194 BaseCPU *getCpuPtr() { return baseCpu; }
Kevin Lim54d42202006-06-07 15:29:53 -0400195
Gabe Black7b5a96f2009-04-08 22:21:27 -0700196 TheISA::TLB *getITBPtr() { return itb; }
Kevin Lim54d42202006-06-07 15:29:53 -0400197
Gabe Black7b5a96f2009-04-08 22:21:27 -0700198 TheISA::TLB *getDTBPtr() { return dtb; }
Kevin Lim54d42202006-06-07 15:29:53 -0400199
Geoffrey Blake043709f2012-03-09 09:59:27 -0500200 CheckerCPU *getCheckerCpuPtr() { return NULL; }
Geoffrey Blakeaf6aaf22012-01-31 07:46:03 -0800201
Gabe Blackb7b545b2011-09-09 02:30:01 -0700202 Decoder *getDecoderPtr() { return &decoder; }
203
Gabe Black537239b2007-08-26 20:24:18 -0700204 System *getSystemPtr() { return system; }
205
Kevin Lim54d42202006-06-07 15:29:53 -0400206 Status status() const { return _status; }
207
208 void setStatus(Status newStatus) { _status = newStatus; }
209
210 /// Set the status to Active. Optional delay indicates number of
211 /// cycles to wait before beginning execution.
212 void activate(int delay = 1);
213
214 /// Set the status to Suspended.
215 void suspend();
216
Kevin Lim54d42202006-06-07 15:29:53 -0400217 /// Set the status to Halted.
218 void halt();
219
Kevin Limf15e4922006-03-04 15:18:40 -0500220 virtual bool misspeculating();
221
Kevin Limeb0e4162006-06-06 17:32:21 -0400222 void copyArchRegs(ThreadContext *tc);
Kevin Limf15e4922006-03-04 15:18:40 -0500223
Gabe Black0cb180e2009-07-08 23:02:20 -0700224 void clearArchRegs()
225 {
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700226 _pcState = 0;
Gabe Blacka480ba02009-07-08 23:02:20 -0700227 memset(intRegs, 0, sizeof(intRegs));
Gabe Black0cb180e2009-07-08 23:02:20 -0700228 memset(floatRegs.i, 0, sizeof(floatRegs.i));
Ali Saidib8ec2142010-06-02 12:58:16 -0500229 isa.clear();
Gabe Black0cb180e2009-07-08 23:02:20 -0700230 }
Kevin Lim54d42202006-06-07 15:29:53 -0400231
Kevin Limf15e4922006-03-04 15:18:40 -0500232 //
233 // New accessors for new decoder.
234 //
235 uint64_t readIntReg(int reg_idx)
236 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700237 int flatIndex = isa.flattenIntIndex(reg_idx);
Gabe Black1b29f162009-07-08 23:02:21 -0700238 assert(flatIndex < TheISA::NumIntRegs);
Gabe Black2871a132009-07-29 00:15:26 -0700239 uint64_t regVal = intRegs[flatIndex];
Min Kyu Jeongad2c3b02010-08-23 11:18:41 -0500240 DPRINTF(IntRegs, "Reading int reg %d (%d) as %#x.\n",
241 reg_idx, flatIndex, regVal);
Gabe Black2871a132009-07-29 00:15:26 -0700242 return regVal;
Kevin Limf15e4922006-03-04 15:18:40 -0500243 }
244
Gabe Black8e4ec552006-03-14 15:55:00 -0500245 FloatReg readFloatReg(int reg_idx)
Kevin Limf15e4922006-03-04 15:18:40 -0500246 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700247 int flatIndex = isa.flattenFloatIndex(reg_idx);
Gabe Black1b29f162009-07-08 23:02:21 -0700248 assert(flatIndex < TheISA::NumFloatRegs);
Gabe Blackd149e432010-06-02 12:58:12 -0500249 FloatReg regVal = floatRegs.f[flatIndex];
Min Kyu Jeongad2c3b02010-08-23 11:18:41 -0500250 DPRINTF(FloatRegs, "Reading float reg %d (%d) as %f, %#x.\n",
251 reg_idx, flatIndex, regVal, floatRegs.i[flatIndex]);
Gabe Blackd149e432010-06-02 12:58:12 -0500252 return regVal;
Kevin Limf15e4922006-03-04 15:18:40 -0500253 }
254
Gabe Black8e4ec552006-03-14 15:55:00 -0500255 FloatRegBits readFloatRegBits(int reg_idx)
256 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700257 int flatIndex = isa.flattenFloatIndex(reg_idx);
Gabe Black1b29f162009-07-08 23:02:21 -0700258 assert(flatIndex < TheISA::NumFloatRegs);
Gabe Blackd149e432010-06-02 12:58:12 -0500259 FloatRegBits regVal = floatRegs.i[flatIndex];
Min Kyu Jeongad2c3b02010-08-23 11:18:41 -0500260 DPRINTF(FloatRegs, "Reading float reg %d (%d) bits as %#x, %f.\n",
261 reg_idx, flatIndex, regVal, floatRegs.f[flatIndex]);
Gabe Blackd149e432010-06-02 12:58:12 -0500262 return regVal;
Kevin Limf15e4922006-03-04 15:18:40 -0500263 }
264
265 void setIntReg(int reg_idx, uint64_t val)
266 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700267 int flatIndex = isa.flattenIntIndex(reg_idx);
Gabe Black1b29f162009-07-08 23:02:21 -0700268 assert(flatIndex < TheISA::NumIntRegs);
Min Kyu Jeongad2c3b02010-08-23 11:18:41 -0500269 DPRINTF(IntRegs, "Setting int reg %d (%d) to %#x.\n",
270 reg_idx, flatIndex, val);
Gabe Blacka480ba02009-07-08 23:02:20 -0700271 intRegs[flatIndex] = val;
Kevin Limf15e4922006-03-04 15:18:40 -0500272 }
273
Gabe Black8e4ec552006-03-14 15:55:00 -0500274 void setFloatReg(int reg_idx, FloatReg val)
Kevin Limf15e4922006-03-04 15:18:40 -0500275 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700276 int flatIndex = isa.flattenFloatIndex(reg_idx);
Gabe Black1b29f162009-07-08 23:02:21 -0700277 assert(flatIndex < TheISA::NumFloatRegs);
Gabe Black0cb180e2009-07-08 23:02:20 -0700278 floatRegs.f[flatIndex] = val;
Min Kyu Jeongad2c3b02010-08-23 11:18:41 -0500279 DPRINTF(FloatRegs, "Setting float reg %d (%d) to %f, %#x.\n",
280 reg_idx, flatIndex, val, floatRegs.i[flatIndex]);
Kevin Limf15e4922006-03-04 15:18:40 -0500281 }
282
Gabe Black8e4ec552006-03-14 15:55:00 -0500283 void setFloatRegBits(int reg_idx, FloatRegBits val)
284 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700285 int flatIndex = isa.flattenFloatIndex(reg_idx);
Gabe Black1b29f162009-07-08 23:02:21 -0700286 assert(flatIndex < TheISA::NumFloatRegs);
Geoffrey Blakeaf6aaf22012-01-31 07:46:03 -0800287 // XXX: Fix array out of bounds compiler error for gem5.fast
288 // when checkercpu enabled
289 if (flatIndex < TheISA::NumFloatRegs)
290 floatRegs.i[flatIndex] = val;
Min Kyu Jeongad2c3b02010-08-23 11:18:41 -0500291 DPRINTF(FloatRegs, "Setting float reg %d (%d) bits to %#x, %#f.\n",
292 reg_idx, flatIndex, val, floatRegs.f[flatIndex]);
Kevin Limf15e4922006-03-04 15:18:40 -0500293 }
294
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700295 TheISA::PCState
296 pcState()
Kevin Limf15e4922006-03-04 15:18:40 -0500297 {
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700298 return _pcState;
Kevin Limf15e4922006-03-04 15:18:40 -0500299 }
300
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700301 void
302 pcState(const TheISA::PCState &val)
Kevin Limf15e4922006-03-04 15:18:40 -0500303 {
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700304 _pcState = val;
Kevin Limf15e4922006-03-04 15:18:40 -0500305 }
306
Geoffrey Blakeaf6aaf22012-01-31 07:46:03 -0800307 void
308 pcStateNoRecord(const TheISA::PCState &val)
309 {
310 _pcState = val;
311 }
Geoffrey Blakeaf6aaf22012-01-31 07:46:03 -0800312
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700313 Addr
314 instAddr()
Gabe Black333a7c42006-10-15 21:04:14 -0400315 {
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700316 return _pcState.instAddr();
Gabe Black333a7c42006-10-15 21:04:14 -0400317 }
318
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700319 Addr
320 nextInstAddr()
Gabe Black333a7c42006-10-15 21:04:14 -0400321 {
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700322 return _pcState.nextInstAddr();
Gabe Black333a7c42006-10-15 21:04:14 -0400323 }
324
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700325 MicroPC
326 microPC()
Kevin Limf15e4922006-03-04 15:18:40 -0500327 {
Gabe Black6f4bd2c2010-10-31 00:07:20 -0700328 return _pcState.microPC();
Gabe Black91545ac2006-03-09 15:15:55 -0500329 }
330
Min Kyu Jeong5f91ec32010-08-23 11:18:40 -0500331 bool readPredicate()
332 {
333 return predicate;
334 }
335
336 void setPredicate(bool val)
337 {
338 predicate = val;
339 }
340
Nathan Binkert47877cf2009-05-26 09:23:13 -0700341 MiscReg
342 readMiscRegNoEffect(int misc_reg, ThreadID tid = 0)
Kevin Limf15e4922006-03-04 15:18:40 -0500343 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700344 return isa.readMiscRegNoEffect(misc_reg);
Kevin Limf15e4922006-03-04 15:18:40 -0500345 }
346
Nathan Binkert47877cf2009-05-26 09:23:13 -0700347 MiscReg
348 readMiscReg(int misc_reg, ThreadID tid = 0)
Kevin Limf15e4922006-03-04 15:18:40 -0500349 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700350 return isa.readMiscReg(misc_reg, tc);
Ali Saidi689cab32007-03-07 15:04:31 -0500351 }
352
Nathan Binkert47877cf2009-05-26 09:23:13 -0700353 void
354 setMiscRegNoEffect(int misc_reg, const MiscReg &val, ThreadID tid = 0)
Ali Saidi689cab32007-03-07 15:04:31 -0500355 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700356 return isa.setMiscRegNoEffect(misc_reg, val);
Kevin Limf15e4922006-03-04 15:18:40 -0500357 }
358
Nathan Binkert47877cf2009-05-26 09:23:13 -0700359 void
360 setMiscReg(int misc_reg, const MiscReg &val, ThreadID tid = 0)
Kevin Limf15e4922006-03-04 15:18:40 -0500361 {
Gabe Black32daf6f2009-07-08 23:02:20 -0700362 return isa.setMiscReg(misc_reg, val, tc);
363 }
364
365 int
366 flattenIntIndex(int reg)
367 {
368 return isa.flattenIntIndex(reg);
369 }
370
371 int
372 flattenFloatIndex(int reg)
373 {
374 return isa.flattenFloatIndex(reg);
Kevin Limf15e4922006-03-04 15:18:40 -0500375 }
376
377 unsigned readStCondFailures() { return storeCondFailures; }
378
379 void setStCondFailures(unsigned sc_failures)
380 { storeCondFailures = sc_failures; }
381
Gabe Black3d99b4a2006-04-18 09:27:22 -0400382 void syscall(int64_t callnum)
Kevin Limf15e4922006-03-04 15:18:40 -0500383 {
Kevin Limeb0e4162006-06-06 17:32:21 -0400384 process->syscall(callnum, tc);
Kevin Limf15e4922006-03-04 15:18:40 -0500385 }
Kevin Limf15e4922006-03-04 15:18:40 -0500386};
387
388
389// for non-speculative execution context, spec_mode is always false
390inline bool
Kevin Lim54d42202006-06-07 15:29:53 -0400391SimpleThread::misspeculating()
Kevin Limf15e4922006-03-04 15:18:40 -0500392{
393 return false;
394}
395
396#endif // __CPU_CPU_EXEC_CONTEXT_HH__