OpenASIP  2.0
Public Member Functions | Private Member Functions | List of all members
BuslessExecutableMove Class Reference

#include <BuslessExecutableMove.hh>

Inheritance diagram for BuslessExecutableMove:
Inheritance graph
Collaboration diagram for BuslessExecutableMove:
Collaboration graph

Public Member Functions

 BuslessExecutableMove (const ReadableState &src, WritableState &dst)
 
 BuslessExecutableMove (const ReadableState &src, WritableState &dst, const ReadableState &guardReg, bool negated)
 
 BuslessExecutableMove (InlineImmediateValue *immediateSource, WritableState &dst, const ReadableState &guardReg, bool negated)
 
 BuslessExecutableMove (InlineImmediateValue *immediateSource, WritableState &dst)
 
virtual ~BuslessExecutableMove ()
 
virtual void executeRead ()
 
virtual void executeWrite ()
 
- Public Member Functions inherited from ExecutableMove
 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 evaluateGuard ()
 
virtual bool squashed () const
 
ClockCycleCount executionCount () const
 
void resetExecutionCount ()
 

Private Member Functions

 BuslessExecutableMove (const BuslessExecutableMove &)
 Copying not allowed. More...
 
BuslessExecutableMoveoperator= (const BuslessExecutableMove &)
 Assignment not allowed. More...
 

Additional Inherited Members

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

Detailed Description

Represents an interpreted move which does not utilize a transport bus.

Moves that utilize this class include control unit internal moves such as control flow operations (jump, call) with immediate or RA source. This class can be used also for simulating data transports of sequential code, as writing to (the universal) bus is not necessary in that case.

Definition at line 53 of file BuslessExecutableMove.hh.

Constructor & Destructor Documentation

◆ BuslessExecutableMove() [1/5]

BuslessExecutableMove::BuslessExecutableMove ( const ReadableState src,
WritableState dst 
)

Constructor.

Parameters
srcSource of the move.
dstDestination of the move.

Definition at line 45 of file BuslessExecutableMove.cc.

47  :
49 }

◆ BuslessExecutableMove() [2/5]

BuslessExecutableMove::BuslessExecutableMove ( const ReadableState src,
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 60 of file BuslessExecutableMove.cc.

64  :
65  ExecutableMove(src, NullBusState::instance(), dst, guardReg, negated) {
66 }

◆ BuslessExecutableMove() [3/5]

BuslessExecutableMove::BuslessExecutableMove ( InlineImmediateValue immediateSource,
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 BuslessExecutableMove 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 81 of file BuslessExecutableMove.cc.

85  :
87  immediateSource, NullBusState::instance(), dst, guardReg, negated) {
88 }

◆ BuslessExecutableMove() [4/5]

BuslessExecutableMove::BuslessExecutableMove ( InlineImmediateValue immediateSource,
WritableState dst 
)

Constructor.

Used to construct a move that has an inline immediate as the source. The inline immediate becomes property of the created BuslessExecutableMove 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 103 of file BuslessExecutableMove.cc.

105  :
106  ExecutableMove(immediateSource, NullBusState::instance(), dst) {
107 }

◆ ~BuslessExecutableMove()

BuslessExecutableMove::~BuslessExecutableMove ( )
virtual

Destructor.

Definition at line 113 of file BuslessExecutableMove.cc.

113  {
114 }

◆ BuslessExecutableMove() [5/5]

BuslessExecutableMove::BuslessExecutableMove ( const BuslessExecutableMove )
private

Copying not allowed.

Member Function Documentation

◆ executeRead()

void BuslessExecutableMove::executeRead ( )
virtual

Does not do anything because value is transferred directly from source to destination without writing to a bus first.

Reimplemented from ExecutableMove.

Definition at line 122 of file BuslessExecutableMove.cc.

122  {
123 }

◆ executeWrite()

void BuslessExecutableMove::executeWrite ( )
virtual

Writes the value from source to the destination.

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

Reimplemented from ExecutableMove.

Definition at line 132 of file BuslessExecutableMove.cc.

132  {
133 
134  if (guarded_) {
135  const SimValue& regValue = guardReg_->value();
136  const bool guardTerm = (regValue.sLongWordValue() & 1l) == 1;
137  if (!(( guardTerm && !negated_) ||
138  (!guardTerm && negated_))) {
139  // guard expression evaluated to false
140  squashed_ = true;
141  return;
142  }
143  }
144 
145  squashed_ = false;
146  dst_->setValue(src_->value());
147  executionCount_++;
148 }

References ExecutableMove::dst_, ExecutableMove::executionCount_, ExecutableMove::guarded_, ExecutableMove::guardReg_, ExecutableMove::negated_, WritableState::setValue(), SimValue::sLongWordValue(), ExecutableMove::squashed_, ExecutableMove::src_, and ReadableState::value().

Here is the call graph for this function:

◆ operator=()

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

Assignment not allowed.


The documentation for this class was generated from the following files:
ExecutableMove::ExecutableMove
ExecutableMove()
Definition: ExecutableMove.cc:228
SimValue::sLongWordValue
SLongWord sLongWordValue() const
Definition: SimValue.cc:997
ExecutableMove::dst_
WritableState * dst_
Destination of the move.
Definition: ExecutableMove.hh:96
ExecutableMove::guarded_
const bool guarded_
True if this is a guarded move.
Definition: ExecutableMove.hh:100
ExecutableMove::guardReg_
const ReadableState * guardReg_
Guard of the move.
Definition: ExecutableMove.hh:98
SimValue
Definition: SimValue.hh:96
ExecutableMove::negated_
const bool negated_
True if guard is inverted.
Definition: ExecutableMove.hh:102
NullBusState::instance
static NullBusState & instance()
Definition: BusState.cc:112
ReadableState::value
virtual const SimValue & value() const =0
ExecutableMove::src_
const ReadableState * src_
Source of the move.
Definition: ExecutableMove.hh:92
ExecutableMove::executionCount_
ClockCycleCount executionCount_
The count of times this move has been fully executed (without squash).
Definition: ExecutableMove.hh:104
ExecutableMove::squashed_
bool squashed_
True in case this move was squashed last time it was executed.
Definition: ExecutableMove.hh:106
WritableState::setValue
virtual void setValue(const SimValue &value)=0