CPUComponent Class Reference

Back to the index.

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CPUComponent Class Referenceabstract

A base-class for processors Component implementations. More...

#include <CPUComponent.h>

Inheritance diagram for CPUComponent:
Component AddressDataBus UnitTestable ReferenceCountable CPUDyntransComponent I960_CPUComponent M88K_CPUComponent MIPS_CPUComponent

Public Member Functions

 CPUComponent (const string &className, const string &cpuKind)
 Constructs a CPUComponent. More...
 
SymbolRegistryGetSymbolRegistry ()
 Gets a reference to the CPU's symbol registry. More...
 
const SymbolRegistryGetSymbolRegistry () const
 
virtual void ResetState ()
 Resets the state variables of this component. More...
 
virtual double GetCurrentFrequency () const
 Returns the current frequency (in Hz) that the component runs at. More...
 
virtual CPUComponentAsCPUComponent ()
 Returns the component's CPUComponent interface. More...
 
virtual void GetMethodNames (vector< string > &names) const
 Retrieves a component's implemented method names. More...
 
virtual bool MethodMayBeReexecutedWithoutArgs (const string &methodName) const
 Returns whether a method name may be re-executed without args. More...
 
virtual void ExecuteMethod (GXemul *gxemul, const string &methodName, const vector< string > &arguments)
 Executes a method on the component. More...
 
virtual AddressDataBusAsAddressDataBus ()
 Returns the component's AddressDataBus interface, if any. More...
 
virtual void AddressSelect (uint64_t address)
 Place an address on the bus. More...
 
virtual bool ReadData (uint8_t &data, Endianness endianness)
 Reads 8-bit data from the currently selected address. More...
 
virtual bool ReadData (uint16_t &data, Endianness endianness)
 Reads 16-bit data from the currently selected address. More...
 
virtual bool ReadData (uint32_t &data, Endianness endianness)
 Reads 32-bit data from the currently selected address. More...
 
virtual bool ReadData (uint64_t &data, Endianness endianness)
 Reads 64-bit data from the currently selected address. More...
 
virtual bool WriteData (const uint8_t &data, Endianness endianness)
 Writes 8-bit data to the currently selected address. More...
 
virtual bool WriteData (const uint16_t &data, Endianness endianness)
 Writes 16-bit data to the currently selected address. More...
 
virtual bool WriteData (const uint32_t &data, Endianness endianness)
 Writes 32-bit data to the currently selected address. More...
 
virtual bool WriteData (const uint64_t &data, Endianness endianness)
 Writes 64-bit data to the currently selected address. More...
 
virtual size_t DisassembleInstruction (uint64_t vaddr, size_t maxLen, unsigned char *instruction, vector< string > &result)=0
 Disassembles an instruction into readable strings. More...
 
- Public Member Functions inherited from Component
virtual ~Component ()
 
string GetClassName () const
 Gets the class name of the component. More...
 
string GetVisibleClassName () const
 Gets the visible class name of the component. More...
 
refcount_ptr< ComponentClone () const
 Clones the component and all its children. More...
 
const refcount_ptr< ComponentLightClone () const
 Makes a light clone of the component and all its children. More...
 
void DetectChanges (const refcount_ptr< Component > &oldClone, ostream &changeMessages) const
 Compare an older clone to the current tree, to find changes. More...
 
string GenerateTreeDump (const string &branchTemplate, bool htmlLinksForClassNames=false, string prefixForComponentUrls="") const
 Generates an ASCII tree dump of a component tree. More...
 
virtual string GenerateDetails () const
 Generate details about the component. More...
 
void Reset ()
 Resets the state of this component and all its children. More...
 
bool PreRunCheck (GXemul *gxemul)
 Checks the state of this component and all its children, before starting execution. More...
 
void FlushCachedState ()
 Resets the cached state of this component and all its children. More...
 
virtual int Execute (GXemul *gxemul, int nrOfCycles)
 Execute one or more cycles. More...
 
virtual RootComponentAsRootComponent ()
 Returns the component's RootComponent interface. More...
 
void SetParent (Component *parentComponent)
 Sets the parent component of this component. More...
 
ComponentGetParent ()
 Gets this component's parent component, if any. More...
 
const ComponentGetParent () const
 
string GeneratePath () const
 Generates a string representation of the path to the Component. More...
 
string GenerateShortestPossiblePath () const
 Generates a short string representation of the path to the Component. More...
 
const refcount_ptr< ComponentLookupPath (string path) const
 Looks up a path from this Component, and returns a pointer to the found Component, if any. More...
 
vector< string > FindPathByPartialMatch (const string &partialPath, bool shortestPossible=false) const
 Finds complete component paths, given a partial path. More...
 
void AddChild (refcount_ptr< Component > childComponent, size_t insertPosition=(size_t) -1)
 Adds a reference to a child component. More...
 
size_t RemoveChild (Component *childToRemove)
 Removes a reference to a child component. More...
 
ComponentsGetChildren ()
 Gets pointers to child components. More...
 
const ComponentsGetChildren () const
 Gets pointers to child components, as a const reference. More...
 
void GetVariableNames (vector< string > &names) const
 Retrieves a component's state variable names. More...
 
StateVariableGetVariable (const string &name)
 Gets a pointer to a state variable. More...
 
const StateVariableGetVariable (const string &name) const
 Gets a pointer to a state variable. More...
 
bool SetVariableValue (const string &name, const string &expression)
 Sets a variable to a new value. More...
 
void Serialize (ostream &ss, SerializationContext &context) const
 Serializes the Component into a string stream. More...
 
bool CheckConsistency () const
 Checks consistency by serializing and deserializing the component (including all its child components), and comparing the checksum of the original tree with the deserialized tree. More...
 
void AddChecksum (Checksum &checksum) const
 Adds this component's state, including children, to a checksum. More...
 
- Public Member Functions inherited from ReferenceCountable
 ReferenceCountable ()
 Default constructor, which initializes the reference count to zero. More...
 
 ~ReferenceCountable ()
 
- Public Member Functions inherited from AddressDataBus
 AddressDataBus ()
 Constructs an AddressDataBus instance. More...
 
virtual ~AddressDataBus ()
 

Static Public Member Functions

static void RunUnitTests (int &nSucceeded, int &nFailures)
 
- Static Public Member Functions inherited from Component
static string GetAttribute (const string &attributeName)
 Creates a Component. More...
 
static refcount_ptr< ComponentDeserialize (ostream &messages, const string &str, size_t &pos)
 Deserializes a string into a component tree. More...
 
- Static Public Member Functions inherited from UnitTestable
static void RunUnitTests (int &nSucceeded, int &nFailures)
 Runs unit test cases. More...
 

Protected Member Functions

virtual void FlushCachedStateForComponent ()
 Resets the cached state of this component. More...
 
virtual bool PreRunCheckForComponent (GXemul *gxemul)
 Checks the state of this component, before starting execution. More...
 
virtual void ShowRegisters (GXemul *gxemul, const vector< string > &arguments) const
 
uint64_t Unassemble (int nRows, bool indicatePC, uint64_t vaddr, ostream &output)
 
virtual bool VirtualToPhysical (uint64_t vaddr, uint64_t &paddr, bool &writable)=0
 Virtual to physical address translation (MMU). More...
 
virtual string VirtualAddressAsString (uint64_t vaddr)
 Format a virtual address as a displayable string. More...
 
virtual uint64_t PCtoInstructionAddress (uint64_t pc)
 Convert PC value to instuction address. More...
 
bool FunctionTraceCall ()
 
bool FunctionTraceReturn ()
 
virtual int FunctionTraceArgumentCount ()
 
virtual int64_t FunctionTraceArgument (int n)
 
