OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 
BuslessExecutableMoveoperator= (const BuslessExecutableMove &)
 Assignment not allowed.
 

Additional Inherited Members

- Protected Member Functions inherited from ExecutableMove
 ExecutableMove ()
 
- Protected Attributes inherited from ExecutableMove
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.
 

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}
static NullBusState & instance()
Definition BusState.cc:112

◆ 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());
148}
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.
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.
virtual const SimValue & value() const =0
SLongWord sLongWordValue() const
Definition SimValue.cc:997
virtual void setValue(const SimValue &value)=0

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: