CIRCT 24.0.0git
Loading...
Searching...
No Matches
HandshakeOps.cpp File Reference
#include "circt/Dialect/Handshake/HandshakeOps.h"
#include "circt/Dialect/ESI/ESITypes.h"
#include "circt/Support/LLVM.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/IntegerSet.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/SymbolTable.h"
#include "mlir/IR/Value.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "mlir/Transforms/InliningUtils.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/TypeSwitch.h"
#include <set>
#include "circt/Dialect/Handshake/HandshakeCanonicalization.h.inc"
#include "circt/Dialect/Handshake/Handshake.cpp.inc"
Include dependency graph for HandshakeOps.cpp:

Go to the source code of this file.

Namespaces

namespace  circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
namespace  circt::handshake

Macros

#define GET_OP_CLASSES

Functions

bool circt::handshake::isControlOpImpl (Operation *op)
 Default implementation for checking whether an operation is a control operation.
static std::string defaultOperandName (unsigned int idx)
static ParseResult parseIntInSquareBrackets (OpAsmParser &parser, int &v)
static ParseResult parseSostOperation (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &operands, OperationState &result, int &size, Type &type, bool explicitSize)
static LogicalResult verifyIndexWideEnough (Operation *op, Value indexVal, uint64_t numOperands)
 Verifies whether an indexing value is wide enough to index into a provided number of operands.
static bool isControlCheckTypeAndOperand (Type dataType, Value operand)
template<typename TMemOp>
llvm::SmallVector< handshake::MemLoadInterface > getLoadPorts (TMemOp op)
template<typename TMemOp>
llvm::SmallVector< handshake::MemStoreInterface > getStorePorts (TMemOp op)
static ParseResult parseForkOp (OpAsmParser &parser, OperationState &result)
static Value getDematerialized (Value v)
 Returns a dematerialized version of the value 'v', defined as the source of the value before passing through a buffer or fork operation.
static ParseResult parseFuncOpArgs (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::Argument > &entryArgs, SmallVectorImpl< Type > &resTypes, SmallVectorImpl< DictionaryAttr > &resAttrs)
 Parses a FuncOp signature using mlir::function_interface_impl::parseFunctionSignature while getting access to the parsed SSA names to store as attributes.
static SmallVector< Attribute > getFuncOpNames (Builder &builder, unsigned cnt, StringRef prefix)
 Generates names for a handshake.func input and output arguments, based on the number of args as well as a prefix.
static void addStringToStringArrayAttr (Builder &builder, Operation *op, StringRef attrName, StringAttr str)
 Helper function for appending a string to an array attribute, and rewriting the attribute back to the operation.
static std::string getMemoryOperandName (unsigned nStores, unsigned idx)
static std::string getMemoryResultName (unsigned nLoads, unsigned nStores, unsigned idx)
static ParseResult parseMemoryAccessOp (OpAsmParser &parser, OperationState &result)
template<typename MemOp>
static void printMemoryAccessOp (OpAsmPrinter &p, MemOp op)
template<typename TMemoryOp>
static LogicalResult verifyMemoryAccessOp (TMemoryOp op)

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 1504 of file HandshakeOps.cpp.

Function Documentation

◆ addStringToStringArrayAttr()

void addStringToStringArrayAttr ( Builder & builder,
Operation * op,
StringRef attrName,
StringAttr str )
static

Helper function for appending a string to an array attribute, and rewriting the attribute back to the operation.

Definition at line 596 of file HandshakeOps.cpp.

References attrs.

◆ defaultOperandName()

std::string defaultOperandName ( unsigned int idx)
static

Definition at line 53 of file HandshakeOps.cpp.

◆ getDematerialized()

Value getDematerialized ( Value v)
static

Returns a dematerialized version of the value 'v', defined as the source of the value before passing through a buffer or fork operation.

Definition at line 302 of file HandshakeOps.cpp.

References getDematerialized().

Referenced by getDematerialized().

◆ getFuncOpNames()

SmallVector< Attribute > getFuncOpNames ( Builder & builder,
unsigned cnt,
StringRef prefix )
static

Generates names for a handshake.func input and output arguments, based on the number of args as well as a prefix.

Definition at line 564 of file HandshakeOps.cpp.

◆ getLoadPorts()

template<typename TMemOp>
llvm::SmallVector< handshake::MemLoadInterface > getLoadPorts ( TMemOp op)

◆ getMemoryOperandName()

std::string getMemoryOperandName ( unsigned nStores,
unsigned idx )
static

Definition at line 953 of file HandshakeOps.cpp.

◆ getMemoryResultName()

std::string getMemoryResultName ( unsigned nLoads,
unsigned nStores,
unsigned idx )
static

Definition at line 970 of file HandshakeOps.cpp.

◆ getStorePorts()

template<typename TMemOp>
llvm::SmallVector< handshake::MemStoreInterface > getStorePorts ( TMemOp op)

◆ isControlCheckTypeAndOperand()

bool isControlCheckTypeAndOperand ( Type dataType,
Value operand )
static

Definition at line 108 of file HandshakeOps.cpp.

◆ parseForkOp()

ParseResult parseForkOp ( OpAsmParser & parser,
OperationState & result )
static

Definition at line 166 of file HandshakeOps.cpp.

References failure(), parseSostOperation(), and success().

◆ parseFuncOpArgs()

ParseResult parseFuncOpArgs ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::Argument > & entryArgs,
SmallVectorImpl< Type > & resTypes,
SmallVectorImpl< DictionaryAttr > & resAttrs )
static

Parses a FuncOp signature using mlir::function_interface_impl::parseFunctionSignature while getting access to the parsed SSA names to store as attributes.

Definition at line 548 of file HandshakeOps.cpp.

References failure(), and success().

◆ parseIntInSquareBrackets()

ParseResult parseIntInSquareBrackets ( OpAsmParser & parser,
int & v )
static

Definition at line 57 of file HandshakeOps.cpp.

References failure(), and success().

Referenced by parseSostOperation().

◆ parseMemoryAccessOp()

ParseResult parseMemoryAccessOp ( OpAsmParser & parser,
OperationState & result )
static

Definition at line 1215 of file HandshakeOps.cpp.

References failure(), and success().

◆ parseSostOperation()

ParseResult parseSostOperation ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & operands,
OperationState & result,
int & size,
Type & type,
bool explicitSize )
static

Definition at line 64 of file HandshakeOps.cpp.

References failure(), parseIntInSquareBrackets(), and success().

Referenced by parseForkOp().

◆ printMemoryAccessOp()

template<typename MemOp>
void printMemoryAccessOp ( OpAsmPrinter & p,
MemOp op )
static

Definition at line 1244 of file HandshakeOps.cpp.

◆ verifyIndexWideEnough()

LogicalResult verifyIndexWideEnough ( Operation * op,
Value indexVal,
uint64_t numOperands )
static

Verifies whether an indexing value is wide enough to index into a provided number of operands.

Definition at line 84 of file HandshakeOps.cpp.

References success().

◆ verifyMemoryAccessOp()

template<typename TMemoryOp>
LogicalResult verifyMemoryAccessOp ( TMemoryOp op)
static

Definition at line 1272 of file HandshakeOps.cpp.

References success().