9#include "mlir/CAPI/IR.h"
10#include "mlir/CAPI/Pass.h"
11#include "mlir/CAPI/Support.h"
12#include "mlir/CAPI/Utils.h"
13#include "llvm/Support/CommandLine.h"
14#include "llvm/Support/raw_ostream.h"
35 MlirStringRef filename) {
40 CirctFirtoolFirtoolOptions options,
bool disable) {
41 unwrap(options)->setDisableUnknownAnnotations(disable);
45 CirctFirtoolFirtoolOptions options,
bool value) {
46 unwrap(options)->setDisableAnnotationsClassless(value);
50 CirctFirtoolFirtoolOptions options,
bool value) {
51 unwrap(options)->setLowerAnnotationsNoRefTypePorts(value);
55 CirctFirtoolFirtoolOptions options,
bool value) {
56 unwrap(options)->setAllowAddingPortsOnPublic(value);
60 CirctFirtoolFirtoolOptions options,
66 converted = firrtl::PreserveAggregate::PreserveMode::None;
69 converted = firrtl::PreserveAggregate::PreserveMode::OneDimVec;
72 converted = firrtl::PreserveAggregate::PreserveMode::Vec;
75 converted = firrtl::PreserveAggregate::PreserveMode::All;
79 unwrap(options)->setPreserveAggregate(converted);
88 converted = firrtl::PreserveValues::PreserveMode::Strip;
91 converted = firrtl::PreserveValues::PreserveMode::None;
94 converted = firrtl::PreserveValues::PreserveMode::Named;
97 converted = firrtl::PreserveValues::PreserveMode::All;
101 unwrap(options)->setPreserveValues(converted);
106 unwrap(options)->setEnableDebugInfo(value);
115 converted = firtool::FirtoolOptions::BuildMode::BuildModeDefault;
118 converted = firtool::FirtoolOptions::BuildMode::BuildModeDebug;
121 converted = firtool::FirtoolOptions::BuildMode::BuildModeRelease;
125 unwrap(options)->setBuildMode(converted);
130 unwrap(options)->setDisableLayerSink(value);
134 CirctFirtoolFirtoolOptions options,
bool value) {
135 unwrap(options)->setDisableOptimization(value);
139 CirctFirtoolFirtoolOptions options,
bool value) {
140 unwrap(options)->setExportChiselInterface(value);
144 CirctFirtoolFirtoolOptions options, MlirStringRef value) {
145 unwrap(options)->setChiselInterfaceOutDirectory(
unwrap(value));
150 unwrap(options)->setVbToBV(value);
155 unwrap(options)->setNoDedup(value);
164 converted = firrtl::CompanionMode::Bind;
167 converted = firrtl::CompanionMode::Instantiate;
170 converted = firrtl::CompanionMode::Drop;
174 unwrap(options)->setCompanionMode(converted);
178 CirctFirtoolFirtoolOptions options,
bool value) {
179 unwrap(options)->setDisableAggressiveMergeConnections(value);
184 unwrap(options)->setLowerMemories(value);
188 MlirStringRef value) {
194 unwrap(options)->setReplSeqMem(value);
198 MlirStringRef value) {
204 unwrap(options)->setExtractTestCode(value);
208 CirctFirtoolFirtoolOptions options,
bool value) {
209 unwrap(options)->setIgnoreReadEnableMem(value);
218 converted = firtool::FirtoolOptions::RandomKind::None;
221 converted = firtool::FirtoolOptions::RandomKind::Mem;
224 converted = firtool::FirtoolOptions::RandomKind::Reg;
227 converted = firtool::FirtoolOptions::RandomKind::All;
231 unwrap(options)->setDisableRandom(converted);
235 CirctFirtoolFirtoolOptions options, MlirStringRef value) {
236 unwrap(options)->setOutputAnnotationFilename(
unwrap(value));
240 CirctFirtoolFirtoolOptions options,
bool value) {
241 unwrap(options)->setEnableAnnotationWarning(value);
246 unwrap(options)->setAddMuxPragmas(value);
251 unwrap(options)->setVerificationFlavor(value);
255 CirctFirtoolFirtoolOptions options,
bool value) {
256 unwrap(options)->setEmitSeparateAlwaysBlocks(value);
260 CirctFirtoolFirtoolOptions options,
bool value) {
261 unwrap(options)->setEtcDisableInstanceExtraction(value);
265 CirctFirtoolFirtoolOptions options,
bool value) {
266 unwrap(options)->setEtcDisableRegisterExtraction(value);
270 CirctFirtoolFirtoolOptions options,
bool value) {
271 unwrap(options)->setEtcDisableModuleInlining(value);
275 CirctFirtoolFirtoolOptions options,
bool value) {
276 unwrap(options)->setAddVivadoRAMAddressConflictSynthesisBugWorkaround(value);
280 MlirStringRef value) {
285 MlirStringRef value) {
290 MlirStringRef value) {
295 MlirStringRef value) {
300 MlirStringRef value) {
305 CirctFirtoolFirtoolOptions options,
bool value) {
306 unwrap(options)->setExportModuleHierarchy(value);
311 unwrap(options)->setStripFirDebugInfo(value);
316 unwrap(options)->setStripDebugInfo(value);
320 CirctFirtoolFirtoolOptions options,
bool value) {
322 unwrap(options)->setDisableCSEinClasses(value);
326 CirctFirtoolFirtoolOptions options,
bool value) {
327 unwrap(options)->setSelectDefaultInstanceChoice(value);
336 CirctFirtoolFirtoolOptions options) {
343 CirctFirtoolFirtoolOptions options,
344 MlirStringRef inputFilename) {
351 CirctFirtoolFirtoolOptions options) {
357 CirctFirtoolFirtoolOptions options) {
363 CirctFirtoolFirtoolOptions options,
364 MlirStringCallback callback,
void *userData) {
366 std::make_unique<mlir::detail::CallbackOstream>(callback, userData);
373 CirctFirtoolFirtoolOptions options,
374 MlirStringRef directory) {
381 CirctFirtoolFirtoolOptions options) {
387 CirctFirtoolFirtoolOptions options,
388 MlirStringCallback callback,
void *userData) {
390 std::make_unique<mlir::detail::CallbackOstream>(callback, userData);
392 *std::move(stream)));
return wrap(CMemoryType::get(unwrap(ctx), baseType, numElements))
static EvaluatorValuePtr unwrap(OMEvaluatorValue c)
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.