CIRCT  20.0.0git
HandshakeToDC.h
Go to the documentation of this file.
1 //===- HandshakeToDC.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_HANDSHAKETODC_H
15 #define CIRCT_CONVERSION_HANDSHAKETODC_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 #define GEN_PASS_DECL_HANDSHAKETODC
28 #include "circt/Conversion/Passes.h.inc"
29 
30 namespace handshaketodc {
31 using ConvertedOps = DenseSet<Operation *>;
32 
33 // Runs Handshake to DC conversion on the provided op. `patternBuilder` can be
34 // used to describe additional patterns to run - typically this will be a
35 // pattern that converts the container operation (e.g. `op`).
36 // `configureTarget` can be provided to specialize legalization.
37 LogicalResult runHandshakeToDC(
38  mlir::Operation *op, HandshakeToDCOptions options,
39  llvm::function_ref<void(TypeConverter &typeConverter,
40  ConvertedOps &convertedOps,
41  RewritePatternSet &patterns)>
42  patternBuilder,
43  llvm::function_ref<void(mlir::ConversionTarget &)> configureTarget = {});
44 } // namespace handshaketodc
45 
46 namespace handshake {
47 
48 // Converts 't' into a valid HW type. This is strictly used for converting
49 // 'index' types into a fixed-width type.
50 Type toValidType(Type t);
51 
52 } // namespace handshake
53 } // namespace circt
54 
55 #endif // CIRCT_CONVERSION_HANDSHAKETODC_H
Type toValidType(Type t)
Converts 't' into a valid HW type.
DenseSet< Operation * > ConvertedOps
Definition: HandshakeToDC.h:31
LogicalResult runHandshakeToDC(mlir::Operation *op, HandshakeToDCOptions options, llvm::function_ref< void(TypeConverter &typeConverter, ConvertedOps &convertedOps, RewritePatternSet &patterns)> patternBuilder, llvm::function_ref< void(mlir::ConversionTarget &)> configureTarget={})
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21