gem5  v20.1.0.0
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 RiscvISA::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 ()
 Gets the fully-qualified name of the active section. More...
 
static void serializeAll (const std::string &cpt_dir)
 Serializes all the SimObjects. More...
 
static void unserializeGlobals (CheckpointIn &cp)
 

Detailed Description

Definition at line 64 of file types.hh.

Constructor & Destructor Documentation

◆ PCStateBase() [1/2]

GenericISA::PCStateBase::PCStateBase ( )
inlineprotected

Definition at line 70 of file types.hh.

◆ PCStateBase() [2/2]

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

Definition at line 71 of file types.hh.

References set(), and X86ISA::val.

Member Function Documentation

◆ instAddr()

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 80 of file types.hh.

References _pc.

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

◆ microPC()

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

Returns the current micropc.

Returns
The current micropc.

Definition at line 102 of file types.hh.

◆ nextInstAddr()

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 91 of file types.hh.

References _npc.

◆ operator!=()

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

Definition at line 122 of file types.hh.

◆ operator==()

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

Definition at line 116 of file types.hh.

References _npc, and _pc.

◆ serialize()

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 >, GenericISA::UPCState< MachInst >, and X86ISA::PCState.

Definition at line 128 of file types.hh.

References _npc, _pc, and SERIALIZE_SCALAR.

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

◆ set()

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().

◆ unserialize()

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 >, GenericISA::UPCState< MachInst >, and X86ISA::PCState.

Definition at line 135 of file types.hh.

References _npc, _pc, and UNSERIALIZE_SCALAR.

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

Member Data Documentation

◆ _npc

Addr GenericISA::PCStateBase::_npc
protected

◆ _pc

Addr GenericISA::PCStateBase::_pc
protected

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

Generated on Wed Sep 30 2020 14:03:05 for gem5 by doxygen 1.8.17