CIRCT
20.0.0git
|
#include "circt/Conversion/HandshakeToHW.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/ESI/ESIOps.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/HWSymCache.h"
#include "circt/Dialect/HW/HWTypes.h"
#include "circt/Dialect/Handshake/HandshakeOps.h"
#include "circt/Dialect/Handshake/HandshakePasses.h"
#include "circt/Dialect/Handshake/HandshakeUtils.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/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/MathExtras.h"
#include <optional>
#include "circt/Conversion/Passes.h.inc"
Go to the source code of this file.
Namespaces | |
circt | |
The InstanceGraph op interface, see InstanceGraphInterface.td for more details. | |
Macros | |
#define | GEN_PASS_DEF_HANDSHAKETOHW |
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) |
#define GEN_PASS_DEF_HANDSHAKETOHW |
Definition at line 37 of file HandshakeToHW.cpp.
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 129 of file HandshakeToHW.cpp.
using NameUniquer = std::function<std::string(Operation *)> |
Definition at line 46 of file HandshakeToHW.cpp.
|
static |
Definition at line 269 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 260 of file HandshakeToHW.cpp.
Referenced by checkSubModuleOp().
|
static |
Definition at line 301 of file HandshakeToHW.cpp.
References circt::hw::ModulePortInfo::eraseInput(), circt::calyx::direction::get(), circt::hw::ModulePortInfo::getInputs(), circt::hw::ModulePortInfo::getOutputs(), Input, Output, and portToFieldInfo().
|
static |
Definition at line 1892 of file HandshakeToHW.cpp.
References getCallName().
|
static |
Filters NoneType's from the input.
Definition at line 120 of file HandshakeToHW.cpp.
Referenced by getHandshakeDiscriminatingTypes().
|
static |
Returns a submodule name resulting from an operation, without discriminating type information.
Definition at line 95 of file HandshakeToHW.cpp.
Referenced by getCallName(), and getSubModuleName().
|
static |
Definition at line 104 of file HandshakeToHW.cpp.
References getBareSubModuleName().
Referenced by convertFuncOp().
|
static |
Definition at line 130 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 112 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 286 of file HandshakeToHW.cpp.
References circt::handshake::getPortInfoForOpTypes().
|
static |
Construct a name for creating HW sub-module.
Definition at line 178 of file HandshakeToHW.cpp.
References assert(), getBareSubModuleName(), getHandshakeDiscriminatingTypes(), getInt(), 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 153 of file HandshakeToHW.cpp.
References elementType.
Referenced by getSubModuleName().
|
static |
Definition at line 291 of file HandshakeToHW.cpp.
Referenced by convertExtMemoryOps().