CIRCT  19.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 
107 MLIR_CAPI_EXPORTED void
108 circtFirtoolOptionsSetDisableOptimization(CirctFirtoolFirtoolOptions options,
109  bool value);
110 
111 MLIR_CAPI_EXPORTED void
112 circtFirtoolOptionsSetExportChiselInterface(CirctFirtoolFirtoolOptions options,
113  bool value);
114 
116  CirctFirtoolFirtoolOptions options, MlirStringRef value);
117 
118 MLIR_CAPI_EXPORTED void
119 circtFirtoolOptionsSetVbToBv(CirctFirtoolFirtoolOptions options, bool value);
120 
121 MLIR_CAPI_EXPORTED void
122 circtFirtoolOptionsSetNoDedup(CirctFirtoolFirtoolOptions options, bool value);
123 
124 MLIR_CAPI_EXPORTED void
125 circtFirtoolOptionsSetCompanionMode(CirctFirtoolFirtoolOptions options,
127 
129  CirctFirtoolFirtoolOptions options, bool value);
130 
131 MLIR_CAPI_EXPORTED void
132 circtFirtoolOptionsSetEmitOmir(CirctFirtoolFirtoolOptions options, bool value);
133 
134 MLIR_CAPI_EXPORTED void
135 circtFirtoolOptionsSetOmirOutFile(CirctFirtoolFirtoolOptions options,
136  MlirStringRef value);
137 
138 MLIR_CAPI_EXPORTED void
139 circtFirtoolOptionsSetLowerMemories(CirctFirtoolFirtoolOptions options,
140  bool value);
141 
142 MLIR_CAPI_EXPORTED void
143 circtFirtoolOptionsSetBlackBoxRootPath(CirctFirtoolFirtoolOptions options,
144  MlirStringRef value);
145 
146 MLIR_CAPI_EXPORTED void
147 circtFirtoolOptionsSetReplSeqMem(CirctFirtoolFirtoolOptions options,
148  bool value);
149 
150 MLIR_CAPI_EXPORTED void
151 circtFirtoolOptionsSetReplSeqMemFile(CirctFirtoolFirtoolOptions options,
152  MlirStringRef value);
153 
154 MLIR_CAPI_EXPORTED void
155 circtFirtoolOptionsSetExtractTestCode(CirctFirtoolFirtoolOptions options,
156  bool value);
157 
158 MLIR_CAPI_EXPORTED void
159 circtFirtoolOptionsSetIgnoreReadEnableMem(CirctFirtoolFirtoolOptions options,
160  bool value);
161 
162 MLIR_CAPI_EXPORTED void
163 circtFirtoolOptionsSetDisableRandom(CirctFirtoolFirtoolOptions options,
164  CirctFirtoolRandomKind value);
165 
166 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetOutputAnnotationFilename(
167  CirctFirtoolFirtoolOptions options, MlirStringRef value);
168 
169 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEnableAnnotationWarning(
170  CirctFirtoolFirtoolOptions options, bool value);
171 
172 MLIR_CAPI_EXPORTED void
173 circtFirtoolOptionsSetAddMuxPragmas(CirctFirtoolFirtoolOptions options,
174  bool value);
175 
176 MLIR_CAPI_EXPORTED void
177 circtFirtoolOptionsSetVerificationFlavor(CirctFirtoolFirtoolOptions options,
179 
180 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEmitSeparateAlwaysBlocks(
181  CirctFirtoolFirtoolOptions options, bool value);
182 
184  CirctFirtoolFirtoolOptions options, bool value);
185 
187  CirctFirtoolFirtoolOptions options, bool value);
188 
189 MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEtcDisableModuleInlining(
190  CirctFirtoolFirtoolOptions options, bool value);
191 
192 MLIR_CAPI_EXPORTED void
194  CirctFirtoolFirtoolOptions options, bool value);
195 
196 MLIR_CAPI_EXPORTED void
197 circtFirtoolOptionsSetCkgModuleName(CirctFirtoolFirtoolOptions options,
198  MlirStringRef value);
199 
200 MLIR_CAPI_EXPORTED void
201 circtFirtoolOptionsSetCkgInputName(CirctFirtoolFirtoolOptions options,
202  MlirStringRef value);
203 
204 MLIR_CAPI_EXPORTED void
205 circtFirtoolOptionsSetCkgOutputName(CirctFirtoolFirtoolOptions options,
206  MlirStringRef value);
207 
208 MLIR_CAPI_EXPORTED void
209 circtFirtoolOptionsSetCkgEnableName(CirctFirtoolFirtoolOptions options,
210  MlirStringRef value);
211 
212 MLIR_CAPI_EXPORTED void
213 circtFirtoolOptionsSetCkgTestEnableName(CirctFirtoolFirtoolOptions options,
214  MlirStringRef value);
215 
216 MLIR_CAPI_EXPORTED void
217 circtFirtoolOptionsSetExportModuleHierarchy(CirctFirtoolFirtoolOptions options,
218  bool value);
219 
220 MLIR_CAPI_EXPORTED void
221 circtFirtoolOptionsSetStripFirDebugInfo(CirctFirtoolFirtoolOptions options,
222  bool value);
223 
224 MLIR_CAPI_EXPORTED void
225 circtFirtoolOptionsSetStripDebugInfo(CirctFirtoolFirtoolOptions options,
226  bool value);
227 
228 //===----------------------------------------------------------------------===//
229 // Populate API.
230 //===----------------------------------------------------------------------===//
231 
232 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulatePreprocessTransforms(
233  MlirPassManager pm, CirctFirtoolFirtoolOptions options);
234 
235 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateCHIRRTLToLowFIRRTL(
236  MlirPassManager pm, CirctFirtoolFirtoolOptions options,
237  MlirStringRef inputFilename);
238 
239 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateLowFIRRTLToHW(
240  MlirPassManager pm, CirctFirtoolFirtoolOptions options);
241 
242 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateHWToSV(
243  MlirPassManager pm, CirctFirtoolFirtoolOptions options);
244 
245 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateExportVerilog(
246  MlirPassManager pm, CirctFirtoolFirtoolOptions options,
247  MlirStringCallback callback, void *userData);
248 
249 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateExportSplitVerilog(
250  MlirPassManager pm, CirctFirtoolFirtoolOptions options,
251  MlirStringRef directory);
252 
253 MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateFinalizeIR(
254  MlirPassManager pm, CirctFirtoolFirtoolOptions options);
255 
256 #ifdef __cplusplus
257 }
258 #endif
259 
260 #endif // CIRCT_C_FIRTOOL_FIRTOOL_H
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetLowerMemories(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:187
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetOutputAnnotationFilename(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:239
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:289
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:299
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateLowFIRRTLToHW(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:344
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:284
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetCkgOutputName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:294
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEmitSeparateAlwaysBlocks(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:259
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetExportChiselInterface(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:133
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetStripFirDebugInfo(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:314
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:279
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateCHIRRTLToLowFIRRTL(MlirPassManager pm, CirctFirtoolFirtoolOptions options, MlirStringRef inputFilename)
Definition: Firtool.cpp:336
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEmitOmir(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:177
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetBlackBoxRootPath(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:192
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetNoDedup(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:148
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetChiselInterfaceOutDirectory(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:138
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:304
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableOptimization(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:128
#define DEFINE_C_API_STRUCT(name, storage)
Definition: Firtool.h:15
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetCompanionMode(CirctFirtoolFirtoolOptions options, CirctFirtoolCompanionMode value)
Definition: Firtool.cpp:153
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEtcDisableRegisterExtraction(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:269
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 void circtFirtoolOptionsSetOmirOutFile(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition: Firtool.cpp:182
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulatePreprocessTransforms(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:329
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:366
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableAggressiveMergeConnections(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:172
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:202
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetExtractTestCode(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:207
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateHWToSV(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:350
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetVbToBv(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:143
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetAddMuxPragmas(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:249
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:356
MLIR_CAPI_EXPORTED CirctFirtoolFirtoolOptions circtFirtoolOptionsCreateDefault(void)
MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateFinalizeIR(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition: Firtool.cpp:374
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEtcDisableInstanceExtraction(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:264
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetReplSeqMem(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:197
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetDisableRandom(CirctFirtoolFirtoolOptions options, CirctFirtoolRandomKind value)
Definition: Firtool.cpp:217
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:244
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:309
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetStripDebugInfo(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:319
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetEtcDisableModuleInlining(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:274
MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetIgnoreReadEnableMem(CirctFirtoolFirtoolOptions options, bool value)
Definition: Firtool.cpp:212