Jlm
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
jlm::hls::ForkOperation Class Referencefinal

#include <hls.hpp>

Inheritance diagram for jlm::hls::ForkOperation:
Inheritance graph
[legend]
Collaboration diagram for jlm::hls::ForkOperation:
Collaboration graph
[legend]

Public Member Functions

 ~ForkOperation () noexcept override
 
 ForkOperation (size_t nalternatives, const std::shared_ptr< const jlm::rvsdg::Type > &type)
 
 ForkOperation (size_t nalternatives, const std::shared_ptr< const jlm::rvsdg::Type > &type, bool isConstant)
 
bool operator== (const Operation &other) const noexcept override
 
std::string debug_string () const override
 
std::unique_ptr< Operationcopy () const override
 
bool IsConstant () const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::SimpleOperation
 ~SimpleOperation () noexcept override
 
 SimpleOperation (std::vector< std::shared_ptr< const jlm::rvsdg::Type >> operands, std::vector< std::shared_ptr< const jlm::rvsdg::Type >> results)
 
size_t narguments () const noexcept
 
const std::shared_ptr< const rvsdg::Type > & argument (size_t index) const noexcept
 
size_t nresults () const noexcept
 
const std::shared_ptr< const rvsdg::Type > & result (size_t index) const noexcept
 
- Public Member Functions inherited from jlm::rvsdg::Operation
virtual ~Operation () noexcept
 
bool operator!= (const Operation &other) const noexcept
 

Static Public Member Functions

static std::vector< jlm::rvsdg::Output * > create (size_t nalternatives, jlm::rvsdg::Output &value, bool isConstant=false)
 
static rvsdg::NodeCreateNode (const size_t numResults, rvsdg::Output &operand, const bool isConstant=false)
 

Private Attributes

bool IsConstant_ = false
 

Detailed Description

Forks ensures 1-to-1 connections between producers and consumers, i.e., they handle fanout of signals. Normal forks have a register inside to ensure that a token consumed on one output is not repeated. The fork only creates an acknowledge on its single input once all outputs have been consumed.

CFORK (constant fork): Handles the special case when the same constant is used as input for multiple nodes. It would be possible to have a constant for each input, but deduplication replaces the constants with a single constant fork. Since the input of the fork is always the same value and is always valid. No handshaking is necessary and the outputs of the fork is always valid.

Definition at line 96 of file hls.hpp.

Constructor & Destructor Documentation

◆ ~ForkOperation()

jlm::hls::ForkOperation::~ForkOperation ( )
overridedefaultnoexcept

◆ ForkOperation() [1/2]

jlm::hls::ForkOperation::ForkOperation ( size_t  nalternatives,
const std::shared_ptr< const jlm::rvsdg::Type > &  type 
)
inline

Create a fork operation that is not a constant fork.

/param nalternatives Number of outputs. /param value The signal type, which is the same for the input and all outputs.

Definition at line 107 of file hls.hpp.

◆ ForkOperation() [2/2]

jlm::hls::ForkOperation::ForkOperation ( size_t  nalternatives,
const std::shared_ptr< const jlm::rvsdg::Type > &  type,
bool  isConstant 
)
inline

Create a fork operation.

/param nalternatives Number of outputs. /param value The signal type, which is the same for the input and all outputs. /param isConstant If true, the fork is a constant fork.

Definition at line 118 of file hls.hpp.

Member Function Documentation

◆ copy()

std::unique_ptr<Operation> jlm::hls::ForkOperation::copy ( ) const
inlineoverridevirtual

Implements jlm::rvsdg::Operation.

Definition at line 146 of file hls.hpp.

◆ create()

static std::vector<jlm::rvsdg::Output *> jlm::hls::ForkOperation::create ( size_t  nalternatives,
jlm::rvsdg::Output value,
bool  isConstant = false 
)
inlinestatic

Create a fork operation with a single input and multiple outputs.

/param nalternatives Number of outputs. /param value The signal type, which is the same for the input and all outputs. /param isConstant If true, the fork is a constant fork.

/return A vector of outputs.

Definition at line 161 of file hls.hpp.

◆ CreateNode()

static rvsdg::Node& jlm::hls::ForkOperation::CreateNode ( const size_t  numResults,
rvsdg::Output operand,
const bool  isConstant = false 
)
inlinestatic

Create a ForkOperation node.

Parameters
numResultsNumber of outputs.
operandThe node's operand
isConstantIf true, the ForkOperation is a constant fork.
Returns
A ForkOperation node.

Definition at line 177 of file hls.hpp.

◆ debug_string()

std::string jlm::hls::ForkOperation::debug_string ( ) const
inlineoverridevirtual

Debug string for the fork operation. /return HLS_CFORK if the fork is a constant fork, else HLS_FORK.

Implements jlm::rvsdg::Operation.

Definition at line 140 of file hls.hpp.

◆ IsConstant()

bool jlm::hls::ForkOperation::IsConstant ( ) const
inlinenoexcept

Check if a fork is a constant fork (CFORK).

/return True if the fork is a constant fork, i.e., the input of the fork is a constant, else false.

Definition at line 189 of file hls.hpp.

◆ operator==()

bool jlm::hls::ForkOperation::operator== ( const Operation other) const
inlineoverridevirtualnoexcept

Implements jlm::rvsdg::Operation.

Definition at line 127 of file hls.hpp.

Member Data Documentation

◆ IsConstant_

bool jlm::hls::ForkOperation::IsConstant_ = false
private

Definition at line 195 of file hls.hpp.


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