CIRCT  19.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 std::unique_ptr<mlir::Pass> createHandshakeToDCPass();
28 
29 namespace handshaketodc {
30 using ConvertedOps = DenseSet<Operation *>;
31 
32 // Runs Handshake to DC conversion on the provided op. `patternBuilder` can be
33 // used to describe additional patterns to run - typically this will be a
34 // pattern that converts the container operation (e.g. `op`).
35 // `configureTarget` can be provided to specialize legalization.
36 LogicalResult runHandshakeToDC(
37  mlir::Operation *op,
38  llvm::function_ref<void(TypeConverter &typeConverter,
39  ConvertedOps &convertedOps,
40  RewritePatternSet &patterns)>
41  patternBuilder,
42  llvm::function_ref<void(mlir::ConversionTarget &)> configureTarget = {});
43 } // namespace handshaketodc
44 
45 namespace handshake {
46 
47 // Converts 't' into a valid HW type. This is strictly used for converting
48 // 'index' types into a fixed-width type.
49 Type toValidType(Type t);
50 
51 } // namespace handshake
52 } // namespace circt
53 
54 #endif // CIRCT_CONVERSION_HANDSHAKETODC_H
Type toValidType(Type t)
DenseSet< Operation * > ConvertedOps
Definition: HandshakeToDC.h:30
LogicalResult runHandshakeToDC(mlir::Operation *op, llvm::function_ref< void(TypeConverter &typeConverter, ConvertedOps &convertedOps, RewritePatternSet &patterns)> patternBuilder, llvm::function_ref< void(mlir::ConversionTarget &)> configureTarget={})
This file defines an intermediate representation for circuits acting as an abstraction for constraint...
Definition: DebugAnalysis.h:21
std::unique_ptr< mlir::Pass > createHandshakeToDCPass()