virtual bool FunctionTraceReturnImpl (int64_t &retval)
 
- Protected Member Functions inherited from Component
 Component (const string &className, const string &visibleClassName)
 Base constructor for a Component. More...
 
template<class T >
bool AddVariable (const string &name, T *variablePointer)
 Adds a state variable of type T to the Component. More...
 
bool AddCustomVariable (const string &name, CustomStateVariableHandler *variableHandler)
 Adds a custom state variable to the Component. More...
 
virtual bool CheckVariableWrite (StateVariable &var, const string &oldValue)
 Checks whether a write to a variable is OK. More...
 
GXemulGetRunningGXemulInstance ()
 Returns a reference to the current GXemul instance. More...
 
UIGetUI ()
 Gets an UI reference for outputting debug messages during runtime. More...
 

Protected Attributes

double m_frequency
 
bool m_paused
 
string m_cpuArchitecture
 
int m_pageSize
 
uint64_t m_pc
 
uint64_t m_lastDumpAddr
 
uint64_t m_lastUnassembleVaddr
 
bool m_hasUsedUnassemble
 
bool m_isBigEndian
 
bool m_showFunctionTraceCall
 
bool m_showFunctionTraceReturn
 
int32_t m_functionCallTraceDepth
 
int64_t m_nrOfTracedFunctionCalls
 
bool m_inDelaySlot
 
uint64_t m_delaySlotTarget
 
AddressDataBusm_addressDataBus
 
uint64_t m_addressSelect
 
bool m_exceptionOrAbortInDelaySlot
 

Detailed Description

A base-class for processors Component implementations.

Definition at line 43 of file CPUComponent.h.

Constructor & Destructor Documentation

◆ CPUComponent()

CPUComponent::CPUComponent ( const string &  className,
const string &  cpuKind 
)

Constructs a CPUComponent.

Parameters
classNameThe class name for the component.
cpuKindThe CPU kind, e.g. "MIPS R4400" for a MIPS R4400 processor.

Definition at line 36 of file CPUComponent.cc.

References Component::AddVariable(), m_cpuArchitecture, m_frequency, m_functionCallTraceDepth, m_hasUsedUnassemble, m_isBigEndian, m_lastDumpAddr, m_lastUnassembleVaddr, m_nrOfTracedFunctionCalls, m_paused, m_pc, m_showFunctionTraceCall, and m_showFunctionTraceReturn.

Member Function Documentation

◆ AddressSelect()

void CPUComponent::AddressSelect ( uint64_t  address)
virtual

Place an address on the bus.

Parameters
addressThe address to select.

Implements AddressDataBus.

Definition at line 513 of file CPUComponent.cc.

References m_addressSelect.

Referenced by CPUDyntransComponent::DyntransReadInstruction(), ExecuteMethod(), GetSymbolRegistry(), and Unassemble().

◆ AsAddressDataBus()

AddressDataBus * CPUComponent::AsAddressDataBus ( )
virtual

Returns the component's AddressDataBus interface, if any.

Returns
A pointer to an AddressDataBus, or NULL if the component does not support that interface.

Reimplemented from Component.

Definition at line 429 of file CPUComponent.cc.

Referenced by GetSymbolRegistry().

◆ AsCPUComponent()

CPUComponent * CPUComponent::AsCPUComponent ( )
virtual

Returns the component's CPUComponent interface.

Returns
A pointer to the component as a CPUComponent, or NULL if the component isn't a CPU.

Reimplemented from Component.

Definition at line 76 of file CPUComponent.cc.

Referenced by GetSymbolRegistry().

◆ DisassembleInstruction()

virtual size_t CPUComponent::DisassembleInstruction ( uint64_t  vaddr,
size_t  maxLen,
unsigned char *  instruction,
vector< string > &  result 
)
pure virtual

Disassembles an instruction into readable strings.

