gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GenericISA::PCStateBase Class Reference

#include <types.hh>

Inheritance diagram for GenericISA::PCStateBase:
Serializable GenericISA::SimplePCState< MachInst > GenericISA::DelaySlotPCState< MachInst > GenericISA::UPCState< MachInst > GenericISA::DelaySlotUPCState< MachInst > NullISA::PCState X86ISA::PCState

Public Member Functions

Addr instAddr () const
 Returns the memory address the bytes of this instruction came from. More...
 
Addr nextInstAddr () const
 Returns the memory address the bytes of the next instruction came from. More...
 
MicroPC microPC () const
 Returns the current micropc. More...
 
void set (Addr val)
 Force this PC to reflect a particular value, resetting all its other fields around it. More...
 
bool operator== (const PCStateBase &opc) const
 
bool operator!= (const PCStateBase &opc) const
 
void serialize (CheckpointOut &cp) const override
 Serialize an object. More...
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object. More...
 
- Public Member Functions inherited from Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section. More...
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object. More...
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 

Protected Member Functions

 PCStateBase ()
 
 PCStateBase (Addr val)
 

Protected Attributes

Addr _pc
 
Addr _npc
 

Additional Inherited Members

- Static Public Member Functions inherited from Serializable
static const std::string & currentSection ()
 Get the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 
static void unserializeGlobals (CheckpointIn &cp)
 
- Static Public Attributes inherited from Serializable
static int ckptCount = 0
 
static int ckptMaxCount = 0
 
static int ckptPrevCount = -1
 

Detailed Description

Definition at line 44 of file types.hh.

Constructor & Destructor Documentation

GenericISA::PCStateBase::PCStateBase ( )
inlineprotected

Definition at line 50 of file types.hh.

GenericISA::PCStateBase::PCStateBase ( Addr  val)
inlineprotected

Definition at line 51 of file types.hh.

References set().

Member Function Documentation

Addr GenericISA::PCStateBase::instAddr ( ) const
inline

Returns the memory address the bytes of this instruction came from.

Returns
Memory address of the current instruction's encoding.

Definition at line 60 of file types.hh.

References _pc.

Referenced by AlphaISA::Decoder::decode(), MipsISA::Decoder::decode(), RiscvISA::Decoder::decode(), SparcISA::Decoder::decode(), and X86ISA::Decoder::moreBytes().

MicroPC GenericISA::PCStateBase::microPC ( ) const
inline

Returns the current micropc.

Returns
The current micropc.

Definition at line 82 of file types.hh.

Addr GenericISA::PCStateBase::nextInstAddr ( ) const
inline

Returns the memory address the bytes of the next instruction came from.

Returns
Memory address of the next instruction's encoding.

Definition at line 71 of file types.hh.

References _npc.

bool GenericISA::PCStateBase::operator!= ( const PCStateBase opc) const
inline

Definition at line 102 of file types.hh.

bool GenericISA::PCStateBase::operator== ( const PCStateBase opc) const
inline

Definition at line 96 of file types.hh.

References _npc, and _pc.

void GenericISA::PCStateBase::serialize ( CheckpointOut cp) const
inlineoverridevirtual

Serialize an object.

Output an object's state into the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Reimplemented in GenericISA::DelaySlotUPCState< MachInst >, GenericISA::DelaySlotPCState< MachInst >, X86ISA::PCState, and GenericISA::UPCState< MachInst >.

Definition at line 108 of file types.hh.

References _npc, _pc, and SERIALIZE_SCALAR.

Referenced by GenericISA::UPCState< MachInst >::serialize(), and GenericISA::DelaySlotPCState< MachInst >::serialize().

void GenericISA::PCStateBase::set ( Addr  val)

Force this PC to reflect a particular value, resetting all its other fields around it.

This is useful for in place (re)initialization.

Parameters
valThe value to set the PC to.

Referenced by PCStateBase().

void GenericISA::PCStateBase::unserialize ( CheckpointIn cp)
inlineoverridevirtual

Unserialize an object.

Read an object's state from the current checkpoint section.

Parameters
cpCheckpoint state

Implements Serializable.

Reimplemented in GenericISA::DelaySlotUPCState< MachInst >, GenericISA::DelaySlotPCState< MachInst >, X86ISA::PCState, and GenericISA::UPCState< MachInst >.

Definition at line 115 of file types.hh.

References _npc, _pc, and UNSERIALIZE_SCALAR.

Referenced by GenericISA::UPCState< MachInst >::unserialize(), and GenericISA::DelaySlotPCState< MachInst >::unserialize().

Member Data Documentation

Addr GenericISA::PCStateBase::_npc
protected
Addr GenericISA::PCStateBase::_pc
protected

The documentation for this class was generated from the following file:

Generated on Fri Jun 9 2017 13:04:30 for gem5 by doxygen 1.8.6