41#ifndef __ARCH_ARM_PCSTATE_HH__
42#define __ARCH_ARM_PCSTATE_HH__
47#include "debug/Decoder.hh"
69class
PCState : public GenericISA::UPCState<4>
82 uint8_t nextFlags = 0;
84 uint8_t _nextItstate = 0;
86 bool _illegalExec =
false;
89 bool _debugStep =
false;
90 bool _stepped =
false;
101 flags(other.flags), nextFlags(other.nextFlags),
102 _itstate(other._itstate), _nextItstate(other._nextItstate),
103 _size(other._size), _illegalExec(other._illegalExec),
104 _debugStep(other._debugStep), _stepped(other._stepped)
118 flags = pcstate.flags;
119 nextFlags = pcstate.nextFlags;
120 _itstate = pcstate._itstate;
121 _nextItstate = pcstate._nextItstate;
122 _size = pcstate._size;
123 _illegalExec = pcstate._illegalExec;
124 _debugStep = pcstate._debugStep;
125 _stepped = pcstate._stepped;
135 illegalExec(
bool val)
167 return flags & ThumbBit;
182 return nextFlags & ThumbBit;
189 nextFlags |= ThumbBit;
191 nextFlags &= ~ThumbBit;
194 void size(uint8_t
s) { _size =
s; }
195 uint8_t size()
const {
return _size; }
198 branching()
const override
200 return ((this->
pc() + this->size()) != this->npc());
207 return flags & AArch64Bit;
216 flags &= ~AArch64Bit;
222 return nextFlags & AArch64Bit;
226 nextAArch64(
bool val)
229 nextFlags |= AArch64Bit;
231 nextFlags &= ~AArch64Bit;
254 nextItstate(uint8_t value)
256 _nextItstate = value;
267 _itstate = _nextItstate;
269 }
else if (_itstate) {
270 ITSTATE it = _itstate;
271 uint8_t cond_mask = it.mask;
272 uint8_t thumb_cond = it.cond;
274 thumb_cond, cond_mask);
276 uint8_t new_bit =
bits(cond_mask, 4);
277 cond_mask &=
mask(4);
283 thumb_cond, cond_mask);
285 it.cond = thumb_cond;
301 return pc() + (
thumb() ? 4 : 8);
313 npc(
val &~
mask(nextThumb() ? 1 : 2));
355 return Base::equals(other) &&
356 flags == opc.flags && nextFlags == opc.nextFlags &&
357 _itstate == opc._itstate &&
358 _nextItstate == opc._nextItstate &&
359 _illegalExec == opc._illegalExec &&
360 _debugStep == opc._debugStep &&
361 _stepped == opc._stepped;
381 Base::unserialize(cp);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
#define EndBitUnion(name)
This closes off the class and union started by the above macro.
Bitfield< 55, 48 > itstate
GenericISA::DelaySlotPCState< 4 > PCState
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void unserialize(ThreadContext &tc, CheckpointIn &cp)
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)