OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ExecutableMove Class Reference

#include <ExecutableMove.hh>

Inheritance diagram for ExecutableMove:
Inheritance graph
Collaboration diagram for ExecutableMove:
Collaboration graph

Public Member Functions

 ExecutableMove (const ReadableState &src, BusState &bus, WritableState &dst)
 
 ExecutableMove (const ReadableState &src, BusState &bus, WritableState &dst, const ReadableState &guardReg, bool negated)
 
 ExecutableMove (InlineImmediateValue *immediateSource, BusState &bus, WritableState &dst, const ReadableState &guardReg, bool negated)
 
 ExecutableMove (InlineImmediateValue *immediateSource, BusState &bus, WritableState &dst)
 
virtual ~ExecutableMove ()
 
virtual void executeRead ()
 
virtual void executeWrite ()
 
virtual void evaluateGuard ()
 
virtual bool squashed () const
 
ClockCycleCount executionCount () const
 
void resetExecutionCount ()
 

Protected Member Functions

 ExecutableMove ()
 

Protected Attributes

const ReadableStatesrc_
 Source of the move.
 
BusStatebus_
 Bus of the move.
 
WritableStatedst_
 Destination of the move.
 
const ReadableStateguardReg_
 Guard of the move.
 
const bool guarded_
 True if this is a guarded move.
 
const bool negated_
 True if guard is inverted.
 
ClockCycleCount executionCount_
 The count of times this move has been fully executed (without squash).
 
bool squashed_
 True in case this move was squashed last time it was executed.
 

Private Member Functions

 ExecutableMove (const ExecutableMove &)
 Copying not allowed.
 
ExecutableMoveoperator= (const ExecutableMove &)
 Assignment not allowed.
 

Private Attributes

InlineImmediateValueinlineImmediate_
 If the move source is an inline immediate, the instance is stored here so it can be deleted in the destructor.
 

Detailed Description

Represents an interpreted move.

Interpreted means that source and destination of the move are already resolved.

Definition at line 52 of file ExecutableMove.hh.

Constructor & Destructor Documentation

◆ ExecutableMove() [1/6]

ExecutableMove::ExecutableMove ( const ReadableState src,
BusState bus,
WritableState dst 
)

Constructor.

Parameters
srcSource of the move.
busBus of the move.
dstDestination of the move.

Definition at line 53 of file ExecutableMove.cc.

56 :
57 src_(&src), bus_(&bus), dst_(&dst),
58 guardReg_(NULL), guarded_(false), negated_(false),
59 executionCount_(0), squashed_(false),
60 inlineImmediate_(NULL) {
61}
WritableState * dst_
Destination of the move.
const ReadableState * src_
Source of the move.
const ReadableState * guardReg_
Guard of the move.
const bool negated_
True if guard is inverted.
BusState * bus_
Bus of the move.
InlineImmediateValue * inlineImmediate_
If the move source is an inline immediate, the instance is stored here so it can be deleted in the de...
ClockCycleCount executionCount_
The count of times this move has been fully executed (without squash).
bool squashed_
True in case this move was squashed last time it was executed.
const bool guarded_
True if this is a guarded move.

◆ ExecutableMove() [2/6]

ExecutableMove::ExecutableMove ( const ReadableState src,
BusState bus,
WritableState dst,
const ReadableState guardReg,
bool  negated 
)

Constructor.

Parameters
srcSource of the move.
busBus of the move.
dstDestination of the move.
guardRegGuard register.
negatedTrue if guard is reversed.

Definition at line 72 of file ExecutableMove.cc.

77 :
78 src_(&src), bus_(&bus), dst_(&dst), guardReg_(&guardReg),
79 guarded_(true), negated_(negated),
80 executionCount_(0), squashed_(false),
81 inlineImmediate_(NULL) {
82}

◆ ExecutableMove() [3/6]

ExecutableMove::ExecutableMove ( InlineImmediateValue immediateSource,
BusState bus,
WritableState dst,
const ReadableState guardReg,
bool  negated 
)

Constructor.

