OpenASIP
2.0
|
#include <GCUState.hh>
Public Member Functions | |
GCUState (int latency, int nww, int cuDelaySlots, int instructionAddressIncrement=1) | |
virtual | ~GCUState () |
InstructionAddress & | programCounter () |
SimValue & | returnAddressRegister () |
void | setProgramCounter (const InstructionAddress &value) |
void | setReturnAddress (const InstructionAddress &value) |
void | setReturnAddress () |
virtual void | advanceClock () |
virtual void | reset () |
this is called at (re)initialization of the simulation More... | |
virtual OperationContext & | context () |
Public Member Functions inherited from FUState | |
FUState () | |
FUState (const TCEString &name) | |
virtual | ~FUState () |
void | setTriggered () |
void | setOperation (Operation &operation) |
void | setOperation (Operation &operation, OperationExecutor &executor) |
bool | isIdle () |
virtual void | endClock () |
virtual void | addInputPortState (PortState &port) |
virtual void | addOutputPortState (PortState &port) |
virtual void | addOperationExecutor (OperationExecutor &opExec, Operation &op) |
virtual void | setOperationSimulator (DetailedOperationSimulator &sim) |
virtual void | replaceOperationExecutor (Operation &op, OperationExecutor *newExecutor) |
virtual OperationExecutor * | executor (Operation &op) |
Public Member Functions inherited from ClockedState | |
ClockedState () | |
virtual | ~ClockedState () |
Private Member Functions | |
GCUState (const GCUState &) | |
Copying not allowed. More... | |
GCUState & | operator= (const GCUState &) |
Assignment not allowed. More... | |
Private Attributes | |
int | naturalWordWidth_ |
Natural word width as minimum addressable units. More... | |
SimValue | returnAddressRegister_ |
The return address register. More... | |
InstructionAddress | programCounter_ |
Program counter. More... | |
InstructionAddress | newProgramCounter_ |
In case an control flow operation is pending, this variable contains the program counter value that should be updated when the control stage counter goes down. More... | |
int | latency_ |
The delay of the control flow operations to take place. More... | |
int | branchDelayCycles_ |
The delay of branch operations in the pipeline, as opposed to this unit. More... | |
bool | operationPending_ |
If this this is true, there's a control flow operation pending. More... | |
int | operationPendingTime_ |
This indicates how many cycles the operation has been pending, when this reaches the latency, the PC is updated with the new value. More... | |
OperationContext | operationContext_ |
The operation context for this FU. More... | |
int | instructionAddressIncrement_ = 1 |
The increment to instruction address to retrieve next instruction. More... | |
Additional Inherited Members | |
Protected Attributes inherited from FUState | |
bool | idle_ |
The idle status of the FU. The derived classes should alway set this to true when possible to avoid unnecessary advanceClock() and endClock() calls. More... | |
Models the global control unit state.
Definition at line 46 of file GCUState.hh.
GCUState::GCUState | ( | int | latency, |
int | nww, | ||
int | cuDelaySlots, | ||
int | instructionAddressIncrement = 1 |
||
) |
Constructor.
latency | Latency of the unit. |
nww | Natural word width as MAUs. |
lock | Global lock signal. |
Definition at line 49 of file GCUState.cc.
References reset().
|
virtual |
|
private |
Copying not allowed.
|
virtual |
Handles the actions when clock is advanced.
The value of program counter is updated. Pipeline is advanced.
Reimplemented from FUState.
Definition at line 98 of file GCUState.cc.
References OperationContext::advanceClock(), context(), FUState::idle_, newProgramCounter_, operationPending_, operationPendingTime_, and programCounter_.
Referenced by OTASimulationController::advanceMachineCycle(), and SimulationController::simulateCycle().
|
virtual |
Returns the operation context.
This is basically a "template method" to allow differently initialized OperationContext-classes in FUState subclasses.
Reimplemented from FUState.
Definition at line 88 of file GCUState.cc.
References operationContext_.
Referenced by advanceClock().
InstructionAddress& GCUState::programCounter | ( | ) |
|
virtual |
this is called at (re)initialization of the simulation
Reimplemented from FUState.
Definition at line 65 of file GCUState.cc.
References newProgramCounter_, operationPending_, operationPendingTime_, programCounter_, and returnAddressRegister_.
Referenced by GCUState().
SimValue& GCUState::returnAddressRegister | ( | ) |
Referenced by MachineStateBuilder::buildMachineState().
void GCUState::setProgramCounter | ( | const InstructionAddress & | value | ) |
Referenced by TransportPipeline::startOperation().
void GCUState::setReturnAddress | ( | ) |
void GCUState::setReturnAddress | ( | const InstructionAddress & | value | ) |
Referenced by TransportPipeline::startOperation().
|
private |
The delay of branch operations in the pipeline, as opposed to this unit.
Definition at line 85 of file GCUState.hh.
|
private |
The increment to instruction address to retrieve next instruction.
Definition at line 95 of file GCUState.hh.
|
private |
The delay of the control flow operations to take place.
Definition at line 83 of file GCUState.hh.
|
private |
Natural word width as minimum addressable units.
Definition at line 73 of file GCUState.hh.
|
private |
In case an control flow operation is pending, this variable contains the program counter value that should be updated when the control stage counter goes down.
Definition at line 81 of file GCUState.hh.
Referenced by advanceClock(), and reset().
|
private |
The operation context for this FU.
Definition at line 93 of file GCUState.hh.
Referenced by context().
|
private |
If this this is true, there's a control flow operation pending.
Definition at line 87 of file GCUState.hh.
Referenced by advanceClock(), and reset().
|
private |
This indicates how many cycles the operation has been pending, when this reaches the latency, the PC is updated with the new value.
Definition at line 91 of file GCUState.hh.
Referenced by advanceClock(), and reset().
|
private |
Program counter.
Definition at line 77 of file GCUState.hh.
Referenced by advanceClock(), and reset().
|
private |