OpenASIP  2.0
Public Member Functions | Public Attributes | List of all members
ExecutingOperation::PendingResult Struct Reference

#include <ExecutingOperation.hh>

Collaboration diagram for ExecutingOperation::PendingResult:
Collaboration graph

Public Member Functions

 PendingResult (SimValue &result, PortState &targetPort, int latency)
 
void advanceCycle ()
 
void reset ()
 

Public Attributes

SimValueresult_
 The value that will be written to the target after the latency has passed. More...
 
PortStatetarget_
 The target port to which the result will be written after the latency. More...
 
int cyclesToGo_
 How many cycles to wait until the result will be written to the target. More...
 
int resultLatency_
 

Detailed Description

Models the latency of an operation result.

This is used to make results visible in the output ports of the FU at the correct time.

Definition at line 90 of file ExecutingOperation.hh.

Constructor & Destructor Documentation

◆ PendingResult()

ExecutingOperation::PendingResult::PendingResult ( SimValue result,
PortState targetPort,
int  latency 
)
inline

Definition at line 91 of file ExecutingOperation.hh.

91  :
92  result_(&result), target_(&targetPort), cyclesToGo_(latency),
93  resultLatency_(latency) {
94  }

Member Function Documentation

◆ advanceCycle()

void ExecutingOperation::PendingResult::advanceCycle ( )

Signals a cycle advance.

Makes the result visible to the output port in time.

Definition at line 89 of file ExecutingOperation.cc.

89  {
90  if (--cyclesToGo_ == 0) {
92  cyclesToGo_ = INT_MAX;
93  }
94 }

References cyclesToGo_, result_, RegisterState::setValue(), and target_.

Here is the call graph for this function:

◆ reset()

void ExecutingOperation::PendingResult::reset ( )

Definition at line 97 of file ExecutingOperation.cc.

97  {
99 }

Member Data Documentation

◆ cyclesToGo_

int ExecutingOperation::PendingResult::cyclesToGo_

How many cycles to wait until the result will be written to the target.

Definition at line 112 of file ExecutingOperation.hh.

Referenced by advanceCycle().

◆ result_

SimValue* ExecutingOperation::PendingResult::result_

The value that will be written to the target after the latency has passed.

Definition at line 106 of file ExecutingOperation.hh.

Referenced by advanceCycle().

◆ resultLatency_

int ExecutingOperation::PendingResult::resultLatency_

Definition at line 113 of file ExecutingOperation.hh.

◆ target_

PortState* ExecutingOperation::PendingResult::target_

The target port to which the result will be written after the latency.

Definition at line 109 of file ExecutingOperation.hh.

Referenced by advanceCycle().


The documentation for this struct was generated from the following files:
ExecutingOperation::PendingResult::resultLatency_
int resultLatency_
Definition: ExecutingOperation.hh:113
ExecutingOperation::PendingResult::cyclesToGo_
int cyclesToGo_
How many cycles to wait until the result will be written to the target.
Definition: ExecutingOperation.hh:112
ExecutingOperation::PendingResult::target_
PortState * target_
The target port to which the result will be written after the latency.
Definition: ExecutingOperation.hh:109
ExecutingOperation::PendingResult::result_
SimValue * result_
The value that will be written to the target after the latency has passed.
Definition: ExecutingOperation.hh:106
RegisterState::setValue
virtual void setValue(const SimValue &value)
Definition: RegisterState.cc:80