CIRCT  19.0.0git
HandshakeToHW.h
Go to the documentation of this file.
1 //===- HandshakeToHW.h ------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares passes which together will lower the Handshake dialect to
10 // CIRCT RTL dialects.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef CIRCT_CONVERSION_HANDSHAKETOHW_H
15 #define CIRCT_CONVERSION_HANDSHAKETOHW_H
16 
17 #include "circt/Dialect/HW/HWOps.h"
18 #include "mlir/IR/Builders.h"
19 #include <memory>
20 
21 namespace mlir {
22 class Pass;
23 } // namespace mlir
24 
25 namespace circt {
26 
27 namespace esi {
28 class ChannelType;
29 } // namespace esi
30 
31 std::unique_ptr<mlir::Pass> createHandshakeToHWPass();
32 
33 namespace handshake {
34 
35 // Attribute name for the name of a predeclaration of the to-be-lowered
36 // hw.module from a handshake function.
37 static constexpr const char *kPredeclarationAttr = "handshake.module_name";
38 
39 // Converts 't' into a valid HW type. This is strictly used for converting
40 // 'index' types into a fixed-width type.
41 Type toValidType(Type t);
42 
43 // Wraps a type into an ESI ChannelType type. The inner type is converted to
44 // ensure comprehensability with the RTL dialects.
46 
47 // Returns the hw::ModulePortInfo that corresponds to the given handshake
48 // operation and its in- and output types.
49 hw::ModulePortInfo getPortInfoForOpTypes(mlir::Operation *op, TypeRange inputs,
50  TypeRange outputs);
51 
52 } // namespace handshake
53 } // namespace circt
54 
55 #endif // CIRCT_CONVERSION_HANDSHAKETOHW_H
llvm::SmallVector< StringAttr > inputs
llvm::SmallVector< StringAttr > outputs
Channels are the basic communication primitives.
Definition: Types.h:63
hw::ModulePortInfo getPortInfoForOpTypes(mlir::Operation *op, TypeRange inputs, TypeRange outputs)
static constexpr const char * kPredeclarationAttr
Definition: HandshakeToHW.h:37
Type toValidType(Type t)
esi::ChannelType esiWrapper(mlir::Type t)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
std::unique_ptr< mlir::Pass > createHandshakeToHWPass()
Definition: esi.py:1
This holds a decoded list of input/inout and output ports for a module or instance.