Parameters
vaddrThe virtual address of the program counter.
maxLenThe number of bytes in the instruction buffer.
instructionA pointer to a buffer containing the instruction.
resultA vector where the implementation will add:
  1. machine code bytes in a standard notation
  2. instruction mnemonic
  3. instruction arguments
  4. instruction comments
All of the fields above are optional, but they have to be specified in the same order for a particular CPU implementation, so that the fields of the vector can be listed in a tabular format.
Returns
The number of bytes that the instruction occupied.

Implemented in M88K_CPUComponent, MIPS_CPUComponent, and I960_CPUComponent.

Referenced by DYNTRANS_INSTR(), GetSymbolRegistry(), and Unassemble().

◆ ExecuteMethod()

void CPUComponent::ExecuteMethod ( GXemul gxemul,
const string &  methodName,
const vector< string > &  arguments 
)
virtual

Executes a method on the component.

Note 1: The method name must be one of those returned by GetMethodNames(vector<string>&), either in the class itself or by one of the base implementations.

Note 2: The base class' member function should only be called if this class does not handle the method.

Parameters
gxemulA reference to the GXemul instance.
methodNameThe name of the method.
argumentsA vector of arguments to the method.

Reimplemented from Component.

Definition at line 203 of file CPUComponent.cc.

References AddressSelect(), BigEndian, data, Component::ExecuteMethod(), GXemul::GetUI(), LittleEndian, m_hasUsedUnassemble, m_isBigEndian, m_lastDumpAddr, m_lastUnassembleVaddr, m_pc, PCtoInstructionAddress(), ReadData(), UI::ShowDebugMessage(), ShowRegisters(), and Unassemble().

Referenced by GetSymbolRegistry().

◆ FlushCachedStateForComponent()

void CPUComponent::FlushCachedStateForComponent ( )
protectedvirtual

Resets the cached state of this component.

Note 1: This function is not recursive, so children should not be traversed.

Note 2: After a component's state variables have been reset, the base class' FlushCachedStateForComponent() function should also be called.

The implementation of this function ususally takes the form of setting a number of pointers to NULL, and then the call to the base class' FlushCachedStateForComponent() function.

Reimplemented from Component.

Definition at line 435 of file CPUComponent.cc.

References Component::FlushCachedStateForComponent(), and m_addressDataBus.

Referenced by GetSymbolRegistry().

◆ FunctionTraceArgument()

virtual int64_t CPUComponent::FunctionTraceArgument ( int  n)
inlineprotectedvirtual

Reimplemented in M88K_CPUComponent, MIPS_CPUComponent, and I960_CPUComponent.

Definition at line 185 of file CPUComponent.h.

Referenced by FunctionTraceCall().

◆ FunctionTraceArgumentCount()

virtual int CPUComponent::FunctionTraceArgumentCount ( )
inlineprotectedvirtual

Reimplemented in M88K_CPUComponent, MIPS_CPUComponent, and I960_CPUComponent.

Definition at line 184 of file CPUComponent.h.

Referenced by FunctionTraceCall().

◆ FunctionTraceCall()

bool CPUComponent::FunctionTraceCall ( )
protected

◆ FunctionTraceReturn()

bool CPUComponent::FunctionTraceReturn ( )
protected

◆ FunctionTraceReturnImpl()

virtual bool CPUComponent::FunctionTraceReturnImpl ( int64_t &  retval)
inlineprotectedvirtual

Reimplemented in M88K_CPUComponent, MIPS_CPUComponent, and I960_CPUComponent.

Definition at line 186 of file CPUComponent.h.

Referenced by FunctionTraceReturn().

◆ GetCurrentFrequency()

double CPUComponent::GetCurrentFrequency ( ) const
virtual

Returns the current frequency (in Hz) that the component runs at.

Returns
The component's frequency in Hz.

Reimplemented from Component.

Definition at line 70 of file CPUComponent.cc.

References m_frequency.

Referenced by GetSymbolRegistry().

