CIRCT 20.0.0git
Loading...
Searching...
No Matches
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
12extern "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
21DEFINE_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)
54
55// NOLINTNEXTLINE(modernize-use-using)
62
63// NOLINTNEXTLINE(modernize-use-using)
70
71MLIR_CAPI_EXPORTED CirctFirtoolFirtoolOptions
73MLIR_CAPI_EXPORTED void
74circtFirtoolOptionsDestroy(CirctFirtoolFirtoolOptions options);
75
76MLIR_CAPI_EXPORTED void
77circtFirtoolOptionsSetOutputFilename(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
91MLIR_CAPI_EXPORTED void circtFirtoolOptionsSetPreserveAggregate(
92 CirctFirtoolFirtoolOptions options,
94
95MLIR_CAPI_EXPORTED void
96circtFirtoolOptionsSetPreserveValues(CirctFirtoolFirtoolOptions options,
98
99MLIR_CAPI_EXPORTED void
100circtFirtoolOptionsSetEnableDebugInfo(CirctFirtoolFirtoolOptions options,
101 bool value);
102
103MLIR_CAPI_EXPORTED void
104circtFirtoolOptionsSetBuildMode(CirctFirtoolFirtoolOptions options,
106MLIR_CAPI_EXPORTED void
107circtFirtoolOptionsSetDisableLayerSink(CirctFirtoolFirtoolOptions options,
108 bool value);
109
110MLIR_CAPI_EXPORTED void
111circtFirtoolOptionsSetDisableOptimization(CirctFirtoolFirtoolOptions options,
112 bool value);
113
114MLIR_CAPI_EXPORTED void
115circtFirtoolOptionsSetExportChiselInterface(CirctFirtoolFirtoolOptions options,
116 bool value);
117
119 CirctFirtoolFirtoolOptions options, MlirStringRef value);
120
121MLIR_CAPI_EXPORTED void
122circtFirtoolOptionsSetVbToBv(CirctFirtoolFirtoolOptions options, bool value);
123
124MLIR_CAPI_EXPORTED void
125circtFirtoolOptionsSetNoDedup(CirctFirtoolFirtoolOptions options, bool value);
126
127MLIR_CAPI_EXPORTED void
128circtFirtoolOptionsSetCompanionMode(CirctFirtoolFirtoolOptions options,
130
132 CirctFirtoolFirtoolOptions options, bool value);
133
134MLIR_CAPI_EXPORTED void
135circtFirtoolOptionsSetLowerMemories(CirctFirtoolFirtoolOptions options,
136 bool value);
137
138MLIR_CAPI_EXPORTED void
139circtFirtoolOptionsSetBlackBoxRootPath(CirctFirtoolFirtoolOptions options,
140 MlirStringRef value);
141
142MLIR_CAPI_EXPORTED void
143circtFirtoolOptionsSetReplSeqMem(CirctFirtoolFirtoolOptions options,
144 bool value);
145
146MLIR_CAPI_EXPORTED void
147circtFirtoolOptionsSetReplSeqMemFile(CirctFirtoolFirtoolOptions options,
148 MlirStringRef value);
149
150MLIR_CAPI_EXPORTED void
151circtFirtoolOptionsSetExtractTestCode(CirctFirtoolFirtoolOptions options,
152 bool value);
153
154MLIR_CAPI_EXPORTED void
155circtFirtoolOptionsSetIgnoreReadEnableMem(CirctFirtoolFirtoolOptions options,
156 bool value);
157
158MLIR_CAPI_EXPORTED void
159circtFirtoolOptionsSetDisableRandom(CirctFirtoolFirtoolOptions options,
161
163 CirctFirtoolFirtoolOptions options, MlirStringRef value);
164
166 CirctFirtoolFirtoolOptions options, bool value);
167
168MLIR_CAPI_EXPORTED void
169circtFirtoolOptionsSetAddMuxPragmas(CirctFirtoolFirtoolOptions options,
170 bool value);
171
172MLIR_CAPI_EXPORTED void
173circtFirtoolOptionsSetVerificationFlavor(CirctFirtoolFirtoolOptions options,
175
177 CirctFirtoolFirtoolOptions options, bool value);
178
180 CirctFirtoolFirtoolOptions options, bool value);
181
183 CirctFirtoolFirtoolOptions options, bool value);
184
186 CirctFirtoolFirtoolOptions options, bool value);
187
188MLIR_CAPI_EXPORTED void
190 CirctFirtoolFirtoolOptions options, bool value);
191
192MLIR_CAPI_EXPORTED void
193circtFirtoolOptionsSetCkgModuleName(CirctFirtoolFirtoolOptions options,
194 MlirStringRef value);
195
196MLIR_CAPI_EXPORTED void
197circtFirtoolOptionsSetCkgInputName(CirctFirtoolFirtoolOptions options,
198 MlirStringRef value);
199
200MLIR_CAPI_EXPORTED void
201circtFirtoolOptionsSetCkgOutputName(CirctFirtoolFirtoolOptions options,
202 MlirStringRef value);
203
204MLIR_CAPI_EXPORTED void
205circtFirtoolOptionsSetCkgEnableName(CirctFirtoolFirtoolOptions options,
206 MlirStringRef value);
207
208MLIR_CAPI_EXPORTED void
209circtFirtoolOptionsSetCkgTestEnableName(CirctFirtoolFirtoolOptions options,
210 MlirStringRef value);
211
212MLIR_CAPI_EXPORTED void
213circtFirtoolOptionsSetExportModuleHierarchy(CirctFirtoolFirtoolOptions options,
214 bool value);
215
216MLIR_CAPI_EXPORTED void
217circtFirtoolOptionsSetStripFirDebugInfo(CirctFirtoolFirtoolOptions options,
218 bool value);
219
220MLIR_CAPI_EXPORTED void
221circtFirtoolOptionsSetStripDebugInfo(CirctFirtoolFirtoolOptions options,
222 bool value);
223
224MLIR_CAPI_EXPORTED void
225circtFirtoolOptionsSetDisableCSEinClasses(CirctFirtoolFirtoolOptions options,
226 bool value);
227
229 CirctFirtoolFirtoolOptions options, bool value);
230
231//===----------------------------------------------------------------------===//
232// Populate API.
233//===----------------------------------------------------------------------===//
234
235MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulatePreprocessTransforms(
236 MlirPassManager pm, CirctFirtoolFirtoolOptions options);
237
238MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateCHIRRTLToLowFIRRTL(
239 MlirPassManager pm, CirctFirtoolFirtoolOptions options,
240 MlirStringRef inputFilename);
241
242MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateLowFIRRTLToHW(
243 MlirPassManager pm, CirctFirtoolFirtoolOptions options);
244
245MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateHWToSV(
246 MlirPassManager pm, CirctFirtoolFirtoolOptions options);
247
248MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateExportVerilog(
249 MlirPassManager pm, CirctFirtoolFirtoolOptions options,
250 MlirStringCallback callback, void *userData);
251
252MLIR_CAPI_EXPORTED MlirLogicalResult circtFirtoolPopulateExportSplitVerilog(
253 MlirPassManager pm, CirctFirtoolFirtoolOptions options,
254 MlirStringRef directory);
255
256MLIR_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