gem5  v20.1.0.0
static_inst.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2013,2016-2018 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  *
14  * Copyright (c) 2007-2008 The Florida State University
15  * 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.
39  */
40 
41 #ifndef __ARCH_ARM_INSTS_STATICINST_HH__
42 #define __ARCH_ARM_INSTS_STATICINST_HH__
43 
44 #include <memory>
45 
46 #include "arch/arm/faults.hh"
47 #include "arch/arm/utility.hh"
48 #include "arch/arm/isa.hh"
49 #include "arch/arm/self_debug.hh"
50 #include "arch/arm/system.hh"
51 #include "base/trace.hh"
52 #include "cpu/exec_context.hh"
53 #include "cpu/static_inst.hh"
54 #include "sim/byteswap.hh"
55 #include "sim/full_system.hh"
56 
57 namespace ArmISA
58 {
59 
60 class ArmStaticInst : public StaticInst
61 {
62  protected:
63  bool aarch64;
64  uint8_t intWidth;
65 
66  int32_t shift_rm_imm(uint32_t base, uint32_t shamt,
67  uint32_t type, uint32_t cfval) const;
68  int32_t shift_rm_rs(uint32_t base, uint32_t shamt,
69  uint32_t type, uint32_t cfval) const;
70 
71  bool shift_carry_imm(uint32_t base, uint32_t shamt,
72  uint32_t type, uint32_t cfval) const;
73  bool shift_carry_rs(uint32_t base, uint32_t shamt,
74  uint32_t type, uint32_t cfval) const;
75 
76  int64_t shiftReg64(uint64_t base, uint64_t shiftAmt,
77  ArmShiftType type, uint8_t width) const;
78  int64_t extendReg64(uint64_t base, ArmExtendType type,
79  uint64_t shiftAmt, uint8_t width) const;
80 
81  template<int width>
82  static inline bool
83  saturateOp(int32_t &res, int64_t op1, int64_t op2, bool sub=false)
84  {
85  int64_t midRes = sub ? (op1 - op2) : (op1 + op2);
86  if (bits(midRes, width) != bits(midRes, width - 1)) {
87  if (midRes > 0)
88  res = (LL(1) << (width - 1)) - 1;
89  else
90  res = -(LL(1) << (width - 1));
91  return true;
92  } else {
93  res = midRes;
94  return false;
95  }
96  }
97 
98  static inline bool
99  satInt(int32_t &res, int64_t op, int width)
100  {
101  width--;
102  if (op >= (LL(1) << width)) {
103  res = (LL(1) << width) - 1;
104  return true;
105  } else if (op < -(LL(1) << width)) {
106  res = -(LL(1) << width);
107  return true;
108  } else {
109  res = op;
110  return false;
111  }
112  }
113 
114  template<int width>
115  static inline bool
116  uSaturateOp(uint32_t &res, int64_t op1, int64_t op2, bool sub=false)
117  {
118  int64_t midRes = sub ? (op1 - op2) : (op1 + op2);
119  if (midRes >= (LL(1) << width)) {
120  res = (LL(1) << width) - 1;
121  return true;
122  } else if (midRes < 0) {
123  res = 0;
124  return true;
125  } else {
126  res = midRes;
127  return false;
128  }
129  }
130 
131  static inline bool
132  uSatInt(int32_t &res, int64_t op, int width)
133  {
134  if (op >= (LL(1) << width)) {
135  res = (LL(1) << width) - 1;
136  return true;
137  } else if (op < 0) {
138  res = 0;
139  return true;
140  } else {
141  res = op;
142  return false;
143  }
144  }
145 
146  // Constructor
147  ArmStaticInst(const char *mnem, ExtMachInst _machInst,
148  OpClass __opClass)
149  : StaticInst(mnem, _machInst, __opClass)
150  {
151  aarch64 = machInst.aarch64;
152  if (bits(machInst, 28, 24) == 0x10)
153  intWidth = 64; // Force 64-bit width for ADR/ADRP
154  else
155  intWidth = (aarch64 && bits(machInst, 31)) ? 64 : 32;
156  }
157 
160  void printIntReg(std::ostream &os, RegIndex reg_idx,
161  uint8_t opWidth = 0) const;
162  void printFloatReg(std::ostream &os, RegIndex reg_idx) const;
163  void printVecReg(std::ostream &os, RegIndex reg_idx,
164  bool isSveVecReg = false) const;
165  void printVecPredReg(std::ostream &os, RegIndex reg_idx) const;
166  void printCCReg(std::ostream &os, RegIndex reg_idx) const;
167  void printMiscReg(std::ostream &os, RegIndex reg_idx) const;
168  void printMnemonic(std::ostream &os,
169  const std::string &suffix = "",
170  bool withPred = true,
171  bool withCond64 = false,
172  ConditionCode cond64 = COND_UC) const;
173  void printTarget(std::ostream &os, Addr target,
174  const Loader::SymbolTable *symtab) const;
175  void printCondition(std::ostream &os, unsigned code,
176  bool noImplicit=false) const;
177  void printMemSymbol(std::ostream &os, const Loader::SymbolTable *symtab,
178  const std::string &prefix, const Addr addr,
179  const std::string &suffix) const;
180  void printShiftOperand(std::ostream &os, IntRegIndex rm,
181  bool immShift, uint32_t shiftAmt,
183  void printExtendOperand(bool firstOperand, std::ostream &os,
185  int64_t shiftAmt) const;
186  void printPFflags(std::ostream &os, int flag) const;
187 
188  void printDataInst(std::ostream &os, bool withImm) const;
189  void printDataInst(std::ostream &os, bool withImm, bool immShift, bool s,
191  IntRegIndex rs, uint32_t shiftAmt, ArmShiftType type,
192  uint64_t imm) const;
193 
194  void
195  advancePC(PCState &pcState) const override
196  {
197  pcState.advance();
198  }
199 
200  std::string generateDisassembly(
201  Addr pc, const Loader::SymbolTable *symtab) const override;
202 
203  static void
205  {
207  sd->activateDebug();
208  }
209 
210  static inline uint32_t
211  cpsrWriteByInstr(CPSR cpsr, uint32_t val, SCR scr, NSACR nsacr,
212  uint8_t byteMask, bool affectState, bool nmfi, ThreadContext *tc)
213  {
214  bool privileged = (cpsr.mode != MODE_USER);
215  bool haveVirt = ArmSystem::haveVirtualization(tc);
216  bool isSecure = ArmISA::isSecure(tc);
217 
218  uint32_t bitMask = 0;
219 
220  if (affectState && byteMask==0xF){
221  activateBreakpoint(tc);
222  }
223  if (bits(byteMask, 3)) {
224  unsigned lowIdx = affectState ? 24 : 27;
225  bitMask = bitMask | mask(31, lowIdx);
226  }
227  if (bits(byteMask, 2)) {
228  bitMask = bitMask | mask(19, 16);
229  }
230  if (bits(byteMask, 1)) {
231  unsigned highIdx = affectState ? 15 : 9;
232  unsigned lowIdx = (privileged && (isSecure || scr.aw || haveVirt))
233  ? 8 : 9;
234  bitMask = bitMask | mask(highIdx, lowIdx);
235  }
236  if (bits(byteMask, 0)) {
237  if (privileged) {
238  bitMask |= 1 << 7;
239  if ( (!nmfi || !((val >> 6) & 0x1)) &&
240  (isSecure || scr.fw || haveVirt) ) {
241  bitMask |= 1 << 6;
242  }
243  // Now check the new mode is allowed
244  OperatingMode newMode = (OperatingMode) (val & mask(5));
245  OperatingMode oldMode = (OperatingMode)(uint32_t)cpsr.mode;
246  if (!badMode(tc, newMode)) {
247  bool validModeChange = true;
248  // Check for attempts to enter modes only permitted in
249  // Secure state from Non-secure state. These are Monitor
250  // mode ('10110'), and FIQ mode ('10001') if the Security
251  // Extensions have reserved it.
252  if (!isSecure && newMode == MODE_MON)
253  validModeChange = false;
254  if (!isSecure && newMode == MODE_FIQ && nsacr.rfr == '1')
255  validModeChange = false;
256  // There is no Hyp mode ('11010') in Secure state, so that
257  // is UNPREDICTABLE
258  if (scr.ns == 0 && newMode == MODE_HYP)
259  validModeChange = false;
260  // Cannot move into Hyp mode directly from a Non-secure
261  // PL1 mode
262  if (!isSecure && oldMode != MODE_HYP && newMode == MODE_HYP)
263  validModeChange = false;
264  // Cannot move out of Hyp mode with this function except
265  // on an exception return
266  if (oldMode == MODE_HYP && newMode != MODE_HYP && !affectState)
267  validModeChange = false;
268  // Must not change to 64 bit when running in 32 bit mode
269  if (!opModeIs64(oldMode) && opModeIs64(newMode))
270  validModeChange = false;
271 
272  // If we passed all of the above then set the bit mask to
273  // copy the mode accross
274  if (validModeChange) {
275  bitMask = bitMask | mask(5);
276  } else {
277  warn_once("Illegal change to CPSR mode attempted\n");
278  }
279  } else {
280  warn_once("Ignoring write of bad mode to CPSR.\n");
281  }
282  }
283  if (affectState)
284  bitMask = bitMask | (1 << 5);
285  }
286 
287  return ((uint32_t)cpsr & ~bitMask) | (val & bitMask);
288  }
289 
290  static inline uint32_t
291  spsrWriteByInstr(uint32_t spsr, uint32_t val,
292  uint8_t byteMask, bool affectState)
293  {
294  uint32_t bitMask = 0;
295 
296  if (bits(byteMask, 3))
297  bitMask = bitMask | mask(31, 24);
298  if (bits(byteMask, 2))
299  bitMask = bitMask | mask(19, 16);
300  if (bits(byteMask, 1))
301  bitMask = bitMask | mask(15, 8);
302  if (bits(byteMask, 0))
303  bitMask = bitMask | mask(7, 0);
304 
305  return ((spsr & ~bitMask) | (val & bitMask));
306  }
307 
308  static inline Addr
310  {
311  return xc->pcState().instPC();
312  }
313 
314  static inline void
316  {
317  PCState pc = xc->pcState();
318  pc.instNPC(val);
319  xc->pcState(pc);
320  }
321 
322  template<class T>
323  static inline T
324  cSwap(T val, bool big)
325  {
326  if (big) {
327  return letobe(val);
328  } else {
329  return val;
330  }
331  }
332 
333  template<class T, class E>
334  static inline T
335  cSwap(T val, bool big)
336  {
337  const unsigned count = sizeof(T) / sizeof(E);
338  union {
339  T tVal;
340  E eVals[count];
341  } conv;
342  conv.tVal = htole(val);
343  if (big) {
344  for (unsigned i = 0; i < count; i++) {
345  conv.eVals[i] = letobe(conv.eVals[i]);
346  }
347  } else {
348  for (unsigned i = 0; i < count; i++) {
349  conv.eVals[i] = conv.eVals[i];
350  }
351  }
352  return letoh(conv.tVal);
353  }
354 
355  // Perform an interworking branch.
356  static inline void
358  {
359  PCState pc = xc->pcState();
360  pc.instIWNPC(val);
361  xc->pcState(pc);
362  }
363 
364  // Perform an interworking branch in ARM mode, a regular branch
365  // otherwise.
366  static inline void
368  {
369  PCState pc = xc->pcState();
370  pc.instAIWNPC(val);
371  xc->pcState(pc);
372  }
373 
374  inline Fault
376  {
377  return std::make_shared<UndefinedInstruction>(machInst, false,
378  mnemonic, true);
379  }
380 
381  // Utility function used by checkForWFxTrap32 and checkForWFxTrap64
382  // Returns true if processor has to trap a WFI/WFE instruction.
383  bool isWFxTrapping(ThreadContext *tc,
384  ExceptionLevel targetEL, bool isWfe) const;
385 
392  Fault softwareBreakpoint32(ExecContext *xc, uint16_t imm) const;
393 
404 
405 
412  Fault checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const;
413 
422  CPSR cpsr, CPACR cpacr) const;
423 
431  CPSR cpsr, CPACR cpacr,
432  NSACR nsacr, FPEXC fpexc,
433  bool fpexc_check, bool advsimd) const;
434 
442  ExceptionLevel tgtEl, bool isWfe) const;
443 
451  ExceptionLevel tgtEl, bool isWfe) const;
452 
456  Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const;
457 
464  Fault checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const;
465 
473 
481 
488 
492  Fault checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const;
493 
501  CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const;
502 
512  ExceptionLevel pstateEL) const;
513 
514  public:
515  virtual void
517 
518  uint8_t
519  getIntWidth() const
520  {
521  return intWidth;
522  }
523 
525  ssize_t
526  instSize() const
527  {
528  return (!machInst.thumb || machInst.bigThumb) ? 4 : 2;
529  }
530 
537  MachInst
538  encoding() const
539  {
540  return static_cast<MachInst>(machInst & (mask(instSize() * 8)));
541  }
542 
543  size_t
544  asBytes(void *buf, size_t max_size) override
545  {
546  return simpleAsBytes(buf, max_size, machInst);
547  }
548 
549  static unsigned getCurSveVecLenInBits(ThreadContext *tc);
550 
551  static unsigned
553  {
554  return getCurSveVecLenInBits(tc) >> 6;
555  }
556 
557  template<typename T>
558  static unsigned
560  {
561  return getCurSveVecLenInBits(tc) / (8 * sizeof(T));
562  }
563 };
564 }
565 
566 #endif //__ARCH_ARM_INSTS_STATICINST_HH__
ArmISA::SelfDebug
Definition: self_debug.hh:273
ArmISA::ArmStaticInst::readPC
static Addr readPC(ExecContext *xc)
Definition: static_inst.hh:309
ArmISA::ArmStaticInst::saturateOp
static bool saturateOp(int32_t &res, int64_t op1, int64_t op2, bool sub=false)
Definition: static_inst.hh:83
ArmISA::MODE_HYP
@ MODE_HYP
Definition: types.hh:642
ArmISA::advsimd
Bitfield< 23, 20 > advsimd
Definition: miscregs_types.hh:172
LL
#define LL(N)
int64_t constant
Definition: types.hh:52
X86ISA::os
Bitfield< 17 > os
Definition: misc.hh:803
letobe
T letobe(T value)
Definition: byteswap.hh:134
ArmISA::ArmShiftType
ArmShiftType
Definition: types.hh:567
ArmISA::ConditionCode
ConditionCode
Definition: ccregs.hh:63
ArmISA::ArmStaticInst::getCurSveVecLen
static unsigned getCurSveVecLen(ThreadContext *tc)
Definition: static_inst.hh:559
ArmISA::ArmStaticInst::printCCReg
void printCCReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:361
warn_once
#define warn_once(...)
Definition: logging.hh:243
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
ArmISA::ArmStaticInst::isWFxTrapping
bool isWFxTrapping(ThreadContext *tc, ExceptionLevel targetEL, bool isWfe) const
Definition: static_inst.cc:800
StaticInst
Base, ISA-independent static instruction class.
Definition: static_inst.hh:85
ArmISA::MachInst
uint32_t MachInst
Definition: types.hh:52
ArmISA::COND_UC
@ COND_UC
Definition: ccregs.hh:79
ArmISA::width
Bitfield< 4 > width
Definition: miscregs_types.hh:68
ArmISA::ArmStaticInst::checkForWFxTrap64
Fault checkForWFxTrap64(ThreadContext *tc, ExceptionLevel tgtEl, bool isWfe) const
Check if WFE/WFI instruction execution in aarch64 should be trapped.
Definition: static_inst.cc:867
htole
T htole(T value)
Definition: byteswap.hh:140
ArmISA::OperatingMode
OperatingMode
Definition: types.hh:628
ArmISA::ArmStaticInst::sveAccessTrap
Fault sveAccessTrap(ExceptionLevel el) const
Trap an access to SVE registers due to access control bits.
Definition: static_inst.cc:996
ArmISA::ArmStaticInst::advancePC
void advancePC(PCState &pcState) const override
Definition: static_inst.hh:195
ArmISA::ArmStaticInst::checkFPAdvSIMDEnabled64
Fault checkFPAdvSIMDEnabled64(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an Advaned SIMD access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
Definition: static_inst.cc:711
type
uint8_t type
Definition: inet.hh:421
Loader::SymbolTable
Definition: symtab.hh:59
ArmISA::IntRegIndex
IntRegIndex
Definition: intregs.hh:51
X86ISA::E
Bitfield< 31, 0 > E
Definition: int.hh:51
X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
X86ISA::op
Bitfield< 4 > op
Definition: types.hh:78
ArmISA::ArmStaticInst::advSIMDFPAccessTrap64
Fault advSIMDFPAccessTrap64(ExceptionLevel el) const
Trap an access to Advanced SIMD or FP registers due to access control bits.
Definition: static_inst.cc:652
ArmISA::ArmStaticInst::printIntReg
void printIntReg(std::ostream &os, RegIndex reg_idx, uint8_t opWidth=0) const
Print a register name for disassembly given the unique dependence tag number (FP or int).
Definition: static_inst.cc:296
ArmISA::ArmStaticInst::shiftReg64
int64_t shiftReg64(uint64_t base, uint64_t shiftAmt, ArmShiftType type, uint8_t width) const
Definition: static_inst.cc:92
ArmISA::ArmStaticInst::shift_rm_imm
int32_t shift_rm_imm(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:57
system.hh
RefCounted::count
int count
Definition: refcnt.hh:64
ArmISA::ArmStaticInst::printShiftOperand
void printShiftOperand(std::ostream &os, IntRegIndex rm, bool immShift, uint32_t shiftAmt, IntRegIndex rs, ArmShiftType type) const
Definition: static_inst.cc:495
ArmISA::ArmStaticInst::printMemSymbol
void printMemSymbol(std::ostream &os, const Loader::SymbolTable *symtab, const std::string &prefix, const Addr addr, const std::string &suffix) const
Definition: static_inst.cc:477
ArmISA
Definition: ccregs.hh:41
ArmSystem::haveVirtualization
bool haveVirtualization() const
Returns true if this system implements the virtualization Extensions.
Definition: system.hh:170
ArmISA::ArmStaticInst
Definition: static_inst.hh:60
ExecContext::pcState
virtual PCState pcState() const =0
ArmISA::ArmStaticInst::shift_carry_imm
bool shift_carry_imm(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:217
ArmISA::ArmStaticInst::softwareBreakpoint32
Fault softwareBreakpoint32(ExecContext *xc, uint16_t imm) const
Trigger a Software Breakpoint.
Definition: static_inst.cc:632
ArmISA::ArmStaticInst::checkForWFxTrap32
Fault checkForWFxTrap32(ThreadContext *tc, ExceptionLevel tgtEl, bool isWfe) const
Check if WFE/WFI instruction execution in aarch32 should be trapped.
Definition: static_inst.cc:827
ArmISA::ArmStaticInst::printExtendOperand
void printExtendOperand(bool firstOperand, std::ostream &os, IntRegIndex rm, ArmExtendType type, int64_t shiftAmt) const
Definition: static_inst.cc:559
ArmISA::ArmStaticInst::checkSETENDEnabled
Fault checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const
Check if SETEND instruction execution in aarch32 should be trapped.
Definition: static_inst.cc:925
letoh
T letoh(T value)
Definition: byteswap.hh:141
ArmISA::rn
Bitfield< 19, 16 > rn
Definition: types.hh:122
ArmISA::ArmStaticInst::extendReg64
int64_t extendReg64(uint64_t base, ArmExtendType type, uint64_t shiftAmt, uint8_t width) const
Definition: static_inst.cc:131
ArmISA::ArmStaticInst::uSaturateOp
static bool uSaturateOp(uint32_t &res, int64_t op1, int64_t op2, bool sub=false)
Definition: static_inst.hh:116
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
ArmISA::ArmStaticInst::cSwap
static T cSwap(T val, bool big)
Definition: static_inst.hh:335
ArmISA::ArmFault
Definition: faults.hh:60
ArmISA::ArmStaticInst::getCurSveVecLenInBits
static unsigned getCurSveVecLenInBits(ThreadContext *tc)
Definition: static_inst.cc:1216
ArmISA::ExceptionLevel
ExceptionLevel
Definition: types.hh:621
ArmISA::imm
Bitfield< 7, 0 > imm
Definition: types.hh:141
Fault
std::shared_ptr< FaultBase > Fault
Definition: types.hh:240
ArmISA::ArmStaticInst::annotateFault
virtual void annotateFault(ArmFault *fault)
Definition: static_inst.hh:516
MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:240
isa.hh
ArmISA::ArmStaticInst::setAIWNextPC
static void setAIWNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:367
ArmISA::ArmStaticInst::undefinedFault32
Fault undefinedFault32(ThreadContext *tc, ExceptionLevel el) const
UNDEFINED behaviour in AArch32.
Definition: static_inst.cc:957
ArmISA::ArmStaticInst::spsrWriteByInstr
static uint32_t spsrWriteByInstr(uint32_t spsr, uint32_t val, uint8_t byteMask, bool affectState)
Definition: static_inst.hh:291
ArmISA::el
Bitfield< 3, 2 > el
Definition: miscregs_types.hh:69
ArmISA::ArmStaticInst::printMiscReg
void printMiscReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:367
ExecContext
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
Definition: exec_context.hh:70
ArmISA::sd
Bitfield< 4 > sd
Definition: miscregs_types.hh:768
ArmISA::ArmStaticInst::satInt
static bool satInt(int32_t &res, int64_t op, int width)
Definition: static_inst.hh:99
ArmISA::ArmStaticInst::getIntWidth
uint8_t getIntWidth() const
Definition: static_inst.hh:519
ArmISA::ArmStaticInst::intWidth
uint8_t intWidth
Definition: static_inst.hh:64
ArmISA::ArmStaticInst::shift_carry_rs
bool shift_carry_rs(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:257
ArmISA::rd
Bitfield< 15, 12 > rd
Definition: types.hh:123
StaticInst::mnemonic
const char * mnemonic
Base mnemonic (e.g., "add").
Definition: static_inst.hh:258
static_inst.hh
StaticInst::ExtMachInst
TheISA::ExtMachInst ExtMachInst
Binary extended machine instruction type.
Definition: static_inst.hh:89
ArmISA::MODE_FIQ
@ MODE_FIQ
Definition: types.hh:637
faults.hh
ArmISA::ArmStaticInst::checkFPAdvSIMDTrap64
Fault checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const
Check an Advaned SIMD access against CPTR_EL2 and CPTR_EL3.
Definition: static_inst.cc:672
ArmISA::ArmStaticInst::setIWNextPC
static void setIWNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:357
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
ArmISA::ArmStaticInst::aarch64
bool aarch64
Definition: static_inst.hh:63
ArmISA::ArmStaticInst::printCondition
void printCondition(std::ostream &os, unsigned code, bool noImplicit=false) const
Definition: static_inst.cc:414
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
ArmISA::rm
Bitfield< 3, 0 > rm
Definition: types.hh:127
ArmISA::ArmStaticInst::getCurSveVecLenInQWords
static unsigned getCurSveVecLenInQWords(ThreadContext *tc)
Definition: static_inst.hh:552
ArmISA::ArmStaticInst::printVecPredReg
void printVecPredReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:355
ArmISA::ArmStaticInst::printVecReg
void printVecReg(std::ostream &os, RegIndex reg_idx, bool isSveVecReg=false) const
Definition: static_inst.cc:348
utility.hh
full_system.hh
ArmISA::ISA::getSelfDebug
SelfDebug * getSelfDebug() const
Definition: isa.hh:476
ArmISA::ArmStaticInst::checkAdvSIMDOrFPEnabled32
Fault checkAdvSIMDOrFPEnabled32(ThreadContext *tc, CPSR cpsr, CPACR cpacr, NSACR nsacr, FPEXC fpexc, bool fpexc_check, bool advsimd) const
Check if a VFP/SIMD access from aarch32 should be allowed.
Definition: static_inst.cc:723
ArmISA::ArmExtendType
ArmExtendType
Definition: types.hh:575
ArmISA::ArmStaticInst::printFloatReg
void printFloatReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:342
StaticInst::simpleAsBytes
size_t simpleAsBytes(void *buf, size_t max_size, const T &t)
Definition: static_inst.hh:355
ArmISA::ArmStaticInst::generalExceptionsToAArch64
bool generalExceptionsToAArch64(ThreadContext *tc, ExceptionLevel pstateEL) const
Return true if exceptions normally routed to EL1 are being handled at an Exception level using AArch6...
Definition: static_inst.cc:1203
ArmISA::ArmStaticInst::printDataInst
void printDataInst(std::ostream &os, bool withImm) const
ArmISA::ArmStaticInst::encoding
MachInst encoding() const
Returns the real encoding of the instruction: the machInst field is in fact always 64 bit wide and co...
Definition: static_inst.hh:538
ArmISA::ArmStaticInst::uSatInt
static bool uSatInt(int32_t &res, int64_t op, int width)
Definition: static_inst.hh:132
ArmISA::nmfi
Bitfield< 27 > nmfi
Definition: miscregs_types.hh:337
StaticInst::machInst
const ExtMachInst machInst
The binary machine instruction.
Definition: static_inst.hh:243
MipsISA::PCState
GenericISA::DelaySlotPCState< MachInst > PCState
Definition: types.hh:41
RegIndex
uint16_t RegIndex
Definition: types.hh:52
ArmISA::ArmStaticInst::trapWFx
Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const
WFE/WFI trapping helper function.
Definition: static_inst.cc:899
ArmISA::ArmStaticInst::printMnemonic
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
Definition: static_inst.cc:374
exec_context.hh
addr
ip6_addr_t addr
Definition: inet.hh:423
ArmISA::ArmStaticInst::instSize
ssize_t instSize() const
Returns the byte size of current instruction.
Definition: static_inst.hh:526
ArmISA::rs
Bitfield< 9, 8 > rs
Definition: miscregs_types.hh:372
ArmISA::ArmStaticInst::generateDisassembly
std::string generateDisassembly(Addr pc, const Loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: static_inst.cc:623
ArmISA::MODE_MON
@ MODE_MON
Definition: types.hh:640
ArmISA::ArmStaticInst::getPSTATEFromPSR
CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const
Get the new PSTATE from a SPSR register in preparation for an exception return.
Definition: static_inst.cc:1145
ArmISA::ArmStaticInst::setNextPC
static void setNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:315
trace.hh
ArmISA::ArmStaticInst::ArmStaticInst
ArmStaticInst(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Definition: static_inst.hh:147
self_debug.hh
ArmISA::MODE_USER
@ MODE_USER
Definition: types.hh:636
ArmISA::s
Bitfield< 4 > s
Definition: miscregs_types.hh:556
ArmISA::ArmStaticInst::checkSveEnabled
Fault checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an SVE access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
Definition: static_inst.cc:1013
ArmISA::ArmStaticInst::printTarget
void printTarget(std::ostream &os, Addr target, const Loader::SymbolTable *symtab) const
Definition: static_inst.cc:395
ArmISA::ArmStaticInst::shift_rm_rs
int32_t shift_rm_rs(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:177
ArmISA::ArmStaticInst::printPFflags
void printPFflags(std::ostream &os, int flag) const
Definition: static_inst.cc:331
ArmISA::ArmStaticInst::asBytes
size_t asBytes(void *buf, size_t max_size) override
Instruction classes can override this function to return a a representation of themselves as a blob o...
Definition: static_inst.hh:544
ArmISA::ArmStaticInst::cSwap
static T cSwap(T val, bool big)
Definition: static_inst.hh:324
ArmISA::badMode
bool badMode(ThreadContext *tc, OperatingMode mode)
badMode is checking if the execution mode provided as an argument is valid and implemented.
Definition: utility.cc:507
ArmISA::ArmStaticInst::activateBreakpoint
static void activateBreakpoint(ThreadContext *tc)
Definition: static_inst.hh:204
ArmISA::ArmStaticInst::undefinedFault64
Fault undefinedFault64(ThreadContext *tc, ExceptionLevel el) const
UNDEFINED behaviour in AArch64.
Definition: static_inst.cc:976
ArmISA::mask
Bitfield< 28, 24 > mask
Definition: miscregs_types.hh:711
ArmISA::isSecure
bool isSecure(ThreadContext *tc)
Definition: utility.cc:174
byteswap.hh
ArmISA::ArmStaticInst::disabledFault
Fault disabledFault() const
Definition: static_inst.hh:375
bits
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:75
ArmISA::ArmStaticInst::cpsrWriteByInstr
static uint32_t cpsrWriteByInstr(CPSR cpsr, uint32_t val, SCR scr, NSACR nsacr, uint8_t byteMask, bool affectState, bool nmfi, ThreadContext *tc)
Definition: static_inst.hh:211

Generated on Wed Sep 30 2020 14:02:00 for gem5 by doxygen 1.8.17