◆ GetMethodNames()

void CPUComponent::GetMethodNames ( vector< string > &  names) const
virtual

Retrieves a component's implemented method names.

Note that a component's implementation should call its base class' GetMethodNames(vector<string>&) too. However, when methods are executed, the most specific implementation (i.e. not the base class) will get a chance first to execute the method.

Parameters
namesA vector of strings, where method names should be added.

Reimplemented from Component.

Definition at line 178 of file CPUComponent.cc.

References Component::GetMethodNames().

Referenced by GetSymbolRegistry().

◆ GetSymbolRegistry() [1/2]

SymbolRegistry& CPUComponent::GetSymbolRegistry ( )
inline

Gets a reference to the CPU's symbol registry.

Returns
A reference to the symbol registry.

Definition at line 63 of file CPUComponent.h.

Referenced by CPUDyntransComponent::DyntransToBeTranslatedDone(), FunctionTraceCall(), I960_CPUComponent::ShowRegisters(), M88K_CPUComponent::ShowRegisters(), and Unassemble().

◆ GetSymbolRegistry() [2/2]

const SymbolRegistry& CPUComponent::GetSymbolRegistry ( ) const
inline

◆ MethodMayBeReexecutedWithoutArgs()

bool CPUComponent::MethodMayBeReexecutedWithoutArgs ( const string &  methodName) const
virtual

Returns whether a method name may be re-executed without args.

Typical examples may be a RAMComponent which has a "dump" method, or a CPUComponent which has "dump" and "unassemble" methods.

Note that a component's implementation should call its base class' MethodMayBeReexecutedWithoutArgs(cosnt string&) too.

Parameters
methodNameThe name of the method.
Returns
true if the method may be re-executed without arguments, false otherwise.

Reimplemented from Component.

Definition at line 190 of file CPUComponent.cc.

References Component::MethodMayBeReexecutedWithoutArgs().

Referenced by GetSymbolRegistry().

◆ PCtoInstructionAddress()

virtual uint64_t CPUComponent::PCtoInstructionAddress ( uint64_t  pc)
inlineprotectedvirtual

Convert PC value to instuction address.

Usually, this does not need to be overridden. However, some architectures use e.g. the lowest bit of the PC register to indicate a different encoding mode (MIPS16), but the instruction is still aligned as if the lowest bit was 0.

Reimplemented in MIPS_CPUComponent, and I960_CPUComponent.

Definition at line 174 of file CPUComponent.h.

References FunctionTraceCall(), and FunctionTraceReturn().

Referenced by CPUDyntransComponent::DyntransReadInstruction(), CPUDyntransComponent::DyntransToBeTranslatedDone(), CPUDyntransComponent::Execute(), ExecuteMethod(), FunctionTraceCall(), and Unassemble().

◆ PreRunCheckForComponent()

bool CPUComponent::PreRunCheckForComponent ( GXemul gxemul)
protectedvirtual

Checks the state of this component, before starting execution.

Note 1: This function is not recursive, so children should not be traversed.

Note 2: After a component's state variables have been checked, the base class' PreRunCheckForComponent(GXemul*) function should also be called.

The implementation of this function may choose to print warning messages but still return true, or it can print error messages and return false.

Typical examples of pre-run-check failures are:

Returns
true if the component is ready to run, false otherwise.

Reimplemented from Component.

Reimplemented in M88K_CPUComponent, MIPS_CPUComponent, and I960_CPUComponent.

Definition at line 443 of file CPUComponent.cc.

References Component::AsAddressDataBus(), Component::GenerateShortestPossiblePath(), Component::GetChildren(), Component::GetParent(), GXemul::GetUI(), refcount_ptr< T >::IsNULL(), m_addressDataBus, and UI::ShowDebugMessage().

Referenced by GetSymbolRegistry(), I960_CPUComponent::PreRunCheckForComponent(), and M88K_CPUComponent::PreRunCheckForComponent().

