41#ifndef __ARCH_GENERIC_TYPES_HH__
42#define __ARCH_GENERIC_TYPES_HH__
70 template<
class Target>
74 return static_cast<Target &
>(*this);
77 template<
class Target>
81 return static_cast<const Target &
>(*this);
93 virtual void output(std::ostream &
os)
const = 0;
147static inline std::ostream &
170set(PCStateBase *&dest,
const PCStateBase *src)
172 if (GEM5_LIKELY(dest)) {
173 if (GEM5_LIKELY(src)) {
181 if (GEM5_LIKELY(src)) {
191set(std::unique_ptr<PCStateBase> &dest,
const PCStateBase *src)
193 PCStateBase *dest_ptr = dest.get();
195 if (dest.get() != dest_ptr)
196 dest.reset(dest_ptr);
200set(PCStateBase *&dest,
const std::unique_ptr<PCStateBase> &src)
202 const PCStateBase *src_ptr = src.get();
207set(std::unique_ptr<PCStateBase> &dest,
208 const std::unique_ptr<PCStateBase> &src)
210 PCStateBase *dest_ptr = dest.get();
211 const PCStateBase *src_ptr = src.get();
212 set(dest_ptr, src_ptr);
213 if (dest.get() != dest_ptr)
214 dest.reset(dest_ptr);
218set(PCStateBase *&dest,
const PCStateBase &src)
220 if (GEM5_LIKELY(dest)) {
230set(std::unique_ptr<PCStateBase> &dest,
const PCStateBase &src)
232 PCStateBase *dest_ptr = dest.get();
234 if (dest.get() != dest_ptr)
235 dest.reset(dest_ptr);
239set(PCStateBase &dest,
const PCStateBase &src)
301 _nupc = pcstate._nupc;
337template <
int InstW
idth>
365 this->
npc(val + InstWidth);
371 return this->
npc() != this->
pc() + InstWidth;
379 this->
_npc += InstWidth;
384template <
int InstW
idth>
420 return this->
npc() != this->
pc() + InstWidth ||
421 this->
nupc() != this->
upc() + 1;
443template <
int InstW
idth>
469 _nnpc = pcstate._nnpc;
492 return !(this->
nnpc() == this->
npc() + InstWidth &&
493 (this->
npc() == this->
pc() + InstWidth ||
494 this->
npc() == this->
pc() + 2 * InstWidth));
503 this->_nnpc += InstWidth;
529template <
int InstW
idth>
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
bool branching() const override
void unserialize(CheckpointIn &cp) override
Unserialize an object.
DelaySlotPCState & operator=(const DelaySlotPCState &other)=default
DelaySlotPCState(Addr val)
DelaySlotPCState(const DelaySlotPCState &other)
void output(std::ostream &os) const override
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool equals(const PCStateBase &other) const override
SimplePCState< InstWidth > Base
PCStateBase * clone() const override
void update(const PCStateBase &other) override
DelaySlotUPCState & operator=(const DelaySlotUPCState &other)=default
void output(std::ostream &os) const override
DelaySlotPCState< InstWidth > Base
DelaySlotUPCState(Addr val)
bool branching() const override
PCStateBase * clone() const override
DelaySlotUPCState(const DelaySlotUPCState &other)
void output(std::ostream &os) const override
void unserialize(CheckpointIn &cp) override
Unserialize an object.
PCStateWithNext & operator=(const PCStateWithNext &other)=default
bool equals(const PCStateBase &other) const override
void serialize(CheckpointOut &cp) const override
Serialize an object.
PCStateWithNext(const PCStateWithNext &other)
void update(const PCStateBase &other) override
bool branching() const override
SimplePCState & operator=(const SimplePCState &other)=default
SimplePCState(const SimplePCState &other)
void set(Addr val)
Force this PC to reflect a particular value, resetting all its other fields around it.
PCStateBase * clone() const override
UPCState & operator=(const UPCState &other)=default
void output(std::ostream &os) const override
PCStateBase * clone() const override
SimplePCState< InstWidth > Base
UPCState(const UPCState &other)
bool branching() const override
virtual bool equals(const PCStateBase &other) const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
virtual bool branching() const =0
MicroPC microPC() const
Returns the current micropc.
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
void update(const PCStateBase *ptr)
PCStateBase & operator=(const PCStateBase &other)=default
const Target & as() const
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual void output(std::ostream &os) const =0
virtual void update(const PCStateBase &other)
virtual ~PCStateBase()=default
virtual PCStateBase * clone() const =0
PCStateBase(const PCStateBase &other)
Basic support for object serialization.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
static bool operator==(const PCStateBase &a, const PCStateBase &b)
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::ostream & operator<<(std::ostream &os, const ArmSemihosting::InPlaceArg &ipa)
static bool operator!=(const PCStateBase &a, const PCStateBase &b)
void ccprintf(cp::Print &print)
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)