orca-sim
|
This class implements the base operation for generic processor implementations. More...
#include <ProcessorBase.hpp>
Public Member Functions | |
ProcessorBase (std::string name, MemoryAddr initial_pc, Memory *mem) | |
Default constructor. More... | |
~ProcessorBase () | |
Destructor. More... | |
virtual SimulationTime | Run ()=0 |
Run method from the base TimedModel class, overloaded. More... | |
ProcessorState< T > * | GetState () |
This method returns the state model of the processor. More... | |
Memory * | GetMemory () |
This method returns a pointer to the object that models the memory core. More... | |
virtual void | Reset ()=0 |
Resets the instance to its starting state. More... | |
a name that identifies the model, advisably not empty. | |
Default ctor. | |
std::string | GetName () |
Getter method for the <_name> field. More... | |
void | SetName (std::string s) |
Setter method for the <_name> field. More... | |
Private Attributes | |
struct ProcessorState< T > | _state |
struct that represent the state of a processor. More... | |
Memory * | _memory |
We assume that every processor is attached to a memory core. More... | |
This class implements the base operation for generic processor implementations.
This class uses templates to handle the size of internal registers (registers are limited to have the same size)
Definition at line 47 of file ProcessorBase.hpp.
ProcessorBase::ProcessorBase | ( | std::string | name, |
MemoryAddr | initial_pc, | ||
Memory * | mem | ||
) |
Default constructor.
name | A short name or description of the instance |
initial_pc | Memory address to which the PC register will point to at the startup. |
Definition at line 41 of file ProcessorBase.cpp.
ProcessorBase::~ProcessorBase | ( | ) |
Destructor.
Definition at line 70 of file ProcessorBase.cpp.
|
inline |
This method returns a pointer to the object that models the memory core.
It is made private to avoid being changed by the processor core implementation.
Definition at line 86 of file ProcessorBase.cpp.
|
inherited |
|
inline |
This method returns the state model of the processor.
Access the current state of the processor.
This is ideally used from the top level simulator to report processor states at the end of simulation.
Definition at line 81 of file ProcessorBase.cpp.
|
pure virtualinherited |
Resets the instance to its starting state.
Must be implemented by subclasses
Implemented in orcasim::models::orca::NetBridge, orcasim::models::orca::DmaNetif, and orcasim::models::hermes::HermesRouter.
|
pure virtual |
Run method from the base TimedModel class, overloaded.
We include in the overloading external components that would apply to all processors. Examples include energy estimation (through counters) and GDBRSP.
Implements orcasim::base::TimedModel.
Implemented in orcasim::models::hfriscv::HFRiscV, and orcasim::gdbrsp::GdbProcessorBase< T >.
Definition at line 91 of file ProcessorBase.cpp.
|
inherited |
|
private |
We assume that every processor is attached to a memory core.
For now, the only core available is untimed.
Definition at line 58 of file ProcessorBase.hpp.
|
private |
struct that represent the state of a processor.
All processor share the same state model, which permit us to implement features such as the GDB's remote debug server.
Definition at line 53 of file ProcessorBase.hpp.