◆ ReadData() [1/4]

bool CPUComponent::ReadData ( uint8_t &  data,
Endianness  endianness 
)
virtual

Reads 8-bit data from the currently selected address.

Parameters
dataA reference to a variable which will receive the data.
endiannessSelects the endianness of the operation. Ignored for 8-bit reads and writes.
Returns
True if the access was successful, false otherwise (e.g. because of a timeout).

Implements AddressDataBus.

Definition at line 519 of file CPUComponent.cc.

References AddressDataBus::AddressSelect(), m_addressDataBus, m_addressSelect, AddressDataBus::ReadData(), and VirtualToPhysical().

Referenced by CPUDyntransComponent::DyntransReadInstruction(), ExecuteMethod(), GetSymbolRegistry(), and Unassemble().

◆ ReadData() [2/4]

bool CPUComponent::ReadData ( uint16_t &  data,
Endianness  endianness 
)
virtual

Reads 16-bit data from the currently selected address.

Parameters
dataA reference to a variable which will receive the data.
endiannessSelects the endianness of the operation.
Returns
True if the access was successful, false otherwise (e.g. because of a timeout).

Implements AddressDataBus.

Definition at line 533 of file CPUComponent.cc.

References AddressDataBus::AddressSelect(), m_addressDataBus, m_addressSelect, AddressDataBus::ReadData(), and VirtualToPhysical().

◆ ReadData() [3/4]

bool CPUComponent::ReadData ( uint32_t &  data,
Endianness  endianness 
)
virtual

Reads 32-bit data from the currently selected address.

Parameters
dataA reference to a variable which will receive the data.
endiannessSelects the endianness of the operation.
Returns
True if the access was successful, false otherwise (e.g. because of a timeout).

Implements AddressDataBus.

Definition at line 549 of file CPUComponent.cc.

References AddressDataBus::AddressSelect(), m_addressDataBus, m_addressSelect, AddressDataBus::ReadData(), and VirtualToPhysical().

◆ ReadData() [4/4]

bool CPUComponent::ReadData ( uint64_t &  data,
Endianness  endianness 
)
virtual

Reads 64-bit data from the currently selected address.

Parameters
dataA reference to a variable which will receive the data.
endiannessSelects the endianness of the operation.
Returns
True if the access was successful, false otherwise (e.g. because of a timeout).

Implements AddressDataBus.

Definition at line 565 of file CPUComponent.cc.

References AddressDataBus::AddressSelect(), m_addressDataBus, m_addressSelect, AddressDataBus::ReadData(), and VirtualToPhysical().

◆ ResetState()

void CPUComponent::ResetState ( )
virtual

Resets the state variables of this component.

Note 1: This function is not recursive, so children should not be traversed.

Note 2: After a component's state variables have been reset, the base class' ResetState() function should also be called.

The implementation of this function ususally takes the form of a number of assignment of values to member variables, and then the call to the base class' ResetState() function.

Reimplemented from Component.

Reimplemented in M88K_CPUComponent, MIPS_CPUComponent, and I960_CPUComponent.

Definition at line 82 of file CPUComponent.cc.

References SymbolRegistry::Clear(), m_delaySlotTarget, m_exceptionOrAbortInDelaySlot, m_functionCallTraceDepth, m_hasUsedUnassemble, m_inDelaySlot, m_nrOfTracedFunctionCalls, and Component::ResetState().

Referenced by GetSymbolRegistry(), I960_CPUComponent::ResetState(), MIPS_CPUComponent::ResetState(), and M88K_CPUComponent::ResetState().

◆ RunUnitTests()

static void CPUComponent::RunUnitTests ( int &  nSucceeded,
int &  nFailures 
)
static

Referenced by GetSymbolRegistry().

◆ ShowRegisters()

void CPUComponent::ShowRegisters ( GXemul gxemul,
const vector< string > &  arguments 
) const
protectedvirtual