Used to construct a move that has an inline immediate as the source. The inline immediate becomes property of the created ExecutableMove and is deleted by it.

Parameters
immediateSourceThe inline immediate source of the move.
busBus of the move.
dstDestination of the move.
guardRegGuard register.
negatedTrue if guard is reversed.

Definition at line 97 of file ExecutableMove.cc.

102 :
103 src_(immediateSource), bus_(&bus), dst_(&dst), guardReg_(&guardReg),
104 guarded_(true), negated_(negated),
105 executionCount_(0), squashed_(false),
106 inlineImmediate_(immediateSource) {
107}

◆ ExecutableMove() [4/6]

ExecutableMove::ExecutableMove ( InlineImmediateValue immediateSource,
BusState bus,
WritableState dst 
)

Constructor.

Used to construct a move that has an inline immediate as the source. The inline immediate becomes property of the created ExecutableMove and is deleted by it.

Parameters
immediateSourceThe inline immediate source of the move.
busBus of the move.
dstDestination of the move.
guardRegGuard register.
negatedTrue if guard is reversed.

Definition at line 122 of file ExecutableMove.cc.

125 :
126 src_(immediateSource), bus_(&bus), dst_(&dst),
127 guardReg_(NULL), guarded_(false), negated_(false),
128 executionCount_(0), squashed_(false),
129 inlineImmediate_(immediateSource) {
130}

◆ ~ExecutableMove()

ExecutableMove::~ExecutableMove ( )
virtual

Destructor.

Definition at line 136 of file ExecutableMove.cc.

136 {
137 delete inlineImmediate_;
138 inlineImmediate_ = NULL;
139}

References inlineImmediate_.

◆ ExecutableMove() [5/6]

ExecutableMove::ExecutableMove ( )
protected

A dummy constructor for being used with DummyExecutableMove

Definition at line 228 of file ExecutableMove.cc.

228 :
229 src_(0),
231 dst_(0),
232 guarded_(false),
233 negated_(false) {
234 inlineImmediate_ = NULL;
235}
static NullBusState & instance()
Definition BusState.cc:112

References inlineImmediate_.

◆ ExecutableMove() [6/6]

ExecutableMove::ExecutableMove ( const ExecutableMove )
private

Copying not allowed.

Member Function Documentation

◆ evaluateGuard()

void ExecutableMove::evaluateGuard ( )
virtual

Evaluates the possible guard of the move, i.e., decides whether the move is squashed at the simulated cycle or not.

This must be called by the ExecutableInstruction before any executeRead()/executeWrite() is called in order not to overwrite the old guard value in case of the default 1-latency guards.

Definition at line 150 of file ExecutableMove.cc.

150 {
151 if (guarded_) {
152 const SimValue& regValue = guardReg_->value();
153 const bool guardTerm = (regValue.sIntWordValue() & 1) == 1;
154 squashed_ = !((!negated_ && guardTerm) ||
155 ( negated_ && !guardTerm));
157 } else {
158 bus_->setSquashed(false);
159 }
160}
void setSquashed(bool isSquashed)
Definition BusState.cc:78
virtual const SimValue & value() const =0
SIntWord sIntWordValue() const
Definition SimValue.cc:944

References bus_, guarded_, guardReg_, negated_, BusState::setSquashed(), SimValue::sIntWordValue(), squashed_, and ReadableState::value().

Here is the call graph for this function:

◆ executeRead()

void ExecutableMove::executeRead ( )
virtual

Copies the value of the move source to the transport bus.

Reimplemented in BuslessExecutableMove.

Definition at line 166 of file ExecutableMove.cc.

166 {
167
169 return;
171}
const bool GUARD_BLOCKS_BUS_WRITE
void setValueInlined(const SimValue &value)

References bus_, GUARD_BLOCKS_BUS_WRITE, guarded_, BusState::setValueInlined(), squashed_, src_, and ReadableState::value().

Here is the call graph for this function:

◆ executeWrite()

void ExecutableMove::executeWrite ( )
virtual

Writes the value of the bus to the destination.

