CIRCT  20.0.0git
Passes.h
Go to the documentation of this file.
1 //===- Passes.h - FIRRTL pass entry points ----------------------*- 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 header file defines prototypes that expose pass constructors.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef CIRCT_DIALECT_FIRRTL_PASSES_H
14 #define CIRCT_DIALECT_FIRRTL_PASSES_H
15 
16 #include "mlir/Pass/Pass.h"
17 #include "mlir/Pass/PassRegistry.h"
18 #include <memory>
19 #include <optional>
20 
21 namespace mlir {
22 class Pass;
23 } // namespace mlir
24 
25 namespace circt {
26 namespace firrtl {
27 
28 /// Configure which aggregate values will be preserved by the LowerTypes pass.
29 namespace PreserveAggregate {
31  /// Don't preserve aggregate at all. This has been default behaivor and
32  /// compatible with SFC.
34 
35  /// Preserve only 1d vectors of ground type (e.g. UInt<2>[3]).
37 
38  /// Preserve only vectors (e.g. UInt<2>[3][3]).
39  Vec,
40 
41  /// Preserve all aggregate values.
42  All,
43 };
44 }
45 
46 /// Configure which values will be explicitly preserved by the DropNames pass.
47 namespace PreserveValues {
49  /// Strip all names. No name on declaration is preserved.
51  /// Don't explicitly preserve any named values. Every named operation could
52  /// be optimized away by the compiler. Unlike `Strip` names could be preserved
53  /// until the end.
55  // Explicitly preserved values with meaningful names. If a name begins with
56  // an "_" it is not considered meaningful.
58  // Explicitly preserve all values. No named operation should be optimized
59  // away by the compiler.
60  All,
61 };
62 } // namespace PreserveValues
63 
64 enum class CompanionMode {
65  // Lower companions to SystemVerilog binds.
66  Bind,
67  // Lower companions to explicit instances. Used when assertions or other
68  // debugging constructs from the companion are to be included in the design.
70  // Drop companion modules, eliminating them from the design.
71  Drop,
72 };
73 
74 #define GEN_PASS_DECL
75 #include "circt/Dialect/FIRRTL/Passes.h.inc"
76 
77 std::unique_ptr<mlir::Pass> createResolvePathsPass();
78 
79 std::unique_ptr<mlir::Pass>
80 createLowerFIRRTLAnnotationsPass(bool ignoreUnhandledAnnotations = false,
81  bool ignoreClasslessAnnotations = false,
82  bool noRefTypePorts = false,
83  bool allowAddingPortsOnPublic = false);
84 
85 std::unique_ptr<mlir::Pass> createLowerOpenAggsPass();
86 
87 std::unique_ptr<mlir::Pass> createLowerFIRRTLTypesPass(
90 
91 std::unique_ptr<mlir::Pass> createLowerBundleVectorTypesPass();
92 
93 std::unique_ptr<mlir::Pass> createLowerCHIRRTLPass();
94 
95 std::unique_ptr<mlir::Pass>
96 createLowerIntmodulesPass(bool fixupEICGWrapper = false);
97 
98 std::unique_ptr<mlir::Pass> createLowerIntrinsicsPass();
99 
100 std::unique_ptr<mlir::Pass> createIMConstPropPass();
101 
102 std::unique_ptr<mlir::Pass>
103 createRemoveUnusedPortsPass(bool ignoreDontTouch = false);
104 
105 std::unique_ptr<mlir::Pass> createInlinerPass();
106 
107 std::unique_ptr<mlir::Pass> createInferReadWritePass();
108 
109 std::unique_ptr<mlir::Pass>
110 createCreateSiFiveMetadataPass(bool replSeqMem = false,
111  mlir::StringRef replSeqMemFile = "");
112 
113 std::unique_ptr<mlir::Pass> createVBToBVPass();
114 
115 std::unique_ptr<mlir::Pass> createAddSeqMemPortsPass();
116 
117 std::unique_ptr<mlir::Pass> createDedupPass();
118 
119 std::unique_ptr<mlir::Pass> createEliminateWiresPass();
120 
121 std::unique_ptr<mlir::Pass> createLowerMatchesPass();
122 
123 std::unique_ptr<mlir::Pass> createLowerSignaturesPass();
124 
125 std::unique_ptr<mlir::Pass> createPassiveWiresPass();
126 
127 std::unique_ptr<mlir::Pass> createExpandWhensPass();
128 
129 std::unique_ptr<mlir::Pass> createFlattenMemoryPass();
130 
131 std::unique_ptr<mlir::Pass> createInferWidthsPass();
132 
133 std::unique_ptr<mlir::Pass> createInferResetsPass();
134 
135 std::unique_ptr<mlir::Pass> createLowerMemoryPass();
136 
137 std::unique_ptr<mlir::Pass>
138 createMemToRegOfVecPass(bool replSeqMem = false, bool ignoreReadEnable = false);
139 
140 std::unique_ptr<mlir::Pass> createPrefixModulesPass();
141 
142 std::unique_ptr<mlir::Pass> createFIRRTLFieldSourcePass();
143 
144 std::unique_ptr<mlir::Pass> createPrintInstanceGraphPass();
145 
146 std::unique_ptr<mlir::Pass> createPrintNLATablePass();
147 
148 std::unique_ptr<mlir::Pass>
149 createBlackBoxReaderPass(std::optional<mlir::StringRef> inputPrefix = {});
150 
151 std::unique_ptr<mlir::Pass>
153 
154 std::unique_ptr<mlir::Pass> createCheckCombLoopsPass();
155 
156 std::unique_ptr<mlir::Pass> createSFCCompatPass();
157 
158 std::unique_ptr<mlir::Pass>
159 createMergeConnectionsPass(bool enableAggressiveMerging = false);
160 
161 std::unique_ptr<mlir::Pass> createVectorizationPass();
162 
163 std::unique_ptr<mlir::Pass> createInjectDUTHierarchyPass();
164 
165 std::unique_ptr<mlir::Pass> createDropConstPass();
166 
167 std::unique_ptr<mlir::Pass>
169 
170 std::unique_ptr<mlir::Pass> createExtractInstancesPass();
171 
172 std::unique_ptr<mlir::Pass> createIMDeadCodeElimPass();
173 
174 std::unique_ptr<mlir::Pass> createRandomizeRegisterInitPass();
175 
176 std::unique_ptr<mlir::Pass> createRegisterOptimizerPass();
177 
178 std::unique_ptr<mlir::Pass> createLowerXMRPass();
179 
180 std::unique_ptr<mlir::Pass>
181 createResolveTracesPass(mlir::StringRef outputAnnotationFilename = "");
182 
183 std::unique_ptr<mlir::Pass> createInnerSymbolDCEPass();
184 
185 std::unique_ptr<mlir::Pass> createFinalizeIRPass();
186 
187 std::unique_ptr<mlir::Pass> createLowerClassesPass();
188 
189 std::unique_ptr<mlir::Pass> createLowerLayersPass();
190 
191 std::unique_ptr<mlir::Pass> createLayerMergePass();
192 
193 std::unique_ptr<mlir::Pass> createLayerSinkPass();
194 
195 std::unique_ptr<mlir::Pass> createAdvancedLayerSinkPass();
196 
197 std::unique_ptr<mlir::Pass> createMaterializeDebugInfoPass();
198 
199 std::unique_ptr<mlir::Pass> createLintingPass();
200 
201 std::unique_ptr<mlir::Pass> createProbesToSignalsPass();
202 
203 std::unique_ptr<mlir::Pass> createSpecializeLayersPass();
204 
205 std::unique_ptr<mlir::Pass> createSpecializeOptionPass();
206 
207 std::unique_ptr<mlir::Pass> createCreateCompanionAssume();
208 
209 std::unique_ptr<mlir::Pass> createModuleSummaryPass();
210 
211 std::unique_ptr<mlir::Pass> createLowerDPIPass();
212 
213 std::unique_ptr<mlir::Pass>
214 createAssignOutputDirsPass(mlir::StringRef outputDir = "");
215 
216 std::unique_ptr<mlir::Pass> createCheckLayers();
217 
218 std::unique_ptr<mlir::Pass> createCheckRecursiveInstantiation();
219 
220 /// Generate the code for registering passes.
221 #define GEN_PASS_REGISTRATION
222 #include "circt/Dialect/FIRRTL/Passes.h.inc"
223 
224 } // namespace firrtl
225 } // namespace circt
226 
227 #endif // CIRCT_DIALECT_FIRRTL_PASSES_H
@ All
Preserve all aggregate values.
Definition: Passes.h:42
@ OneDimVec
Preserve only 1d vectors of ground type (e.g. UInt<2>[3]).
Definition: Passes.h:36
@ Vec
Preserve only vectors (e.g. UInt<2>[3][3]).
Definition: Passes.h:39
@ None
Don't preserve aggregate at all.
Definition: Passes.h:33
@ None
Don't explicitly preserve any named values.
Definition: Passes.h:54
@ Strip
Strip all names. No name on declaration is preserved.
Definition: Passes.h:50
std::unique_ptr< mlir::Pass > createInferReadWritePass()
std::unique_ptr< mlir::Pass > createCheckCombLoopsPass()
std::unique_ptr< mlir::Pass > createCheckLayers()
std::unique_ptr< mlir::Pass > createFIRRTLFieldSourcePass()
std::unique_ptr< mlir::Pass > createCheckRecursiveInstantiation()
std::unique_ptr< mlir::Pass > createFinalizeIRPass()
Definition: FinalizeIR.cpp:45
std::unique_ptr< mlir::Pass > createLowerFIRRTLTypesPass(PreserveAggregate::PreserveMode mode=PreserveAggregate::None, PreserveAggregate::PreserveMode memoryMode=PreserveAggregate::None)
This is the pass constructor.
std::unique_ptr< mlir::Pass > createResolveTracesPass(mlir::StringRef outputAnnotationFilename="")
std::unique_ptr< mlir::Pass > createResolvePathsPass()
std::unique_ptr< mlir::Pass > createLowerFIRRTLAnnotationsPass(bool ignoreUnhandledAnnotations=false, bool ignoreClasslessAnnotations=false, bool noRefTypePorts=false, bool allowAddingPortsOnPublic=false)
This is the pass constructor.
std::unique_ptr< mlir::Pass > createLowerSignaturesPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createSpecializeOptionPass()
std::unique_ptr< mlir::Pass > createVBToBVPass()
Definition: VBToBV.cpp:993
std::unique_ptr< mlir::Pass > createGrandCentralPass(CompanionMode companionMode=CompanionMode::Bind)
std::unique_ptr< mlir::Pass > createLowerDPIPass()
Definition: LowerDPI.cpp:294
std::unique_ptr< mlir::Pass > createLowerIntmodulesPass(bool fixupEICGWrapper=false)
This is the pass constructor.
std::unique_ptr< mlir::Pass > createIMConstPropPass()
std::unique_ptr< mlir::Pass > createBlackBoxReaderPass(std::optional< mlir::StringRef > inputPrefix={})
std::unique_ptr< mlir::Pass > createCreateCompanionAssume()
std::unique_ptr< mlir::Pass > createCreateSiFiveMetadataPass(bool replSeqMem=false, mlir::StringRef replSeqMemFile="")
std::unique_ptr< mlir::Pass > createRemoveUnusedPortsPass(bool ignoreDontTouch=false)
std::unique_ptr< mlir::Pass > createAdvancedLayerSinkPass()
std::unique_ptr< mlir::Pass > createLayerMergePass()
Definition: LayerMerge.cpp:72
std::unique_ptr< mlir::Pass > createInlinerPass()
std::unique_ptr< mlir::Pass > createVectorizationPass()
std::unique_ptr< mlir::Pass > createLowerMemoryPass()
std::unique_ptr< mlir::Pass > createDropNamesPass(PreserveValues::PreserveMode mode=PreserveValues::None)
Definition: DropName.cpp:101
std::unique_ptr< mlir::Pass > createLowerLayersPass()
std::unique_ptr< mlir::Pass > createIMDeadCodeElimPass()
std::unique_ptr< mlir::Pass > createLintingPass()
Definition: Lint.cpp:77
std::unique_ptr< mlir::Pass > createLowerBundleVectorTypesPass()
std::unique_ptr< mlir::Pass > createEliminateWiresPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createPassiveWiresPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createExtractInstancesPass()
std::unique_ptr< mlir::Pass > createDedupPass()
Definition: Dedup.cpp:1865
std::unique_ptr< mlir::Pass > createLayerSinkPass()
Definition: LayerSink.cpp:58
std::unique_ptr< mlir::Pass > createSpecializeLayersPass()
std::unique_ptr< mlir::Pass > createLowerCHIRRTLPass()
std::unique_ptr< mlir::Pass > createPrintInstanceGraphPass()
std::unique_ptr< mlir::Pass > createPrintNLATablePass()
std::unique_ptr< mlir::Pass > createInnerSymbolDCEPass()
std::unique_ptr< mlir::Pass > createExpandWhensPass()
std::unique_ptr< mlir::Pass > createLowerXMRPass()
Definition: LowerXMR.cpp:859
std::unique_ptr< mlir::Pass > createLowerIntrinsicsPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createInferWidthsPass()
std::unique_ptr< mlir::Pass > createMemToRegOfVecPass(bool replSeqMem=false, bool ignoreReadEnable=false)
std::unique_ptr< mlir::Pass > createLowerOpenAggsPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createAssignOutputDirsPass(mlir::StringRef outputDir="")
std::unique_ptr< mlir::Pass > createDropConstPass()
Definition: DropConst.cpp:110
std::unique_ptr< mlir::Pass > createSFCCompatPass()
Definition: SFCCompat.cpp:165
std::unique_ptr< mlir::Pass > createPrefixModulesPass()
std::unique_ptr< mlir::Pass > createInjectDUTHierarchyPass()
std::unique_ptr< mlir::Pass > createRandomizeRegisterInitPass()
std::unique_ptr< mlir::Pass > createLowerClassesPass()
std::unique_ptr< mlir::Pass > createAddSeqMemPortsPass()
std::unique_ptr< mlir::Pass > createModuleSummaryPass()
std::unique_ptr< mlir::Pass > createRegisterOptimizerPass()
std::unique_ptr< mlir::Pass > createLowerMatchesPass()
std::unique_ptr< mlir::Pass > createProbesToSignalsPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createMergeConnectionsPass(bool enableAggressiveMerging=false)
std::unique_ptr< mlir::Pass > createInferResetsPass()
std::unique_ptr< mlir::Pass > createFlattenMemoryPass()
std::unique_ptr< mlir::Pass > createMaterializeDebugInfoPass()
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21