Reimplemented in M88K_CPUComponent, MIPS_CPUComponent, and I960_CPUComponent.

Definition at line 506 of file CPUComponent.cc.

References GXemul::GetUI(), and UI::ShowDebugMessage().

Referenced by ExecuteMethod(), and GetSymbolRegistry().

◆ Unassemble()

uint64_t CPUComponent::Unassemble ( int  nRows,
bool  indicatePC,
uint64_t  vaddr,
ostream &  output 
)
protected

◆ VirtualAddressAsString()

virtual string CPUComponent::VirtualAddressAsString ( uint64_t  vaddr)
inlineprotectedvirtual

Format a virtual address as a displayable string.

This function may be overridden in each CPU implementation. The default implementation just uses the stringstream << operator.

Parameters
vaddrThe virtual address to translate.
Returns
A string rendering of the virtual address, e.g. "0x00100f00"

Reimplemented in MIPS_CPUComponent, and I960_CPUComponent.

Definition at line 158 of file CPUComponent.h.

Referenced by Unassemble().

◆ VirtualToPhysical()

virtual bool CPUComponent::VirtualToPhysical ( uint64_t  vaddr,
uint64_t &  paddr,
bool &  writable 
)
protectedpure virtual

Virtual to physical address translation (MMU).

This function should be overridden in each CPU implementation.

Parameters
vaddrThe virtual address to translate.
paddrThe return value; physical address.
writableThis is set to true or false by the function, depending on if the memory at the virtual address was writable or not.
Returns
True if the translation succeeded, false if there was a translation error.

Implemented in M88K_CPUComponent, MIPS_CPUComponent, and I960_CPUComponent.

Referenced by GetSymbolRegistry(), ReadData(), and WriteData().

◆ WriteData() [1/4]

bool CPUComponent::WriteData ( const uint8_t &  data,
Endianness  endianness 
)
virtual

Writes 8-bit data to the currently selected address.

Parameters
dataA reference to a variable which contains the data.
endiannessSelects the endianness of the operation. Ignored for 8-bit reads and writes.
Returns
True if the access was successful, false otherwise (e.g. because of a timeout).

Implements AddressDataBus.

Definition at line 581 of file CPUComponent.cc.

References AddressDataBus::AddressSelect(), m_addressDataBus, m_addressSelect, VirtualToPhysical(), and AddressDataBus::WriteData().

Referenced by GetSymbolRegistry().

◆ WriteData() [2/4]

bool CPUComponent::WriteData ( const uint16_t &  data,
Endianness  endianness 
)
virtual

Writes 16-bit data to the currently selected address.

Parameters
dataA reference to a variable which contains the data.
endiannessSelects the endianness of the operation.
Returns
True if the access was successful, false otherwise (e.g. because of a timeout).

Implements AddressDataBus.

Definition at line 595 of file CPUComponent.cc.

References AddressDataBus::AddressSelect(), m_addressDataBus, m_addressSelect, VirtualToPhysical(), and AddressDataBus::WriteData().

◆ WriteData() [3/4]

bool CPUComponent::WriteData ( const uint32_t &  data,
Endianness  endianness 
)
virtual

Writes 32-bit data to the currently selected address.

Parameters
dataA reference to a variable which contains the data.
endiannessSelects the endianness of the operation.
Returns
True if the access was successful, false otherwise (e.g. because of a timeout).

Implements AddressDataBus.

Definition at line 611 of file CPUComponent.cc.

References AddressDataBus::AddressSelect(), m_addressDataBus, m_addressSelect, VirtualToPhysical(), and AddressDataBus::WriteData().

◆ WriteData() [4/4]

bool CPUComponent::WriteData ( const uint64_t &  data,
Endianness  endianness 
)
virtual

Writes 64-bit data to the currently selected address.

Parameters
dataA reference to a variable which contains the data.
endiannessSelects the endianness of the operation.
Returns
True if the access was successful, false otherwise (e.g. because of a timeout).