If the move is guarded, the value is written to destination only if guard expression is true.

Reimplemented in BuslessExecutableMove.

Definition at line 181 of file ExecutableMove.cc.

181 {
182
183 if (guarded_ && squashed_)
184 return;
185
186 dst_->setValue(bus_->value());
188}
virtual const SimValue & value() const
virtual void setValue(const SimValue &value)=0

References bus_, dst_, executionCount_, guarded_, WritableState::setValue(), squashed_, and RegisterState::value().

Here is the call graph for this function:

◆ executionCount()

ClockCycleCount ExecutableMove::executionCount ( ) const

Returns the count of executions of this move.

This count does not include squashed executions.

Returns
Count of executions of this move.

Definition at line 206 of file ExecutableMove.cc.

206 {
207 return executionCount_;
208}

References executionCount_.

Referenced by DummyExecutableMove::DummyExecutableMove().

◆ operator=()

ExecutableMove & ExecutableMove::operator= ( const ExecutableMove )
private

Assignment not allowed.

◆ resetExecutionCount()

void ExecutableMove::resetExecutionCount ( )

Resets the execution counter of this move.

Definition at line 194 of file ExecutableMove.cc.

194 {
195 executionCount_ = 0;
196}

References executionCount_.

◆ squashed()

bool ExecutableMove::squashed ( ) const
inlinevirtual

Returns true in case move with the move was squashed the last time the instruction was executed.

Being squashed means that the move is guarded and the guard expression evaluated to false.

Returns
True in case move was squashed last time its instruction was executed.

Definition at line 221 of file ExecutableMove.cc.

221 {
222 return squashed_;
223}

References squashed_.

Member Data Documentation

◆ bus_

BusState* ExecutableMove::bus_
protected

Bus of the move.

Definition at line 94 of file ExecutableMove.hh.

Referenced by evaluateGuard(), executeRead(), and executeWrite().

◆ dst_

WritableState* ExecutableMove::dst_
protected

Destination of the move.

Definition at line 96 of file ExecutableMove.hh.

Referenced by BuslessExecutableMove::executeWrite(), and executeWrite().

◆ executionCount_

ClockCycleCount ExecutableMove::executionCount_
protected

The count of times this move has been fully executed (without squash).

Definition at line 104 of file ExecutableMove.hh.

Referenced by DummyExecutableMove::DummyExecutableMove(), BuslessExecutableMove::executeWrite(), executeWrite(), executionCount(), and resetExecutionCount().

◆ guarded_

const bool ExecutableMove::guarded_
protected

True if this is a guarded move.

Definition at line 100 of file ExecutableMove.hh.

Referenced by evaluateGuard(), executeRead(), BuslessExecutableMove::executeWrite(), and executeWrite().

◆ guardReg_

const ReadableState* ExecutableMove::guardReg_
protected

Guard of the move.

Definition at line 98 of file ExecutableMove.hh.

Referenced by evaluateGuard(), and BuslessExecutableMove::executeWrite().

◆ inlineImmediate_

InlineImmediateValue* ExecutableMove::inlineImmediate_
private

If the move source is an inline immediate, the instance is stored here so it can be deleted in the destructor.

Definition at line 115 of file ExecutableMove.hh.

Referenced by ExecutableMove(), and ~ExecutableMove().

◆ negated_

const bool ExecutableMove::negated_
protected

True if guard is inverted.

Definition at line 102 of file ExecutableMove.hh.

Referenced by evaluateGuard(), and BuslessExecutableMove::executeWrite().

◆ squashed_

bool ExecutableMove::squashed_
protected

True in case this move was squashed last time it was executed.

Definition at line 106 of file ExecutableMove.hh.

Referenced by evaluateGuard(), executeRead(), BuslessExecutableMove::executeWrite(), executeWrite(), and squashed().

◆ src_

const ReadableState* ExecutableMove::src_
protected

Source of the move.

Definition at line 92 of file ExecutableMove.hh.

Referenced by executeRead(), and BuslessExecutableMove::executeWrite().


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