OpenASIP
2.0
|
#include <LongImmediateUnitState.hh>
Classes | |
struct | Item |
Public Member Functions | |
LongImmediateUnitState (int size, int latency, const std::string &name, int width, bool signExtend) | |
virtual | ~LongImmediateUnitState () |
virtual SimValue & | registerValue (int index) |
virtual void | setRegisterValue (int index, const SimValue &value) |
virtual LongImmediateRegisterState & | immediateRegister (int i) |
virtual int | immediateRegisterCount () const |
virtual void | endClock () |
virtual void | advanceClock () |
Public Member Functions inherited from ClockedState | |
ClockedState () | |
virtual | ~ClockedState () |
virtual void | reset () |
this is called at (re)initialization of the simulation More... | |
Private Types | |
typedef std::queue< Item > | ItemQueue |
typedef std::vector< LongImmediateRegisterState * > | RegisterContainer |
typedef std::vector< SimValue > | ValueContainer |
Private Member Functions | |
LongImmediateUnitState (const LongImmediateUnitState &) | |
Copying not allowed. More... | |
LongImmediateUnitState & | operator= (const LongImmediateUnitState &) |
Assignment not allowed. More... | |
void | clear () |
Private Attributes | |
int | latency_ |
Latency of LongImmediateUnit. More... | |
std::string | name_ |
Name of the unit. More... | |
ItemQueue | queue_ |
Queue of register value update requests. More... | |
RegisterContainer | registers_ |
Contains all long immediate registers of the unit. More... | |
ValueContainer | values_ |
Contains all values of the registers. More... | |
unsigned | timer_ = 0 |
Counter to time arrival of immediate values. Note: value is expected to wrap. More... | |
Class that represents the states of long immediate units.
Definition at line 55 of file LongImmediateUnitState.hh.
|
private |
Definition at line 101 of file LongImmediateUnitState.hh.
|
private |
Definition at line 102 of file LongImmediateUnitState.hh.
|
private |
Definition at line 103 of file LongImmediateUnitState.hh.
LongImmediateUnitState::LongImmediateUnitState | ( | int | size, |
int | latency, | ||
const std::string & | name, | ||
int | width, | ||
bool | signExtend | ||
) |
Constructor.
size | Size of the unit. |
latency | Latency of the unit. |
name | Name of the unit. |
width | The bit width of the registers in the unit. |
signExtend | Whether the values written to the registers should be sign extended. |
Definition at line 58 of file LongImmediateUnitState.cc.
References registers_, and values_.
|
virtual |
Destructor.
Definition at line 77 of file LongImmediateUnitState.cc.
References clear().
|
private |
Copying not allowed.
|
virtual |
Advances clock by one cycle.
Register values are updated. This method is used to simulate the latency of the immediate unit state: register values are not updated immediately in case the latency is greater than zero.
Implements ClockedState.
Reimplemented in NullLongImmediateUnitState.
Definition at line 144 of file LongImmediateUnitState.cc.
|
private |
Clears the containers.
Definition at line 85 of file LongImmediateUnitState.cc.
References SequenceTools::deleteAllItems(), registers_, and values_.
Referenced by ~LongImmediateUnitState().
|
virtual |
End of clock cycle.
Nothing is done.
Implements ClockedState.
Reimplemented in NullLongImmediateUnitState.
Definition at line 133 of file LongImmediateUnitState.cc.
|
virtual |
Returns the register of the given index.
index | Index of the register. |
OutOfRange | If index is out of range. |
Reimplemented in NullLongImmediateUnitState.
Definition at line 160 of file LongImmediateUnitState.cc.
References __func__, and registers_.
Referenced by ProximRegisterWindow::loadImmediateUnit(), SimProgramBuilder::processInstruction(), and SimProgramBuilder::processSourceTerminal().
|
virtual |
Returns the count of the registers in the unit.
Reimplemented in NullLongImmediateUnitState.
Definition at line 174 of file LongImmediateUnitState.cc.
References registers_.
Referenced by ProximIUDetailsCmd::Do(), and ProximRegisterWindow::loadImmediateUnit().
|
private |
Assignment not allowed.
|
virtual |
Returns the register value of the given index.
index | Index of the register. |
OutOfRange | If index is out of range. |
Reimplemented in NullLongImmediateUnitState.
Definition at line 98 of file LongImmediateUnitState.cc.
References __func__, and values_.
Referenced by ProximIUDetailsCmd::Do(), and LongImmediateRegisterState::value().
|
virtual |
Sets the register value.
index | Index of the register. |
value | Value to be set. |
OutOfRange | If index is out of range. |
Reimplemented in NullLongImmediateUnitState.
Definition at line 114 of file LongImmediateUnitState.cc.
References __func__, latency_, queue_, timer_, and values_.
Referenced by LongImmediateRegisterState::setValue().
|
private |
Latency of LongImmediateUnit.
Definition at line 106 of file LongImmediateUnitState.hh.
Referenced by setRegisterValue().
|
private |
Name of the unit.
Definition at line 108 of file LongImmediateUnitState.hh.
|
private |
Queue of register value update requests.
Definition at line 110 of file LongImmediateUnitState.hh.
Referenced by advanceClock(), and setRegisterValue().
|
private |
Contains all long immediate registers of the unit.
Definition at line 112 of file LongImmediateUnitState.hh.
Referenced by clear(), immediateRegister(), immediateRegisterCount(), and LongImmediateUnitState().
|
private |
Counter to time arrival of immediate values. Note: value is expected to wrap.
Definition at line 117 of file LongImmediateUnitState.hh.
Referenced by advanceClock(), and setRegisterValue().
|
private |
Contains all values of the registers.
Definition at line 114 of file LongImmediateUnitState.hh.
Referenced by advanceClock(), clear(), LongImmediateUnitState(), registerValue(), and setRegisterValue().