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> createFIRRTLFieldSourcePass();
141 
142 std::unique_ptr<mlir::Pass> createPrintInstanceGraphPass();
143 
144 std::unique_ptr<mlir::Pass> createPrintNLATablePass();
145 
146 std::unique_ptr<mlir::Pass>
147 createBlackBoxReaderPass(std::optional<mlir::StringRef> inputPrefix = {});
148 
149 std::unique_ptr<mlir::Pass>
151 
152 std::unique_ptr<mlir::Pass> createCheckCombLoopsPass();
153 
154 std::unique_ptr<mlir::Pass> createSFCCompatPass();
155 
156 std::unique_ptr<mlir::Pass>
157 createMergeConnectionsPass(bool enableAggressiveMerging = false);
158 
159 std::unique_ptr<mlir::Pass> createVectorizationPass();
160 
161 std::unique_ptr<mlir::Pass> createInjectDUTHierarchyPass();
162 
163 std::unique_ptr<mlir::Pass> createDropConstPass();
164 
165 std::unique_ptr<mlir::Pass>
167 
168 std::unique_ptr<mlir::Pass> createExtractInstancesPass();
169 
170 std::unique_ptr<mlir::Pass> createIMDeadCodeElimPass();
171 
172 std::unique_ptr<mlir::Pass> createRandomizeRegisterInitPass();
173 
174 std::unique_ptr<mlir::Pass> createRegisterOptimizerPass();
175 
176 std::unique_ptr<mlir::Pass> createLowerXMRPass();
177 
178 std::unique_ptr<mlir::Pass>
179 createResolveTracesPass(mlir::StringRef outputAnnotationFilename = "");
180 
181 std::unique_ptr<mlir::Pass> createInnerSymbolDCEPass();
182 
183 std::unique_ptr<mlir::Pass> createFinalizeIRPass();
184 
185 std::unique_ptr<mlir::Pass> createLowerClassesPass();
186 
187 std::unique_ptr<mlir::Pass> createLowerLayersPass();
188 
189 std::unique_ptr<mlir::Pass> createLayerMergePass();
190 
191 std::unique_ptr<mlir::Pass> createLayerSinkPass();
192 
193 std::unique_ptr<mlir::Pass> createAdvancedLayerSinkPass();
194 
195 std::unique_ptr<mlir::Pass> createMaterializeDebugInfoPass();
196 
197 std::unique_ptr<mlir::Pass> createLintingPass();
198 
199 std::unique_ptr<mlir::Pass> createProbesToSignalsPass();
200 
201 std::unique_ptr<mlir::Pass> createSpecializeLayersPass();
202 
203 std::unique_ptr<mlir::Pass>
204 createSpecializeOptionPass(bool selectDefaultInstanceChoice = false);
205 
206 std::unique_ptr<mlir::Pass> createCreateCompanionAssume();
207 
208 std::unique_ptr<mlir::Pass> createModuleSummaryPass();
209 
210 std::unique_ptr<mlir::Pass> createLowerDPIPass();
211 
212 std::unique_ptr<mlir::Pass>
213 createAssignOutputDirsPass(mlir::StringRef outputDir = "");
214 
215 std::unique_ptr<mlir::Pass> createCheckLayers();
216 
217 std::unique_ptr<mlir::Pass> createCheckRecursiveInstantiation();
218 
219 /// Generate the code for registering passes.
220 #define GEN_PASS_REGISTRATION
221 #include "circt/Dialect/FIRRTL/Passes.h.inc"
222 
223 } // namespace firrtl
224 } // namespace circt
225 
226 #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 > 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 > createSpecializeOptionPass(bool selectDefaultInstanceChoice=false)
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:864
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 > 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