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>
122 createEmitOMIRPass(mlir::StringRef outputFilename = "");
123 
124 std::unique_ptr<mlir::Pass> createLowerMatchesPass();
125 
126 std::unique_ptr<mlir::Pass> createLowerSignaturesPass();
127 
128 std::unique_ptr<mlir::Pass> createPassiveWiresPass();
129 
130 std::unique_ptr<mlir::Pass> createExpandWhensPass();
131 
132 std::unique_ptr<mlir::Pass> createFlattenMemoryPass();
133 
134 std::unique_ptr<mlir::Pass> createInferWidthsPass();
135 
136 std::unique_ptr<mlir::Pass> createInferResetsPass();
137 
138 std::unique_ptr<mlir::Pass> createLowerMemoryPass();
139 
140 std::unique_ptr<mlir::Pass>
141 createMemToRegOfVecPass(bool replSeqMem = false, bool ignoreReadEnable = false);
142 
143 std::unique_ptr<mlir::Pass> createPrefixModulesPass();
144 
145 std::unique_ptr<mlir::Pass> createFIRRTLFieldSourcePass();
146 
147 std::unique_ptr<mlir::Pass> createPrintInstanceGraphPass();
148 
149 std::unique_ptr<mlir::Pass> createPrintNLATablePass();
150 
151 std::unique_ptr<mlir::Pass>
152 createBlackBoxReaderPass(std::optional<mlir::StringRef> inputPrefix = {});
153 
154 std::unique_ptr<mlir::Pass>
156 
157 std::unique_ptr<mlir::Pass> createCheckCombLoopsPass();
158 
159 std::unique_ptr<mlir::Pass> createSFCCompatPass();
160 
161 std::unique_ptr<mlir::Pass>
162 createMergeConnectionsPass(bool enableAggressiveMerging = false);
163 
164 std::unique_ptr<mlir::Pass> createVectorizationPass();
165 
166 std::unique_ptr<mlir::Pass> createInjectDUTHierarchyPass();
167 
168 std::unique_ptr<mlir::Pass> createDropConstPass();
169 
170 std::unique_ptr<mlir::Pass>
172 
173 std::unique_ptr<mlir::Pass> createExtractInstancesPass();
174 
175 std::unique_ptr<mlir::Pass> createIMDeadCodeElimPass();
176 
177 std::unique_ptr<mlir::Pass> createRandomizeRegisterInitPass();
178 
179 std::unique_ptr<mlir::Pass> createRegisterOptimizerPass();
180 
181 std::unique_ptr<mlir::Pass> createLowerXMRPass();
182 
183 std::unique_ptr<mlir::Pass>
184 createResolveTracesPass(mlir::StringRef outputAnnotationFilename = "");
185 
186 std::unique_ptr<mlir::Pass> createInnerSymbolDCEPass();
187 
188 std::unique_ptr<mlir::Pass> createFinalizeIRPass();
189 
190 std::unique_ptr<mlir::Pass> createLowerClassesPass();
191 
192 std::unique_ptr<mlir::Pass> createLowerLayersPass();
193 
194 std::unique_ptr<mlir::Pass> createLayerMergePass();
195 
196 std::unique_ptr<mlir::Pass> createLayerSinkPass();
197 
198 std::unique_ptr<mlir::Pass> createAdvancedLayerSinkPass();
199 
200 std::unique_ptr<mlir::Pass> createMaterializeDebugInfoPass();
201 
202 std::unique_ptr<mlir::Pass> createLintingPass();
203 
204 std::unique_ptr<mlir::Pass> createProbesToSignalsPass();
205 
206 std::unique_ptr<mlir::Pass> createSpecializeLayersPass();
207 
208 std::unique_ptr<mlir::Pass> createSpecializeOptionPass();
209 
210 std::unique_ptr<mlir::Pass> createCreateCompanionAssume();
211 
212 std::unique_ptr<mlir::Pass> createModuleSummaryPass();
213 
214 std::unique_ptr<mlir::Pass> createLowerDPIPass();
215 
216 std::unique_ptr<mlir::Pass>
217 createAssignOutputDirsPass(mlir::StringRef outputDir = "");
218 
219 std::unique_ptr<mlir::Pass> createCheckLayers();
220 
221 std::unique_ptr<mlir::Pass> createCheckRecursiveInstantiation();
222 
223 /// Generate the code for registering passes.
224 #define GEN_PASS_REGISTRATION
225 #include "circt/Dialect/FIRRTL/Passes.h.inc"
226 
227 } // namespace firrtl
228 } // namespace circt
229 
230 #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:46
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 > createEmitOMIRPass(mlir::StringRef outputFilename="")
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:995
std::unique_ptr< mlir::Pass > createGrandCentralPass(CompanionMode companionMode=CompanionMode::Bind)
std::unique_ptr< mlir::Pass > createLowerDPIPass()
Definition: LowerDPI.cpp:296
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:102
std::unique_ptr< mlir::Pass > createLowerLayersPass()
std::unique_ptr< mlir::Pass > createIMDeadCodeElimPass()
std::unique_ptr< mlir::Pass > createLintingPass()
Definition: Lint.cpp:78
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:1869
std::unique_ptr< mlir::Pass > createLayerSinkPass()
Definition: LayerSink.cpp:61
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:860
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:167
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