CIRCT
18.0.0git
|
#include "circt/Conversion/HandshakeToHW.h"
#include "../PassDetail.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/ESI/ESIOps.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/HWTypes.h"
#include "circt/Dialect/Handshake/HandshakeOps.h"
#include "circt/Dialect/Handshake/HandshakePasses.h"
#include "circt/Dialect/Handshake/Visitor.h"
#include "circt/Dialect/Seq/SeqOps.h"
#include "circt/Support/BackedgeBuilder.h"
#include "circt/Support/ValueMapper.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/MathExtras.h"
#include <optional>
Go to the source code of this file.
Typedefs | |
using | NameUniquer = std::function< std::string(Operation *)> |
using | DiscriminatingTypes = std::pair< SmallVector< Type >, SmallVector< Type > > |
Returns a set of types which may uniquely identify the provided op. More... | |
Functions | |
static std::string | getBareSubModuleName (Operation *oldOp) |
Returns a submodule name resulting from an operation, without discriminating type information. More... | |
static std::string | getCallName (Operation *op) |
static Type | getOperandDataType (Value op) |
Extracts the type of the data-carrying type of opType. More... | |
static SmallVector< Type > | filterNoneTypes (ArrayRef< Type > input) |
Filters NoneType's from the input. More... | |
static DiscriminatingTypes | getHandshakeDiscriminatingTypes (Operation *op) |
static std::string | getTypeName (Location loc, Type type) |
Get type name. More... | |
static std::string | getSubModuleName (Operation *oldOp) |
Construct a name for creating HW sub-module. More... | |
static HWModuleLike | checkSubModuleOp (mlir::ModuleOp parentModule, StringRef modName) |
Check whether a submodule with the same name has been created elsewhere in the top level module. More... | |
static HWModuleLike | checkSubModuleOp (mlir::ModuleOp parentModule, Operation *oldOp) |
static ModulePortInfo | getPortInfoForOp (Operation *op) |
Returns a vector of PortInfo's which defines the HW interface of the to-be-converted op. More... | |
static llvm::SmallVector< hw::detail::FieldInfo > | portToFieldInfo (llvm::ArrayRef< hw::PortInfo > portInfo) |
static LogicalResult | convertExtMemoryOps (HWModuleOp mod) |
static LogicalResult | convertFuncOp (ESITypeConverter &typeConverter, ConversionTarget &target, handshake::FuncOp op, OpBuilder &moduleBuilder) |
using DiscriminatingTypes = std::pair<SmallVector<Type>, SmallVector<Type> > |
Returns a set of types which may uniquely identify the provided op.
Return value is <inputTypes, outputTypes>.
Definition at line 120 of file HandshakeToHW.cpp.
using NameUniquer = std::function<std::string(Operation *)> |
Definition at line 39 of file HandshakeToHW.cpp.
|
static |
Definition at line 260 of file HandshakeToHW.cpp.
References assert(), checkSubModuleOp(), and getSubModuleName().
|
static |
Check whether a submodule with the same name has been created elsewhere in the top level module.
Return the matched module operation if true, otherwise return nullptr.
Definition at line 251 of file HandshakeToHW.cpp.
Referenced by checkSubModuleOp().
|
static |
Definition at line 292 of file HandshakeToHW.cpp.
References circt::hw::ModulePortInfo::eraseInput(), circt::calyx::direction::get(), circt::hw::ModulePortInfo::getInputs(), circt::hw::ModulePortInfo::getOutputs(), Input, inputs, Output, outputs, and portToFieldInfo().
|
static |
Definition at line 1847 of file HandshakeToHW.cpp.
References getCallName().
|
static |
Filters NoneType's from the input.
Definition at line 111 of file HandshakeToHW.cpp.
Referenced by getHandshakeDiscriminatingTypes().
|
static |
Returns a submodule name resulting from an operation, without discriminating type information.
Definition at line 86 of file HandshakeToHW.cpp.
Referenced by getCallName(), and getSubModuleName().
|
static |
Definition at line 95 of file HandshakeToHW.cpp.
References getBareSubModuleName().
Referenced by convertFuncOp().
|
static |
Definition at line 121 of file HandshakeToHW.cpp.
References filterNoneTypes(), and getOperandDataType().
Referenced by getSubModuleName().
|
static |
Extracts the type of the data-carrying type of opType.
If opType is an ESI channel, getHandshakeBundleDataType extracts the data-carrying type, else, assume that opType itself is the data-carrying type.
Definition at line 103 of file HandshakeToHW.cpp.
Referenced by getHandshakeDiscriminatingTypes().
|
static |
Returns a vector of PortInfo's which defines the HW interface of the to-be-converted op.
Definition at line 277 of file HandshakeToHW.cpp.
References circt::handshake::getPortInfoForOpTypes().
|
static |
Construct a name for creating HW sub-module.
Definition at line 169 of file HandshakeToHW.cpp.
References assert(), getBareSubModuleName(), getHandshakeDiscriminatingTypes(), and getTypeName().
Referenced by checkSubModuleOp().
|
static |
Get type name.
Currently we only support integer or index types. The emitted type aligns with the getFIRRTLType() method. Thus all integers other than signed integers will be emitted as unsigned.
Definition at line 144 of file HandshakeToHW.cpp.
References elementType.
Referenced by getSubModuleName().
|
static |
Definition at line 282 of file HandshakeToHW.cpp.
Referenced by convertExtMemoryOps().