CIRCT  20.0.0git
Namespaces | Macros | Functions
HandshakeOps.cpp File Reference
#include "circt/Dialect/Handshake/HandshakeOps.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

 circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
 
 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. More...
 
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. More...
 
static bool isControlCheckTypeAndOperand (Type dataType, Value operand)
 
template<typename TMemOp >
llvm::SmallVector< handshake::MemLoadInterfacegetLoadPorts (TMemOp op)
 
template<typename TMemOp >
llvm::SmallVector< handshake::MemStoreInterfacegetStorePorts (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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 1453 of file HandshakeOps.cpp.

Function Documentation

◆ addStringToStringArrayAttr()

static 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 595 of file HandshakeOps.cpp.

◆ defaultOperandName()

static std::string defaultOperandName ( unsigned int  idx)
static

Definition at line 52 of file HandshakeOps.cpp.

◆ getDematerialized()

static 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 300 of file HandshakeOps.cpp.

◆ getFuncOpNames()

static 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 563 of file HandshakeOps.cpp.

◆ getLoadPorts()

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

◆ getMemoryOperandName()

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

Definition at line 952 of file HandshakeOps.cpp.

◆ getMemoryResultName()

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

Definition at line 969 of file HandshakeOps.cpp.

◆ getStorePorts()

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

◆ isControlCheckTypeAndOperand()

static bool isControlCheckTypeAndOperand ( Type  dataType,
Value  operand 
)
static

Definition at line 107 of file HandshakeOps.cpp.

◆ parseForkOp()

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

Definition at line 165 of file HandshakeOps.cpp.

References parseSostOperation().

◆ parseFuncOpArgs()

static 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 547 of file HandshakeOps.cpp.

◆ parseIntInSquareBrackets()

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

Definition at line 56 of file HandshakeOps.cpp.

Referenced by parseSostOperation().

◆ parseMemoryAccessOp()

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

Definition at line 1214 of file HandshakeOps.cpp.

References circt::calyx::direction::get().

◆ parseSostOperation()

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

Definition at line 63 of file HandshakeOps.cpp.

References parseIntInSquareBrackets().

Referenced by parseForkOp().

◆ printMemoryAccessOp()

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

Definition at line 1243 of file HandshakeOps.cpp.

◆ verifyIndexWideEnough()

static 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 83 of file HandshakeOps.cpp.

◆ verifyMemoryAccessOp()

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

Definition at line 1271 of file HandshakeOps.cpp.