Go to the documentation of this file.
41 #ifndef __ARCH_GENERIC_TYPES_HH__
42 #define __ARCH_GENERIC_TYPES_HH__
46 #include <type_traits>
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;
147 static inline std::ostream &
170 set(PCStateBase *&dest,
const PCStateBase *src)
172 if (GEM5_LIKELY(dest)) {
173 if (GEM5_LIKELY(src)) {
181 if (GEM5_LIKELY(src)) {
191 set(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);
200 set(PCStateBase *&dest,
const std::unique_ptr<PCStateBase> &src)
202 const PCStateBase *src_ptr = src.get();
207 set(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);
218 set(PCStateBase *&dest,
const PCStateBase &src)
220 if (GEM5_LIKELY(dest)) {
230 set(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);
239 set(PCStateBase &dest,
const PCStateBase &src)
301 _nupc = pcstate._nupc;
337 template <
int InstW
idth>
365 this->
npc(val + InstWidth);
371 return this->
npc() != this->
pc() + InstWidth;
379 this->
_npc += InstWidth;
384 template <
int InstW
idth>
420 return this->
npc() != this->
pc() + InstWidth ||
421 this->
nupc() != this->
upc() + 1;
443 template <
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;
529 template <
int InstW
idth>
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
bool branching() const override
void serialize(CheckpointOut &cp) const override
Serialize an object.
void output(std::ostream &os) const override
bool branching() const override
#define UNSERIALIZE_SCALAR(scalar)
UPCState & operator=(const UPCState &other)=default
void update(const PCStateBase &other) override
DelaySlotPCState & operator=(const DelaySlotPCState &other)=default
DelaySlotPCState(const DelaySlotPCState &other)
DelaySlotPCState(Addr val)
static std::ostream & operator<<(std::ostream &os, const DummyMatRegContainer &d)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
MicroPC microPC() const
Returns the current micropc.
PCStateBase * clone() const override
virtual ~PCStateBase()=default
void ccprintf(cp::Print &print)
virtual void output(std::ostream &os) const =0
UPCState(const UPCState &other)
bool branching() const override
virtual bool equals(const PCStateBase &other) const
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
virtual bool branching() const =0
PCStateBase & operator=(const PCStateBase &other)=default
Basic support for object serialization.
SimplePCState< InstWidth > Base
PCStateBase * clone() const override
DelaySlotUPCState(const DelaySlotUPCState &other)
void output(std::ostream &os) const override
DelaySlotPCState< InstWidth > Base
SimplePCState & operator=(const SimplePCState &other)=default
bool branching() const override
virtual void update(const PCStateBase &other)
void output(std::ostream &os) const override
PCStateBase * clone() const override
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
#define SERIALIZE_SCALAR(scalar)
void serialize(CheckpointOut &cp) const override
Serialize an object.
DelaySlotUPCState(Addr val)
PCStateBase(const PCStateBase &other)
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool equals(const PCStateBase &other) const override
void output(std::ostream &os) const override
SimplePCState(const SimplePCState &other)
PCStateWithNext & operator=(const PCStateWithNext &other)=default
const Target & as() const
static bool operator==(const PCStateBase &a, const PCStateBase &b)
void set(Addr val)
Force this PC to reflect a particular value, resetting all its other fields around it.
void update(const PCStateBase &other) override
PCStateBase * clone() const override
bool equals(const PCStateBase &other) const override
std::ostream CheckpointOut
PCStateWithNext(const PCStateWithNext &other)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
static bool operator!=(const PCStateBase &a, const PCStateBase &b)
void update(const PCStateBase *ptr)
SimplePCState< InstWidth > Base
virtual PCStateBase * clone() const =0
DelaySlotUPCState & operator=(const DelaySlotUPCState &other)=default
Generated on Sun Jul 30 2023 01:56:49 for gem5 by doxygen 1.8.17