CIRCT  20.0.0git
Firtool.h
Go to the documentation of this file.
1 //===-- circt-c/Firtool/Firtool.h - C API for Firtool-lib ---------*- C -*-===//
2 //
3 //===----------------------------------------------------------------------===//
4 
5 #ifndef CIRCT_C_FIRTOOL_FIRTOOL_H
6 #define CIRCT_C_FIRTOOL_FIRTOOL_H
7 
8 #include "mlir-c/Pass.h"
9 #include "mlir-c/Support.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #define DEFINE_C_API_STRUCT(name, storage) \
16  struct name { \
17  storage *ptr; \
18  }; \
19  typedef struct name name
20 
21 DEFINE_C_API_STRUCT(CirctFirtoolFirtoolOptions, void);
22 
23 #undef DEFINE_C_API_STRUCT
24 
25 // NOLINTNEXTLINE(modernize-use-using)
32 
33 // NOLINTNEXTLINE(modernize-use-using)
40 
41 // NOLINTNEXTLINE(modernize-use-using)
47 
48 // NOLINTNEXTLINE(modernize-use-using)
49 typedef enum CirctFirtoolBuildMode {
54 
55 // NOLINTNEXTLINE(modernize-use-using)
56 typedef enum CirctFirtoolRandomKind {
62 
63 // NOLINTNEXTLINE(modernize-use-using)
70 
71 MLIR_CAPI_EXPORTED CirctFirtoolFirtoolOptions
73 MLIR_CAPI_EXPORTED void
74 circtFirtoolOptionsDestroy(CirctFirtoolFirtoolOptions options);
75 
76 MLIR_CAPI_EXPORTED void
77 circtFirtoolOptionsSetOutputFilename(CirctFirtoolFirtoolOptions options,
78  MlirStringRef filename);
80  CirctFirtoolFirtoolOptions options, bool disable);
81 
83  CirctFirtoolFirtoolOptions options, bool value);
84 
86  CirctFirtoolFirtoolOptions options, bool value);
87 
89  CirctFirtoolFirtoolOptions options, bool value);
90 
91 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetPreserveAggregate(
92  CirctFirtoolFirtoolOptions options,
94 
95 MLIR_CAPI_EXPORTED void
96 circtFirtoolOptionsSetPreserveValues(CirctFirtoolFirtoolOptions options,
98 
99 MLIR_CAPI_EXPORTED void
100 circtFirtoolOptionsSetEnableDebugInfo(CirctFirtoolFirtoolOptions options,
101  bool value);
102 
103 MLIR_CAPI_EXPORTED void
104 circtFirtoolOptionsSetBuildMode(CirctFirtoolFirtoolOptions options,
105  CirctFirtoolBuildMode value);
106 MLIR_CAPI_EXPORTED void
107 circtFirtoolOptionsSetDisableLayerSink(CirctFirtoolFirtoolOptions options,
108  bool value);
109 
110 MLIR_CAPI_EXPORTED void
111 circtFirtoolOptionsSetDisableOptimization(CirctFirtoolFirtoolOptions options,
112  bool value);
113 
114 MLIR_CAPI_EXPORTED void
115 circtFirtoolOptionsSetExportChiselInterface(CirctFirtoolFirtoolOptions options,
116  bool value);
117 
119  CirctFirtoolFirtoolOptions options, MlirStringRef value);
120 
121 MLIR_CAPI_EXPORTED void
122 circtFirtoolOptionsSetVbToBv(CirctFirtoolFirtoolOptions options, bool value);
123 
124 MLIR_CAPI_EXPORTED void
125 circtFirtoolOptionsSetNoDedup(CirctFirtoolFirtoolOptions options, bool value);
126 
127 MLIR_CAPI_EXPORTED void
128 circtFirtoolOptionsSetCompanionMode(CirctFirtoolFirtoolOptions options,
130 
132  CirctFirtoolFirtoolOptions options, bool value);
133 
134 MLIR_CAPI_EXPORTED void
135 circtFirtoolOptionsSetLowerMemories(CirctFirtoolFirtoolOptions options,
136  bool value);
137 
138 MLIR_CAPI_EXPORTED void
139 circtFirtoolOptionsSetBlackBoxRootPath(CirctFirtoolFirtoolOptions options,
140  MlirStringRef value);
141 
142 MLIR_CAPI_EXPORTED void
143 circtFirtoolOptionsSetReplSeqMem(CirctFirtoolFirtoolOptions options,
144  bool value);
145 
146 MLIR_CAPI_EXPORTED void
147 circtFirtoolOptionsSetReplSeqMemFile(CirctFirtoolFirtoolOptions options,
148  MlirStringRef value);
149 
150 MLIR_CAPI_EXPORTED void
151 circtFirtoolOptionsSetExtractTestCode(CirctFirtoolFirtoolOptions options,
152  bool value);
153 
154 MLIR_CAPI_EXPORTED void
155 circtFirtoolOptionsSetIgnoreReadEnableMem(CirctFirtoolFirtoolOptions options,
156  bool value);
157 
158 MLIR_CAPI_EXPORTED void
159 circtFirtoolOptionsSetDisableRandom(CirctFirtoolFirtoolOptions options,
160  CirctFirtoolRandomKind value);
161 
162 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetOutputAnnotationFilename(
163  CirctFirtoolFirtoolOptions options, MlirStringRef value);
164 
165 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEnableAnnotationWarning(
166  CirctFirtoolFirtoolOptions options, bool value);
167 
168 MLIR_CAPI_EXPORTED void
169 circtFirtoolOptionsSetAddMuxPragmas(CirctFirtoolFirtoolOptions options,
170  bool value);
171 
172 MLIR_CAPI_EXPORTED void
173 circtFirtoolOptionsSetVerificationFlavor(CirctFirtoolFirtoolOptions options,
175 
176 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEmitSeparateAlwaysBlocks(
177  CirctFirtoolFirtoolOptions options, bool value);
178 
180  CirctFirtoolFirtoolOptions options, bool value);
181 
183  CirctFirtoolFirtoolOptions options, bool value);
184 
185 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEtcDisableModuleInlining(
186  CirctFirtoolFirtoolOptions options, bool value);
187 
188 MLIR_CAPI_EXPORTED void
190  CirctFirtoolFirtoolOptions options, bool value);
191 
192 MLIR_CAPI_EXPORTED void
193 circtFirtoolOptionsSetCkgModuleName(CirctFirtoolFirtoolOptions options,
194  MlirStringRef value);
195 
196 MLIR_CAPI_EXPORTED void
197 circtFirtoolOptionsSetCkgInputName(CirctFirtoolFirtoolOptions options,
198  MlirStringRef value);
199 
200 MLIR_CAPI_EXPORTED void
201 circtFirtoolOptionsSetCkgOutputName(CirctFirtoolFirtoolOptions options,
202  MlirStringRef value);
203 
204 MLIR_CAPI_EXPORTED void
205 circtFirtoolOptionsSetCkgEnableName(CirctFirtoolFirtoolOptions options,
206  MlirStringRef value);
207 
208 MLIR_CAPI_EXPORTED void
209 circtFirtoolOptionsSetCkgTestEnableName(CirctFirtoolFirtoolOptions options,
210  MlirStringRef value);
211 
212 MLIR_CAPI_EXPORTED void
213 circtFirtoolOptionsSetExportModuleHierarchy(CirctFirtoolFirtoolOptions options,
214  bool value);
215 
216 MLIR_CAPI_EXPORTED void
217 circtFirtoolOptionsSetStripFirDebugInfo(CirctFirtoolFirtoolOptions options,
218  bool value);
219 
220 MLIR_CAPI_EXPORTED void
221 circtFirtoolOptionsSetStripDebugInfo(CirctFirtoolFirtoolOptions options,
222  bool value);
223 
224 MLIR_CAPI_EXPORTED void
225 circtFirtoolOptionsSetDisableCSEinClasses(CirctFirtoolFirtoolOptions options,
226  bool value);
227 
229  CirctFirtoolFirtoolOptions options, bool value);
230 
231 //===----------------------------------------------------------------------===//
232 // Populate API.
233 //===----------------------------------------------------------------------===//
234 
235 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulatePreprocessTransforms(
236  MlirPassManager pm, CirctFirtoolFirtoolOptions options);
237 
238 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateCHIRRTLToLowFIRRTL(
239  MlirPassManager pm, CirctFirtoolFirtoolOptions options,
240  MlirStringRef inputFilename);
241 
242 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateLowFIRRTLToHW(
243  MlirPassManager pm, CirctFirtoolFirtoolOptions options);
244 
245 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateHWToSV(
246  MlirPassManager pm, CirctFirtoolFirtoolOptions options);
247 
248 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateExportVerilog(
249  MlirPassManager pm, CirctFirtoolFirtoolOptions options,
250  MlirStringCallback callback, void *userData);
251 
252 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateExportSplitVerilog(
253  MlirPassManager pm, CirctFirtoolFirtoolOptions options,
254  MlirStringRef directory);
255 
256 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateFinalizeIR(
257  MlirPassManager pm, CirctFirtoolFirtoolOptions options);
258 
259 #ifdef __cplusplus
260 }
261 #endif
262 
263 #endif // CIRCT_C_FIRTOOL_FIRTOOL_H
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetLowerMemories(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:182
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetOutputAnnotationFilename(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:234
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetOutputFilename(CirctFirtoolFirtoolOptions options, MlirStringRef filename)
Definition: Firtool.cpp:34
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetCkgInputName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:284
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetBuildMode(CirctFirtoolFirtoolOptions options, CirctFirtoolBuildMode value)
Definition: Firtool.cpp:109
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetCkgEnableName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:294
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateLowFIRRTLToHW(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:350
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetPreserveAggregate(CirctFirtoolFirtoolOptions options, CirctFirtoolPreserveAggregateMode value)
Definition: Firtool.cpp:59
CirctFirtoolVerificationFlavor
Definition: Firtool.h:64
@ CIRCT_FIRTOOL_VERIFICATION_FLAVOR_IF_ELSE_FATAL
Definition: Firtool.h:66
@ CIRCT_FIRTOOL_VERIFICATION_FLAVOR_NONE
Definition: Firtool.h:65
@ CIRCT_FIRTOOL_VERIFICATION_FLAVOR_IMMEDIATE
Definition: Firtool.h:67
@ CIRCT_FIRTOOL_VERIFICATION_FLAVOR_SVA
Definition: Firtool.h:68
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetCkgModuleName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:279
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetCkgOutputName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:289
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEmitSeparateAlwaysBlocks(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:254
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetExportChiselInterface(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:138
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetStripFirDebugInfo(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:309
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableCSEinClasses(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:319
CirctFirtoolCompanionMode
Definition: Firtool.h:42
@ CIRCT_FIRTOOL_COMPANION_MODE_BIND
Definition: Firtool.h:43
@ CIRCT_FIRTOOL_COMPANION_MODE_DROP
Definition: Firtool.h:45
@ CIRCT_FIRTOOL_COMPANION_MODE_INSTANTIATE
Definition: Firtool.h:44
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetAddVivadoRAMAddressConflictSynthesisBugWorkaround(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:274
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateCHIRRTLToLowFIRRTL(MlirPassManager pm, CirctFirtoolFirtoolOptions options, MlirStringRef inputFilename)
Definition: Firtool.cpp:342
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetBlackBoxRootPath(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:187
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetNoDedup(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:153
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetChiselInterfaceOutDirectory(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:143
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetLowerAnnotationsNoRefTypePorts(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:49
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetCkgTestEnableName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:299
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableOptimization(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:133
#define DEFINE_C_API_STRUCT(name, storage)
Definition: Firtool.h:15
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetCompanionMode(CirctFirtoolFirtoolOptions options, CirctFirtoolCompanionMode value)
Definition: Firtool.cpp:158
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEtcDisableRegisterExtraction(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:264
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEnableDebugInfo(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:104
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetVerificationFlavor(CirctFirtoolFirtoolOptions options, CirctFirtoolVerificationFlavor value)
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulatePreprocessTransforms(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:335
CirctFirtoolRandomKind
Definition: Firtool.h:56
@ CIRCT_FIRTOOL_RANDOM_KIND_MEM
Definition: Firtool.h:58
@ CIRCT_FIRTOOL_RANDOM_KIND_NONE
Definition: Firtool.h:57
@ CIRCT_FIRTOOL_RANDOM_KIND_REG
Definition: Firtool.h:59
@ CIRCT_FIRTOOL_RANDOM_KIND_ALL
Definition: Firtool.h:60
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateExportSplitVerilog(MlirPassManager pm, CirctFirtoolFirtoolOptions options, MlirStringRef directory)
Definition: Firtool.cpp:372
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableAggressiveMergeConnections(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:177
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableUnknownAnnotations(CirctFirtoolFirtoolOptions options, bool disable)
Definition: Firtool.cpp:39
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetReplSeqMemFile(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:197
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetExtractTestCode(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:202
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateHWToSV(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:356
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetVbToBv(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:148
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetAddMuxPragmas(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:244
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetAllowAddingPortsOnPublic(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:54
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateExportVerilog(MlirPassManager pm, CirctFirtoolFirtoolOptions options, MlirStringCallback callback, void *userData)
Definition: Firtool.cpp:362
MLIR_CAPI_EXPORTED CirctFirtoolFirtoolOptions circtFirtoolOptionsCreateDefault(void)
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateFinalizeIR(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:380
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableLayerSink(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:128
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEtcDisableInstanceExtraction(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:259
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetReplSeqMem(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:192
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableRandom(CirctFirtoolFirtoolOptions options, CirctFirtoolRandomKind value)
Definition: Firtool.cpp:212
CirctFirtoolPreserveAggregateMode
Definition: Firtool.h:26
@ CIRCT_FIRTOOL_PRESERVE_AGGREGATE_MODE_NONE
Definition: Firtool.h:27
@ CIRCT_FIRTOOL_PRESERVE_AGGREGATE_MODE_ALL
Definition: Firtool.h:30
@ CIRCT_FIRTOOL_PRESERVE_AGGREGATE_MODE_VEC
Definition: Firtool.h:29
@ CIRCT_FIRTOOL_PRESERVE_AGGREGATE_MODE_ONE_DIM_VEC
Definition: Firtool.h:28
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableAnnotationsClassless(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:44
CirctFirtoolBuildMode
Definition: Firtool.h:49
@ CIRCT_FIRTOOL_BUILD_MODE_RELEASE
Definition: Firtool.h:52
@ CIRCT_FIRTOOL_BUILD_MODE_DEBUG
Definition: Firtool.h:51
@ CIRCT_FIRTOOL_BUILD_MODE_DEFAULT
Definition: Firtool.h:50
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEnableAnnotationWarning(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:239
MLIR_CAPI_EXPORTED void circtFirtoolOptionsDestroy(CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:30
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetPreserveValues(CirctFirtoolFirtoolOptions options, CirctFirtoolPreserveValuesMode value)
Definition: Firtool.cpp:82
CirctFirtoolPreserveValuesMode
Definition: Firtool.h:34
@ CIRCT_FIRTOOL_PRESERVE_VALUES_MODE_STRIP
Definition: Firtool.h:35
@ CIRCT_FIRTOOL_PRESERVE_VALUES_MODE_ALL
Definition: Firtool.h:38
@ CIRCT_FIRTOOL_PRESERVE_VALUES_MODE_NAMED
Definition: Firtool.h:37
@ CIRCT_FIRTOOL_PRESERVE_VALUES_MODE_NONE
Definition: Firtool.h:36
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetExportModuleHierarchy(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:304
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetStripDebugInfo(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:314
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetSelectDefaultInstanceChoice(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:325
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEtcDisableModuleInlining(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:269
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetIgnoreReadEnableMem(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:207