gem5  v22.1.0.0
static_inst.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2013,2016-2018, 2022 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/pcstate.hh"
50 #include "arch/arm/self_debug.hh"
51 #include "arch/arm/system.hh"
52 #include "base/trace.hh"
53 #include "cpu/exec_context.hh"
54 #include "cpu/static_inst.hh"
55 #include "cpu/thread_context.hh"
56 #include "sim/byteswap.hh"
57 #include "sim/full_system.hh"
58 
59 namespace gem5
60 {
61 
62 namespace ArmISA
63 {
64 
65 class ArmStaticInst : public StaticInst
66 {
67  protected:
68  bool aarch64;
69  uint8_t intWidth;
70 
71  int32_t shift_rm_imm(uint32_t base, uint32_t shamt,
72  uint32_t type, uint32_t cfval) const;
73  int32_t shift_rm_rs(uint32_t base, uint32_t shamt,
74  uint32_t type, uint32_t cfval) const;
75 
76  bool shift_carry_imm(uint32_t base, uint32_t shamt,
77  uint32_t type, uint32_t cfval) const;
78  bool shift_carry_rs(uint32_t base, uint32_t shamt,
79  uint32_t type, uint32_t cfval) const;
80 
81  int64_t shiftReg64(uint64_t base, uint64_t shiftAmt,
82  ArmShiftType type, uint8_t width) const;
83  int64_t extendReg64(uint64_t base, ArmExtendType type,
84  uint64_t shiftAmt, uint8_t width) const;
85 
86  template<int width>
87  static inline bool
88  saturateOp(int32_t &res, int64_t op1, int64_t op2, bool sub=false)
89  {
90  int64_t midRes = sub ? (op1 - op2) : (op1 + op2);
91  if (bits(midRes, width) != bits(midRes, width - 1)) {
92  if (midRes > 0)
93  res = (1LL << (width - 1)) - 1;
94  else
95  res = -(1LL << (width - 1));
96  return true;
97  } else {
98  res = midRes;
99  return false;
100  }
101  }
102 
103  static inline bool
104  satInt(int32_t &res, int64_t op, int width)
105  {
106  width--;
107  if (op >= (1LL << width)) {
108  res = (1LL << width) - 1;
109  return true;
110  } else if (op < -(1LL << width)) {
111  res = -(1LL << width);
112  return true;
113  } else {
114  res = op;
115  return false;
116  }
117  }
118 
119  template<int width>
120  static inline bool
121  uSaturateOp(uint32_t &res, int64_t op1, int64_t op2, bool sub=false)
122  {
123  int64_t midRes = sub ? (op1 - op2) : (op1 + op2);
124  if (midRes >= (1LL << width)) {
125  res = (1LL << width) - 1;
126  return true;
127  } else if (midRes < 0) {
128  res = 0;
129  return true;
130  } else {
131  res = midRes;
132  return false;
133  }
134  }
135 
136  static inline bool
137  uSatInt(int32_t &res, int64_t op, int width)
138  {
139  if (op >= (1LL << width)) {
140  res = (1LL << width) - 1;
141  return true;
142  } else if (op < 0) {
143  res = 0;
144  return true;
145  } else {
146  res = op;
147  return false;
148  }
149  }
150 
152 
153  // Constructor
154  ArmStaticInst(const char *mnem, ExtMachInst _machInst,
155  OpClass __opClass)
156  : StaticInst(mnem, __opClass), machInst(_machInst)
157  {
158  aarch64 = machInst.aarch64;
159  if (bits(machInst, 28, 24) == 0x10)
160  intWidth = 64; // Force 64-bit width for ADR/ADRP
161  else
162  intWidth = (aarch64 && bits(machInst, 31)) ? 64 : 32;
163  }
164 
167  void printIntReg(std::ostream &os, RegIndex reg_idx,
168  uint8_t opWidth = 0) const;
169  void printFloatReg(std::ostream &os, RegIndex reg_idx) const;
170  void printVecReg(std::ostream &os, RegIndex reg_idx,
171  bool isSveVecReg = false) const;
172  void printVecPredReg(std::ostream &os, RegIndex reg_idx) const;
173  void printCCReg(std::ostream &os, RegIndex reg_idx) const;
174  void printMiscReg(std::ostream &os, RegIndex reg_idx) const;
175  void printMnemonic(std::ostream &os,
176  const std::string &suffix = "",
177  bool withPred = true,
178  bool withCond64 = false,
179  ConditionCode cond64 = COND_UC) const;
180  void printTarget(std::ostream &os, Addr target,
181  const loader::SymbolTable *symtab) const;
182  void printCondition(std::ostream &os, unsigned code,
183  bool noImplicit=false) const;
184  void printMemSymbol(std::ostream &os, const loader::SymbolTable *symtab,
185  const std::string &prefix, const Addr addr,
186  const std::string &suffix) const;
187  void printShiftOperand(std::ostream &os, RegIndex rm,
188  bool immShift, uint32_t shiftAmt,
189  RegIndex rs, ArmShiftType type) const;
190  void printExtendOperand(bool firstOperand, std::ostream &os,
192  int64_t shiftAmt) const;
193  void printPFflags(std::ostream &os, int flag) const;
194 
195  void printDataInst(std::ostream &os, bool withImm) const;
196  void printDataInst(std::ostream &os, bool withImm, bool immShift, bool s,
198  RegIndex rs, uint32_t shiftAmt, ArmShiftType type,
199  uint64_t imm) const;
200 
201  void
202  advancePC(PCStateBase &pcState) const override
203  {
204  pcState.as<PCState>().advance();
205  }
206 
207  void
208  advancePC(ThreadContext *tc) const override
209  {
210  PCState pc = tc->pcState().as<PCState>();
211  pc.advance();
212  tc->pcState(pc);
213  }
214 
215  uint64_t getEMI() const override { return machInst; }
216 
217  std::unique_ptr<PCStateBase>
218  buildRetPC(const PCStateBase &cur_pc,
219  const PCStateBase &call_pc) const override
220  {
221  PCStateBase *ret_pc = call_pc.clone();
222  ret_pc->as<PCState>().uEnd();
223  return std::unique_ptr<PCStateBase>{ret_pc};
224  }
225 
226  std::string generateDisassembly(
227  Addr pc, const loader::SymbolTable *symtab) const override;
228 
229  static void
231  {
233  sd->activateDebug();
234  }
235 
236  static inline uint32_t
237  cpsrWriteByInstr(CPSR cpsr, uint32_t val, SCR scr, NSACR nsacr,
238  uint8_t byteMask, bool affectState, bool nmfi, ThreadContext *tc)
239  {
240  bool privileged = (cpsr.mode != MODE_USER);
241  bool haveVirt = ArmSystem::haveEL(tc, EL2);
242  bool isSecure = ArmISA::isSecure(tc);
243 
244  uint32_t bitMask = 0;
245 
246  if (affectState && byteMask==0xF){
247  activateBreakpoint(tc);
248  }
249  if (bits(byteMask, 3)) {
250  unsigned lowIdx = affectState ? 24 : 27;
251  bitMask = bitMask | mask(31, lowIdx);
252  }
253  if (bits(byteMask, 2)) {
254  bitMask = bitMask | mask(19, 16);
255  }
256  if (bits(byteMask, 1)) {
257  unsigned highIdx = affectState ? 15 : 9;
258  unsigned lowIdx = (privileged && (isSecure || scr.aw || haveVirt))
259  ? 8 : 9;
260  bitMask = bitMask | mask(highIdx, lowIdx);
261  }
262  if (bits(byteMask, 0)) {
263  if (privileged) {
264  bitMask |= 1 << 7;
265  if ( (!nmfi || !((val >> 6) & 0x1)) &&
266  (isSecure || scr.fw || haveVirt) ) {
267  bitMask |= 1 << 6;
268  }
269  // Now check the new mode is allowed
270  OperatingMode newMode = (OperatingMode) (val & mask(5));
271  OperatingMode oldMode = (OperatingMode)(uint32_t)cpsr.mode;
272  if (!badMode(tc, newMode)) {
273  bool validModeChange = true;
274  // Check for attempts to enter modes only permitted in
275  // Secure state from Non-secure state. These are Monitor
276  // mode ('10110'), and FIQ mode ('10001') if the Security
277  // Extensions have reserved it.
278  if (!isSecure && newMode == MODE_MON)
279  validModeChange = false;
280  if (!isSecure && newMode == MODE_FIQ && nsacr.rfr == '1')
281  validModeChange = false;
282  // There is no Hyp mode ('11010') in Secure state, so that
283  // is UNPREDICTABLE
284  if (scr.ns == 0 && newMode == MODE_HYP)
285  validModeChange = false;
286  // Cannot move into Hyp mode directly from a Non-secure
287  // PL1 mode
288  if (!isSecure && oldMode != MODE_HYP && newMode == MODE_HYP)
289  validModeChange = false;
290  // Cannot move out of Hyp mode with this function except
291  // on an exception return
292  if (oldMode == MODE_HYP && newMode != MODE_HYP && !affectState)
293  validModeChange = false;
294  // Must not change to 64 bit when running in 32 bit mode
295  if (!opModeIs64(oldMode) && opModeIs64(newMode))
296  validModeChange = false;
297 
298  // If we passed all of the above then set the bit mask to
299  // copy the mode accross
300  if (validModeChange) {
301  bitMask = bitMask | mask(5);
302  } else {
303  warn_once("Illegal change to CPSR mode attempted\n");
304  }
305  } else {
306  warn_once("Ignoring write of bad mode to CPSR.\n");
307  }
308  }
309  if (affectState)
310  bitMask = bitMask | (1 << 5);
311  }
312 
313  return ((uint32_t)cpsr & ~bitMask) | (val & bitMask);
314  }
315 
316  static inline uint32_t
317  spsrWriteByInstr(uint32_t spsr, uint32_t val,
318  uint8_t byteMask, bool affectState)
319  {
320  uint32_t bitMask = 0;
321 
322  if (bits(byteMask, 3))
323  bitMask = bitMask | mask(31, 24);
324  if (bits(byteMask, 2))
325  bitMask = bitMask | mask(19, 16);
326  if (bits(byteMask, 1))
327  bitMask = bitMask | mask(15, 8);
328  if (bits(byteMask, 0))
329  bitMask = bitMask | mask(7, 0);
330 
331  return ((spsr & ~bitMask) | (val & bitMask));
332  }
333 
334  static inline Addr
336  {
337  return xc->pcState().as<PCState>().instPC();
338  }
339 
340  static inline void
342  {
343  PCState pc = xc->pcState().as<PCState>();
344  pc.instNPC(val);
345  xc->pcState(pc);
346  }
347 
348  template<class T>
349  static inline T
350  cSwap(T val, bool big)
351  {
352  if (big) {
353  return letobe(val);
354  } else {
355  return val;
356  }
357  }
358 
359  template<class T, class E>
360  static inline T
361  cSwap(T val, bool big)
362  {
363  const unsigned count = sizeof(T) / sizeof(E);
364  union
365  {
366  T tVal;
367  E eVals[count];
368  } conv;
369  conv.tVal = htole(val);
370  if (big) {
371  for (unsigned i = 0; i < count; i++) {
372  conv.eVals[i] = letobe(conv.eVals[i]);
373  }
374  } else {
375  for (unsigned i = 0; i < count; i++) {
376  conv.eVals[i] = conv.eVals[i];
377  }
378  }
379  return letoh(conv.tVal);
380  }
381 
382  // Perform an interworking branch.
383  static inline void
385  {
386  PCState pc = xc->pcState().as<PCState>();
387  pc.instIWNPC(val);
388  xc->pcState(pc);
389  }
390 
391  // Perform an interworking branch in ARM mode, a regular branch
392  // otherwise.
393  static inline void
395  {
396  PCState pc = xc->pcState().as<PCState>();
397  pc.instAIWNPC(val);
398  xc->pcState(pc);
399  }
400 
401  inline Fault disabledFault() const { return undefined(true); }
402 
403  // Utility function used by checkForWFxTrap32 and checkForWFxTrap64
404  // Returns true if processor has to trap a WFI/WFE instruction.
405  bool isWFxTrapping(ThreadContext *tc,
406  ExceptionLevel targetEL, bool isWfe) const;
407 
414  Fault softwareBreakpoint32(ExecContext *xc, uint16_t imm) const;
415 
426 
427 
434  Fault checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const;
435 
444  CPSR cpsr, CPACR cpacr) const;
445 
453  CPSR cpsr, CPACR cpacr,
454  NSACR nsacr, FPEXC fpexc,
455  bool fpexc_check, bool advsimd) const;
456 
464  ExceptionLevel tgtEl, bool isWfe) const;
465 
473  ExceptionLevel tgtEl, bool isWfe) const;
474 
478  Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const;
479 
486  Fault checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const;
487 
495 
503 
510 
514  Fault checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const;
515 
523  CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const;
524 
534  ExceptionLevel pstateEL) const;
535 
536  public:
537  virtual void
539 
540  uint8_t
541  getIntWidth() const
542  {
543  return intWidth;
544  }
545 
547  ssize_t
548  instSize() const
549  {
550  return (!machInst.thumb || machInst.bigThumb) ? 4 : 2;
551  }
552 
559  MachInst
560  encoding() const
561  {
562  return static_cast<MachInst>(machInst & (mask(instSize() * 8)));
563  }
564 
565  size_t
566  asBytes(void *buf, size_t max_size) override
567  {
568  return simpleAsBytes(buf, max_size, machInst);
569  }
570 
571  static unsigned getCurSveVecLenInBits(ThreadContext *tc);
572 
573  static unsigned
575  {
576  return getCurSveVecLenInBits(tc) >> 6;
577  }
578 
579  template<typename T>
580  static unsigned
582  {
583  return getCurSveVecLenInBits(tc) / (8 * sizeof(T));
584  }
585 
586  inline Fault
587  undefined(bool disabled=false) const
588  {
589  return std::make_shared<UndefinedInstruction>(
590  machInst, false, mnemonic, disabled);
591  }
592 };
593 
594 } // namespace ArmISA
595 } // namespace gem5
596 
597 #endif //__ARCH_ARM_INSTS_STATICINST_HH__
void printMiscReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:370
int64_t extendReg64(uint64_t base, ArmExtendType type, uint64_t shiftAmt, uint8_t width) const
Definition: static_inst.cc:134
void printExtendOperand(bool firstOperand, std::ostream &os, RegIndex rm, ArmExtendType type, int64_t shiftAmt) const
Definition: static_inst.cc:562
Fault softwareBreakpoint32(ExecContext *xc, uint16_t imm) const
Trigger a Software Breakpoint.
Definition: static_inst.cc:635
bool shift_carry_imm(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:220
void advancePC(ThreadContext *tc) const override
Definition: static_inst.hh:208
ArmStaticInst(const char *mnem, ExtMachInst _machInst, OpClass __opClass)
Definition: static_inst.hh:154
void printCondition(std::ostream &os, unsigned code, bool noImplicit=false) const
Definition: static_inst.cc:417
void printMnemonic(std::ostream &os, const std::string &suffix="", bool withPred=true, bool withCond64=false, ConditionCode cond64=COND_UC) const
Definition: static_inst.cc:377
void printCCReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:364
bool generalExceptionsToAArch64(ThreadContext *tc, ExceptionLevel pstateEL) const
Return true if exceptions normally routed to EL1 are being handled at an Exception level using AArch6...
std::unique_ptr< PCStateBase > buildRetPC(const PCStateBase &cur_pc, const PCStateBase &call_pc) const override
Definition: static_inst.hh:218
Fault checkSveEnabled(ThreadContext *tc, CPSR cpsr, CPACR cpacr) const
Check an SVE access against CPACR_EL1, CPTR_EL2, and CPTR_EL3.
static unsigned getCurSveVecLen(ThreadContext *tc)
Definition: static_inst.hh:581
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:480
Fault undefinedFault32(ThreadContext *tc, ExceptionLevel el) const
UNDEFINED behaviour in AArch32.
Definition: static_inst.cc:966
uint8_t getIntWidth() const
Definition: static_inst.hh:541
ssize_t instSize() const
Returns the byte size of current instruction.
Definition: static_inst.hh:548
static void setIWNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:384
Fault checkForWFxTrap64(ThreadContext *tc, ExceptionLevel tgtEl, bool isWfe) const
Check if WFE/WFI instruction execution in aarch64 should be trapped.
Definition: static_inst.cc:873
static void activateBreakpoint(ThreadContext *tc)
Definition: static_inst.hh:230
Fault undefined(bool disabled=false) const
Definition: static_inst.hh:587
static unsigned getCurSveVecLenInBits(ThreadContext *tc)
bool isWFxTrapping(ThreadContext *tc, ExceptionLevel targetEL, bool isWfe) const
Definition: static_inst.cc:804
int64_t shiftReg64(uint64_t base, uint64_t shiftAmt, ArmShiftType type, uint8_t width) const
Definition: static_inst.cc:95
static bool uSaturateOp(uint32_t &res, int64_t op1, int64_t op2, bool sub=false)
Definition: static_inst.hh:121
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:727
int32_t shift_rm_rs(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:180
void printDataInst(std::ostream &os, bool withImm) const
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:566
static void setNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:341
void advancePC(PCStateBase &pcState) const override
Definition: static_inst.hh:202
CPSR getPSTATEFromPSR(ThreadContext *tc, CPSR cpsr, CPSR spsr) const
Get the new PSTATE from a SPSR register in preparation for an exception return.
void printPFflags(std::ostream &os, int flag) const
Definition: static_inst.cc:334
Fault trapWFx(ThreadContext *tc, CPSR cpsr, SCR scr, bool isWfe) const
WFE/WFI trapping helper function.
Definition: static_inst.cc:908
Fault undefinedFault64(ThreadContext *tc, ExceptionLevel el) const
UNDEFINED behaviour in AArch64.
Definition: static_inst.cc:985
void printVecReg(std::ostream &os, RegIndex reg_idx, bool isSveVecReg=false) const
Definition: static_inst.cc:351
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:299
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:237
void printShiftOperand(std::ostream &os, RegIndex rm, bool immShift, uint32_t shiftAmt, RegIndex rs, ArmShiftType type) const
Definition: static_inst.cc:498
uint64_t getEMI() const override
Definition: static_inst.hh:215
Fault advSIMDFPAccessTrap64(ExceptionLevel el) const
Trap an access to Advanced SIMD or FP registers due to access control bits.
Definition: static_inst.cc:655
std::string generateDisassembly(Addr pc, const loader::SymbolTable *symtab) const override
Internal function to generate disassembly string.
Definition: static_inst.cc:626
static void setAIWNextPC(ExecContext *xc, Addr val)
Definition: static_inst.hh:394
static Addr readPC(ExecContext *xc)
Definition: static_inst.hh:335
virtual void annotateFault(ArmFault *fault)
Definition: static_inst.hh:538
static bool saturateOp(int32_t &res, int64_t op1, int64_t op2, bool sub=false)
Definition: static_inst.hh:88
static bool uSatInt(int32_t &res, int64_t op, int width)
Definition: static_inst.hh:137
void printFloatReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:345
static bool satInt(int32_t &res, int64_t op, int width)
Definition: static_inst.hh:104
Fault checkFPAdvSIMDTrap64(ThreadContext *tc, CPSR cpsr) const
Check an Advaned SIMD access against CPTR_EL2 and CPTR_EL3.
Definition: static_inst.cc:675
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:560
bool shift_carry_rs(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:260
static unsigned getCurSveVecLenInQWords(ThreadContext *tc)
Definition: static_inst.hh:574
Fault checkForWFxTrap32(ThreadContext *tc, ExceptionLevel tgtEl, bool isWfe) const
Check if WFE/WFI instruction execution in aarch32 should be trapped.
Definition: static_inst.cc:831
static T cSwap(T val, bool big)
Definition: static_inst.hh:350
void printVecPredReg(std::ostream &os, RegIndex reg_idx) const
Definition: static_inst.cc:358
Fault sveAccessTrap(ExceptionLevel el) const
Trap an access to SVE registers due to access control bits.
static uint32_t spsrWriteByInstr(uint32_t spsr, uint32_t val, uint8_t byteMask, bool affectState)
Definition: static_inst.hh:317
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:714
int32_t shift_rm_imm(uint32_t base, uint32_t shamt, uint32_t type, uint32_t cfval) const
Definition: static_inst.cc:60
static T cSwap(T val, bool big)
Definition: static_inst.hh:361
void printTarget(std::ostream &os, Addr target, const loader::SymbolTable *symtab) const
Definition: static_inst.cc:398
Fault checkSETENDEnabled(ThreadContext *tc, CPSR cpsr) const
Check if SETEND instruction execution in aarch32 should be trapped.
Definition: static_inst.cc:934
SelfDebug * getSelfDebug() const
Definition: isa.hh:181
static bool haveEL(ThreadContext *tc, ArmISA::ExceptionLevel el)
Return true if the system implements a specific exception level.
Definition: system.cc:131
The ExecContext is an abstract base class the provides the interface used by the ISA to manipulate th...
Definition: exec_context.hh:72
virtual const PCStateBase & pcState() const =0
Target & as()
Definition: pcstate.hh:72
virtual PCStateBase * clone() const =0
Base, ISA-independent static instruction class.
Definition: static_inst.hh:89
size_t simpleAsBytes(void *buf, size_t max_size, const T &t)
Definition: static_inst.hh:356
const char * mnemonic
Base mnemonic (e.g., "add").
Definition: static_inst.hh:259
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual const PCStateBase & pcState() const =0
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:76
#define warn_once(...)
Definition: logging.hh:250
bool badMode(ThreadContext *tc, OperatingMode mode)
badMode is checking if the execution mode provided as an argument is valid and implemented.
Definition: utility.cc:399
Bitfield< 15, 12 > rd
Definition: types.hh:114
Bitfield< 3, 0 > mask
Definition: pcstate.hh:63
Bitfield< 4 > width
Definition: misc_types.hh:72
bool isSecure(ThreadContext *tc)
Definition: utility.cc:74
Bitfield< 3, 0 > rm
Definition: types.hh:118
Bitfield< 7, 0 > imm
Definition: types.hh:132
Bitfield< 23, 20 > advsimd
Definition: misc_types.hh:176
Bitfield< 4 > s
Definition: misc_types.hh:568
Bitfield< 7 > i
Definition: misc_types.hh:67
Bitfield< 9, 8 > rs
Definition: misc_types.hh:383
Bitfield< 19, 16 > rn
Definition: types.hh:113
uint32_t MachInst
Definition: types.hh:55
ConditionCode
Definition: cc.hh:92
@ COND_UC
Definition: cc.hh:108
Bitfield< 27 > nmfi
Definition: misc_types.hh:347
Bitfield< 4 > sd
Definition: misc_types.hh:833
Bitfield< 3, 2 > el
Definition: misc_types.hh:73
Bitfield< 4 > pc
Bitfield< 31, 0 > E
Definition: int.hh:56
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
Bitfield< 17 > os
Definition: misc.hh:810
Bitfield< 4 > op
Definition: types.hh:83
Bitfield< 63 > val
Definition: misc.hh:776
Bitfield< 3 > addr
Definition: types.hh:84
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< FaultBase > Fault
Definition: types.hh:248
T letoh(T value)
Definition: byteswap.hh:173
uint16_t RegIndex
Definition: types.hh:176
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
T htole(T value)
Definition: byteswap.hh:172
T letobe(T value)
Definition: byteswap.hh:166

Generated on Wed Dec 21 2022 10:22:26 for gem5 by doxygen 1.9.1