Implements AddressDataBus.

Definition at line 627 of file CPUComponent.cc.

References AddressDataBus::AddressSelect(), UnitTest::Assert(), ComponentFactory::CreateComponent(), GXemul::GetCommandInterpreter(), GXemul::GetRootComponent(), ComponentFactory::HasAttribute(), refcount_ptr< T >::IsNULL(), m_addressDataBus, m_addressSelect, Component::MethodMayBeReexecutedWithoutArgs(), Component::PreRunCheck(), CommandInterpreter::RunCommand(), UNITTEST, UNITTESTS, VirtualToPhysical(), and AddressDataBus::WriteData().

Member Data Documentation

◆ m_addressDataBus

AddressDataBus* CPUComponent::m_addressDataBus
protected

◆ m_addressSelect

uint64_t CPUComponent::m_addressSelect
protected

Definition at line 230 of file CPUComponent.h.

Referenced by AddressSelect(), ReadData(), and WriteData().

◆ m_cpuArchitecture

string CPUComponent::m_cpuArchitecture
protected

Definition at line 201 of file CPUComponent.h.

Referenced by CPUComponent().

◆ m_delaySlotTarget

uint64_t CPUComponent::m_delaySlotTarget
protected

◆ m_exceptionOrAbortInDelaySlot

bool CPUComponent::m_exceptionOrAbortInDelaySlot
protected

Definition at line 231 of file CPUComponent.h.

Referenced by CPUDyntransComponent::DyntransToBeTranslatedDone(), and ResetState().

◆ m_frequency

double CPUComponent::m_frequency
protected

◆ m_functionCallTraceDepth

int32_t CPUComponent::m_functionCallTraceDepth
protected

Definition at line 218 of file CPUComponent.h.

Referenced by CPUComponent(), FunctionTraceCall(), FunctionTraceReturn(), and ResetState().

◆ m_hasUsedUnassemble

bool CPUComponent::m_hasUsedUnassemble
protected

Definition at line 210 of file CPUComponent.h.

Referenced by CPUComponent(), ExecuteMethod(), and ResetState().

◆ m_inDelaySlot

bool CPUComponent::m_inDelaySlot
protected

◆ m_isBigEndian

bool CPUComponent::m_isBigEndian
protected

◆ m_lastDumpAddr

uint64_t CPUComponent::m_lastDumpAddr
protected

Definition at line 208 of file CPUComponent.h.

Referenced by CPUComponent(), and ExecuteMethod().

◆ m_lastUnassembleVaddr

uint64_t CPUComponent::m_lastUnassembleVaddr
protected

Definition at line 209 of file CPUComponent.h.

Referenced by CPUComponent(), and ExecuteMethod().

◆ m_nrOfTracedFunctionCalls

int64_t CPUComponent::m_nrOfTracedFunctionCalls
protected

Definition at line 219 of file CPUComponent.h.

Referenced by CPUComponent(), FunctionTraceCall(), and ResetState().

◆ m_pageSize

int CPUComponent::m_pageSize
protected

◆ m_paused

bool CPUComponent::m_paused
protected

Definition at line 198 of file CPUComponent.h.

Referenced by CPUComponent().

◆ m_pc

uint64_t CPUComponent::m_pc
protected

◆ m_showFunctionTraceCall

bool CPUComponent::m_showFunctionTraceCall
protected

Definition at line 216 of file CPUComponent.h.

Referenced by CPUComponent(), DYNTRANS_INSTR(), and CPUDyntransComponent::Execute().

◆ m_showFunctionTraceReturn

bool CPUComponent::m_showFunctionTraceReturn
protected

Definition at line 217 of file CPUComponent.h.

Referenced by CPUComponent(), and FunctionTraceReturn().


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

Generated on Sun Sep 30 2018 16:05:18 for GXemul by doxygen 1.8.13