CIRCT 24.0.0git
Loading...
Searching...
No Matches
Firtool.cpp
Go to the documentation of this file.
1//===- Firtool.cpp - Definitions for the firtool pipeline setup -*- 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
20#include "mlir/Transforms/Passes.h"
21#include "llvm/Support/FileSystem.h"
22#include "llvm/Support/Path.h"
23
24using namespace llvm;
25using namespace circt;
26
27LogicalResult firtool::populatePreprocessTransforms(mlir::PassManager &pm,
28 const FirtoolOptions &opt) {
29 pm.nest<firrtl::CircuitOp>().addPass(
30 firrtl::createCheckRecursiveInstantiation());
31 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createCheckLayers());
32 // Legalize away "open" aggregates to hw-only versions.
33 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerOpenAggs());
34
35 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createResolvePaths());
36
37 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerFIRRTLAnnotations(
38 {/*ignoreAnnotationClassless=*/opt.shouldDisableClasslessAnnotations(),
39 /*ignoreAnnotationUnknown=*/opt.shouldDisableUnknownAnnotations(),
40 /*noRefTypePorts=*/opt.shouldLowerNoRefTypePortAnnotations()}));
41
42 if (opt.shouldEnableDebugInfo())
43 pm.nest<firrtl::CircuitOp>().addNestedPass<firrtl::FModuleOp>(
44 firrtl::createMaterializeDebugInfo());
45
46 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerIntmodules(
47 {/*fixupEICGWrapper=*/opt.shouldFixupEICGWrapper()}));
48 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
49 firrtl::createLowerIntrinsics());
50
51 return success();
52}
53
54LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm,
55 const FirtoolOptions &opt) {
56 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerSignatures());
57
58 // This pass is _not_ idempotent. It preserves its controlling annotation for
59 // use by ExtractInstances. This pass should be run before ExtractInstances.
60 //
61 // TODO: This pass should be deleted.
62 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInjectDUTHierarchy());
63
64 if (!opt.shouldDisableOptimization()) {
66 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
67 mlir::createCSEPass());
68 else
69 pm.nest<firrtl::CircuitOp>().nestAny().addPass(mlir::createCSEPass());
70 }
71
72 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
73 firrtl::createPassiveWires());
74
75 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
76 firrtl::createDropName({/*preserveMode=*/opt.getPreserveMode()}));
77
78 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
79 firrtl::createLowerCHIRRTLPass());
80
81 // Run LowerMatches before InferWidths, as the latter does not support the
82 // match statement, but it does support what they lower to.
83 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
84 firrtl::createLowerMatches());
85
86 // Width inference creates canonicalization opportunities.
87 firrtl::InferWidthsOptions inferWidthsOptions;
88 inferWidthsOptions.warnOnTruncation = opt.shouldWarnOnTruncation();
89 pm.nest<firrtl::CircuitOp>().addPass(
90 firrtl::createInferWidths(inferWidthsOptions));
91 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
92 firrtl::createLowerSizeOf());
93
94 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInferResets());
95 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createFullReset());
96
97 // TODO: Move this to the same location as SpecializeLayers.
98 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createSpecializeOption(
99 {/*selectDefaultInstanceChoice*/ opt
101
102 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createDropConst());
103
104 if (opt.shouldDedup()) {
105 firrtl::DedupOptions opts;
106 opts.dedupClasses = opt.shouldDedupClasses();
107 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createDedup(opts));
108 }
109
110 if (opt.shouldConvertVecOfBundle()) {
111 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createLowerFIRRTLTypes(
112 {/*preserveAggregate=*/firrtl::PreserveAggregate::All,
113 /*preserveMemories*/ firrtl::PreserveAggregate::All}));
114 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createVBToBV());
115 }
116
117 if (!opt.shouldLowerMemories())
118 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
119 firrtl::createFlattenMemory());
120
121 // The input mlir file could be firrtl dialect so we might need to clean
122 // things up.
123 // pm.addNestedPass<firrtl::CircuitOp>(firrtl::createLowerSignaturesPass());
124 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createLowerFIRRTLTypes(
125 {/*preserveAggregate=*/opt.getPreserveAggregate(),
126 /*preserveMemory=*/firrtl::PreserveAggregate::None}));
127
128 {
129 auto &modulePM = pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>();
130 modulePM.addPass(firrtl::createExpandWhens());
131 modulePM.addPass(firrtl::createSFCCompat());
132 }
133
134 // InferDomains runs after ExpandWhens because FIRRTL allows for last-connect
135 // semantics and users have historically relied on this behavior to set
136 // default connections that are then overridden later. If this pass is run
137 // before ExpandWhens, then users can get errors if they rely on last-connect
138 // semantics.
139 if (auto mode = FirtoolOptions::toInferDomainsPassMode(opt.getDomainMode())) {
140 firrtl::InferDomainsOptions passOptions;
141 passOptions.mode = *mode;
142 passOptions.skippedDomains.assign(opt.getSkippedDomains().begin(),
143 opt.getSkippedDomains().end());
144 pm.nest<firrtl::CircuitOp>().addPass(
145 firrtl::createInferDomains(passOptions));
146 }
147
148 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createCheckCombLoops());
149
150 // Must run this pass after all diagnostic passes have run, otherwise it can
151 // hide errors.
152 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createSpecializeLayers());
153
154 // Run after inference, layer specialization.
156 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createProbesToSignals());
157
158 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInliner());
159
160 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
161 firrtl::createLayerMerge());
162
163 // Preset the random initialization parameters for each module. The current
164 // implementation assumes it can run at a time where every register is
165 // currently in the final module it will be emitted in, all registers have
166 // been created, and no registers have yet been removed.
167 if (opt.isRandomEnabled(FirtoolOptions::RandomKind::Reg))
168 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
169 firrtl::createRandomizeRegisterInit());
170
171 // If we parsed a FIRRTL file and have optimizations enabled, clean it up.
172 if (!opt.shouldDisableOptimization())
173 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
175
176 // Run the infer-rw pass, which merges read and write ports of a memory with
177 // mutually exclusive enables.
178 if (!opt.shouldDisableOptimization())
179 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
180 firrtl::createInferReadWrite());
181
183 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerMemory());
184
185 if (!opt.shouldDisableOptimization())
186 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createIMConstProp());
187
188 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createAddSeqMemPorts());
189
190 pm.addPass(firrtl::createCreateSiFiveMetadata(
191 {/*replSeqMem=*/opt.shouldReplaceSequentialMemories(),
192 /*replSeqMemFile=*/opt.getReplaceSequentialMemoriesFile().str()}));
193
194 // This pass must be run after InjectDUTHierarchy.
195 //
196 // TODO: This pass should be deleted along with InjectDUTHierarchy.
197 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createExtractInstances());
198
199 // Run SymbolDCE as late as possible, but before InnerSymbolDCE. This is for
200 // hierpathop's and just for general cleanup.
201 pm.addNestedPass<firrtl::CircuitOp>(mlir::createSymbolDCEPass());
202
203 // Run InnerSymbolDCE as late as possible, but before IMDCE.
204 pm.addPass(firrtl::createInnerSymbolDCE());
205
206 // The above passes, IMConstProp in particular, introduce additional
207 // canonicalization opportunities that we should pick up here before we
208 // proceed to output-specific pipelines.
209 if (!opt.shouldDisableOptimization()) {
211 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
212 circt::firrtl::createEliminateWires());
213 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
215 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
216 circt::firrtl::createRegisterOptimizer());
217 // Re-run IMConstProp to propagate constants produced by register
218 // optimizations.
219 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createIMConstProp());
220 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
222 pm.addPass(firrtl::createIMDeadCodeElim());
224 pm.nest<firrtl::CircuitOp>().addPass(
225 firrtl::createAnnotateInputOnlyModules());
226 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInliner());
227 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
229 }
230 }
231
232 // Always run this, required for legalization.
233 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
234 firrtl::createMergeConnections(
235 {/*enableAggressiveMergin=*/!opt
237
238 if (!opt.shouldDisableOptimization())
239 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
240 firrtl::createVectorization());
241
242 return success();
243}
244
245LogicalResult firtool::populateLowFIRRTLToHW(mlir::PassManager &pm,
246 const FirtoolOptions &opt,
247 StringRef inputFilename) {
248 // Populate instance macros for instance choice operations before lowering to
249 // HW.
250 pm.nest<firrtl::CircuitOp>().addPass(
251 firrtl::createPopulateInstanceChoiceSymbols());
252
253 // Run layersink immediately before LowerXMR. LowerXMR will "freeze" the
254 // location of probed objects by placing symbols on them. Run layersink first
255 // so that probed objects can be sunk if possible.
257 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLayerSink());
258
259 // Lower the ref.resolve and ref.send ops and remove the RefType ports.
260 // LowerToHW cannot handle RefType so, this pass must be run to remove all
261 // RefType ports and ops.
262 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerXMR());
263
264 // Layer lowering passes. Move operations into layers when possible and
265 // remove layers by converting them to other constructs. This lowering
266 // process can create a few optimization opportunities.
267 //
268 // TODO: Improve LowerLayers to avoid the need for canonicalization. See:
269 // https://github.com/llvm/circt/issues/7896
270
271 pm.nest<firrtl::CircuitOp>().addPass(
272 firrtl::createLowerLayers({opt.getEmitAllBindFiles()}));
273 if (!opt.shouldDisableOptimization())
274 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
276
277 auto outputFilename = opt.getOutputFilename();
278 if (outputFilename == "-")
279 outputFilename = "";
280
281 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createAssignOutputDirs(
282 {/*outputDirOption=*/outputFilename.str()}));
283
284 // Run passes to resolve Grand Central features. This should run before
285 // BlackBoxReader because Grand Central needs to inform BlackBoxReader where
286 // certain black boxes should be placed. Note: all Grand Central Taps related
287 // collateral is resolved entirely by LowerAnnotations.
288 // Run this after output directories are (otherwise) assigned,
289 // so generated interfaces can be appropriately marked.
290 pm.addNestedPass<firrtl::CircuitOp>(
291 firrtl::createGrandCentral({/*companionMode=*/opt.getCompanionMode(),
292 /*noViews*/ opt.getNoViews()}));
293
294 // Read black box source files into the IR.
295 StringRef blackBoxRoot = opt.getBlackBoxRootPath().empty()
296 ? llvm::sys::path::parent_path(inputFilename)
297 : opt.getBlackBoxRootPath();
298 pm.nest<firrtl::CircuitOp>().addPass(
299 firrtl::createBlackBoxReader({/*inputPrefix=*/blackBoxRoot.str()}));
300
301 // Remove TraceAnnotations and write their updated paths to an output
302 // annotation file.
303 pm.nest<firrtl::CircuitOp>().addPass(
304 firrtl::createResolveTraces({opt.getOutputAnnotationFilename().str()}));
305
306 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerDPI());
307 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerDomains());
308 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerClasses());
309
310 // Check for static asserts.
311 pm.nest<firrtl::CircuitOp>().addPass(circt::firrtl::createLint(
312 {/*lintStaticAsserts=*/opt.getLintStaticAsserts(),
313 /*lintXmrsInDesign=*/opt.getLintXmrsInDesign()}));
314
317 opt.shouldLowerToCore()));
318
319 if (!opt.shouldDisableOptimization()) {
320 auto &modulePM = pm.nest<hw::HWModuleOp>();
321 modulePM.addPass(mlir::createCSEPass());
322 modulePM.addPass(createSimpleCanonicalizerPass());
323 }
324
325 // Check inner symbols and inner refs.
326 pm.addPass(hw::createVerifyInnerRefNamespace());
327
328 // Run the verif op verification pass
329 pm.addNestedPass<hw::HWModuleOp>(verif::createVerifyClockedAssertLikePass());
330
331 return success();
332}
333
334LogicalResult firtool::populateHWToSV(mlir::PassManager &pm,
335 const FirtoolOptions &opt) {
336 pm.nestAny().addPass(verif::createStripContractsPass());
337 pm.addPass(verif::createLowerTestsPass());
338 pm.addPass(
339 verif::createLowerSymbolicValuesPass({opt.getSymbolicValueLowering()}));
340
341 pm.addPass(seq::createExternalizeClockGate(opt.getClockGateOptions()));
342 pm.addPass(circt::createLowerSimToSVPass());
344 {/*disableRegRandomization=*/!opt.isRandomEnabled(
345 FirtoolOptions::RandomKind::Reg),
346 /*disableMemRandomization=*/
347 !opt.isRandomEnabled(FirtoolOptions::RandomKind::Mem),
348 /*emitSeparateAlwaysBlocks=*/
350 pm.addNestedPass<hw::HWModuleOp>(createLowerVerifToSVPass());
351 pm.addPass(seq::createHWMemSimImpl(
352 {/*disableMemRandomization=*/!opt.isRandomEnabled(
353 FirtoolOptions::RandomKind::Mem),
354 /*disableRegRandomization=*/
355 !opt.isRandomEnabled(FirtoolOptions::RandomKind::Reg),
356 /*replSeqMem=*/opt.shouldReplaceSequentialMemories(),
357 /*readEnableMode=*/opt.shouldIgnoreReadEnableMemories()
358 ? seq::ReadEnableMode::Ignore
359 : seq::ReadEnableMode::Undefined,
360 /*addMuxPragmas=*/opt.shouldAddMuxPragmas(),
361 /*addVivadoRAMAddressConflictSynthesisBugWorkaround=*/
363
364 // If enabled, run the optimizer.
365 if (!opt.shouldDisableOptimization()) {
366 auto &modulePM = pm.nest<hw::HWModuleOp>();
367 modulePM.addPass(mlir::createCSEPass());
368 modulePM.addPass(createSimpleCanonicalizerPass());
369 modulePM.addPass(mlir::createCSEPass());
370 modulePM.addPass(sv::createHWCleanup(
371 {/*mergeAlwaysBlocks=*/!opt.shouldEmitSeparateAlwaysBlocks()}));
372 }
373
374 // Check inner symbols and inner refs.
375 pm.addPass(hw::createVerifyInnerRefNamespace());
376
377 return success();
378}
379
380namespace detail {
381LogicalResult
383 const firtool::FirtoolOptions &opt) {
384
385 // Run the verif op verification pass
386 pm.addNestedPass<hw::HWModuleOp>(verif::createVerifyClockedAssertLikePass());
387
388 // Legalize unsupported operations within the modules.
389 pm.nest<hw::HWModuleOp>().addPass(sv::createHWLegalizeModules());
390
391 // Tidy up the IR to improve verilog emission quality.
392 if (!opt.shouldDisableOptimization())
393 pm.nest<hw::HWModuleOp>().addPass(sv::createPrettifyVerilog());
394
395 if (opt.shouldStripFirDebugInfo())
396 pm.addPass(circt::createStripDebugInfoWithPredPass([](mlir::Location loc) {
397 if (auto fileLoc = dyn_cast<FileLineColLoc>(loc))
398 return fileLoc.getFilename().getValue().ends_with(".fir");
399 return false;
400 }));
401
402 if (opt.shouldStripDebugInfo())
404 [](mlir::Location loc) { return true; }));
405
406 // Emit module and testbench hierarchy JSON files.
408 pm.addPass(sv::createHWExportModuleHierarchy());
409
410 // Check inner symbols and inner refs.
411 pm.addPass(hw::createVerifyInnerRefNamespace());
412
413 return success();
414}
415} // namespace detail
416
417LogicalResult
418firtool::populateExportVerilog(mlir::PassManager &pm, const FirtoolOptions &opt,
419 std::unique_ptr<llvm::raw_ostream> os) {
421 return failure();
422
423 pm.addPass(createExportVerilogPass(std::move(os)));
424 return success();
425}
426
427LogicalResult firtool::populateExportVerilog(mlir::PassManager &pm,
428 const FirtoolOptions &opt,
429 llvm::raw_ostream &os) {
431 return failure();
432
433 pm.addPass(createExportVerilogPass(os));
434 return success();
435}
436
437LogicalResult firtool::populateExportSplitVerilog(mlir::PassManager &pm,
438 const FirtoolOptions &opt,
439 llvm::StringRef directory) {
441 return failure();
442
443 pm.addPass(createExportSplitVerilogPass(directory));
444 return success();
445}
446
447LogicalResult firtool::populateFinalizeIR(mlir::PassManager &pm,
448 const FirtoolOptions &opt) {
449 pm.addPass(firrtl::createFinalizeIR());
450 pm.addPass(om::createFreezePathsPass());
451 om::ElaborateObjectOptions options;
452 options.allPublicClasses = true;
453 options.allowUnevaluated = true;
454 pm.addPass(om::createElaborateObject(options));
455 // TODO: Add SymbolDCE to elimiate unused private classes once after we
456 // stopped using private classes.
457
458 return success();
459}
460
461/// BTOR2 emission pipeline, triggered with `--btor2` flag.
462LogicalResult firtool::populateHWToBTOR2(mlir::PassManager &pm,
463 const FirtoolOptions &opt,
464 llvm::raw_ostream &os) {
465 auto &mpm = pm.nest<hw::HWModuleOp>();
466 // Lower all supported `ltl` ops
467 mpm.addPass(circt::createLowerLTLToCorePass());
468 // LTLToCore can generate shiftreg which should be lowered before emission
469 mpm.addPass(circt::seq::createLowerSeqShiftReg());
470 // ShiftReg Lowering generates compreg.ce, which we don't support, so lower
471 mpm.addPass(circt::seq::createLowerSeqCompRegCE());
472 // Do final formal specific lowerings, e.g. inline wires eagerly
473 mpm.addPass(circt::verif::createPrepareForFormalPass());
474 pm.addPass(circt::hw::createFlattenModules());
475 pm.addPass(circt::createConvertHWToBTOR2Pass(os));
476 return success();
477}
478
479//===----------------------------------------------------------------------===//
480// FIRTOOL CommandLine Options
481//===----------------------------------------------------------------------===//
482
483namespace {
484/// This class contains command line options that can be used to initialize
485/// various bits of a Firtool pipeline. This uses a class wrapper to avoid the
486/// need for global command line options.
487class FirtoolCmdOptions {
488public:
489 llvm::cl::opt<std::string> outputFilename{
490 "o",
491 llvm::cl::desc("Output filename, or directory for split output"),
492 llvm::cl::value_desc("filename"),
493 llvm::cl::init("-"),
494 };
495
496 llvm::cl::opt<bool> disableAnnotationsUnknown{
497 "disable-annotation-unknown",
498 llvm::cl::desc("Ignore unknown annotations when parsing"),
499 llvm::cl::init(false)};
500
501 llvm::cl::opt<bool> disableAnnotationsClassless{
502 "disable-annotation-classless",
503 llvm::cl::desc("Ignore annotations without a class when parsing"),
504 llvm::cl::init(false)};
505
506 llvm::cl::opt<bool> lowerAnnotationsNoRefTypePorts{
507 "lower-annotations-no-ref-type-ports",
508 llvm::cl::desc(
509 "Create real ports instead of ref type ports when resolving "
510 "wiring problems inside the LowerAnnotations pass"),
511 llvm::cl::init(false), llvm::cl::Hidden};
512
513 llvm::cl::opt<bool> probesToSignals{
514 "probes-to-signals",
515 llvm::cl::desc("Convert probes to non-probe signals"),
516 llvm::cl::init(false), llvm::cl::Hidden};
517
519 preserveAggregate{
520 "preserve-aggregate",
521 llvm::cl::desc("Specify input file format:"),
522 llvm::cl::values(
524 "Preserve no aggregate"),
526 "Preserve only 1d vectors of ground type"),
528 "Preserve only vectors"),
530 "Preserve vectors and bundles")),
532 };
533
535 "preserve-values",
536 llvm::cl::desc("Specify the values which can be optimized away"),
537 llvm::cl::values(
538 clEnumValN(firrtl::PreserveValues::Strip, "strip",
539 "Strip all names. No name is preserved"),
540 clEnumValN(firrtl::PreserveValues::None, "none",
541 "Names could be preserved by best-effort unlike `strip`"),
542 clEnumValN(firrtl::PreserveValues::Named, "named",
543 "Preserve values with meaningful names"),
544 clEnumValN(firrtl::PreserveValues::All, "all",
545 "Preserve all values")),
546 llvm::cl::init(firrtl::PreserveValues::None)};
547
548 llvm::cl::opt<bool> enableDebugInfo{
549 "g", llvm::cl::desc("Enable the generation of debug information"),
550 llvm::cl::init(false)};
551
552 // Build mode options.
554 "O", llvm::cl::desc("Controls how much optimization should be performed"),
555 llvm::cl::values(clEnumValN(firtool::FirtoolOptions::BuildModeDebug,
556 "debug",
557 "Compile with only necessary optimizations"),
559 "release", "Compile with optimizations")),
561
562 llvm::cl::opt<bool> disableLayerSink{"disable-layer-sink",
563 llvm::cl::desc("Disable layer sink"),
564 cl::init(false)};
565
566 llvm::cl::opt<bool> disableOptimization{
567 "disable-opt",
568 llvm::cl::desc("Disable optimizations"),
569 };
570
571 llvm::cl::opt<bool> vbToBV{
572 "vb-to-bv",
573 llvm::cl::desc("Transform vectors of bundles to bundles of vectors"),
574 llvm::cl::init(false)};
575
576 llvm::cl::opt<bool> noDedup{
577 "no-dedup",
578 llvm::cl::desc("Disable deduplication of structurally identical modules"),
579 llvm::cl::init(false)};
580
581 llvm::cl::opt<bool> dedupClasses{
582 "dedup-classes",
583 llvm::cl::desc(
584 "Deduplicate FIRRTL classes, violating their nominal typing"),
585 llvm::cl::init(true)};
586
588 "grand-central-companion-mode",
589 llvm::cl::desc("Specifies the handling of Grand Central companions"),
590 ::llvm::cl::values(
591 clEnumValN(firrtl::CompanionMode::Bind, "bind",
592 "Lower companion instances to SystemVerilog binds"),
593 clEnumValN(firrtl::CompanionMode::Instantiate, "instantiate",
594 "Instantiate companions in the design"),
595 clEnumValN(firrtl::CompanionMode::Drop, "drop",
596 "Remove companions from the design")),
597 llvm::cl::init(firrtl::CompanionMode::Bind),
598 llvm::cl::Hidden,
599 };
600
601 llvm::cl::opt<bool> noViews{
602 "no-views",
603 llvm::cl::desc(
604 "Disable lowering of FIRRTL view intrinsics (delete them instead)"),
605 llvm::cl::init(false),
606 };
607
608 llvm::cl::opt<bool> disableAggressiveMergeConnections{
609 "disable-aggressive-merge-connections",
610 llvm::cl::desc(
611 "Disable aggressive merge connections (i.e. merge all field-level "
612 "connections into bulk connections)"),
613 llvm::cl::init(false)};
614
615 llvm::cl::opt<bool> lowerMemories{
616 "lower-memories",
617 llvm::cl::desc("Lower memories to have memories with masks as an "
618 "array with one memory per ground type"),
619 llvm::cl::init(false)};
620
621 llvm::cl::opt<std::string> blackBoxRootPath{
622 "blackbox-path",
623 llvm::cl::desc(
624 "Optional path to use as the root of black box annotations"),
625 llvm::cl::value_desc("path"),
626 llvm::cl::init(""),
627 };
628
629 llvm::cl::opt<bool> replSeqMem{
630 "repl-seq-mem",
631 llvm::cl::desc("Replace the seq mem for macro replacement and emit "
632 "relevant metadata"),
633 llvm::cl::init(false)};
634
635 llvm::cl::opt<std::string> replSeqMemFile{
636 "repl-seq-mem-file", llvm::cl::desc("File name for seq mem metadata"),
637 llvm::cl::init("")};
638
639 llvm::cl::opt<bool> ignoreReadEnableMem{
640 "ignore-read-enable-mem",
641 llvm::cl::desc("Ignore the read enable signal, instead of "
642 "assigning X on read disable"),
643 llvm::cl::init(false)};
644
645 firtool::FirtoolOptions::RandomKind disableRandomValue =
646 firtool::FirtoolOptions::RandomKind::None;
647
648 // Make these options (and their grouping category) inaccessible as their
649 // values are not intended to be used directly. These change a lattice of
650 // randomization disable settings and directly accessing the command line
651 // option the user provided is not useful.
652private:
653 llvm::cl::OptionCategory randomizationCategory{
654 "Disable random initialization code (may break semantics!)"};
655
656 llvm::cl::opt<bool> disableMemRandom{
657 "disable-mem-randomization",
658 llvm::cl::desc("Disable emission of memory randomization code"),
659 llvm::cl::cat(randomizationCategory), llvm::cl::ValueDisallowed,
660 llvm::cl::callback([&](const bool &) {
661 disableRandomValue = firtool::FirtoolOptions::mergeRandomKind(
662 disableRandomValue, firtool::FirtoolOptions::RandomKind::Mem);
663 })};
664
665 llvm::cl::opt<bool> disableRegRandom{
666 "disable-reg-randomization",
667 llvm::cl::desc("Disable emission of register randomization code"),
668 llvm::cl::cat(randomizationCategory), llvm::cl::ValueDisallowed,
669 llvm::cl::callback([&](const bool &) {
670 disableRandomValue = firtool::FirtoolOptions::mergeRandomKind(
671 disableRandomValue, firtool::FirtoolOptions::RandomKind::Reg);
672 })};
673
674 llvm::cl::opt<bool> disableAllRandom{
675 "disable-all-randomization",
676 llvm::cl::desc("Disable emission of all randomization code"),
677 llvm::cl::cat(randomizationCategory), llvm::cl::ValueDisallowed,
678 llvm::cl::callback([&](const bool &) {
679 disableRandomValue = firtool::FirtoolOptions::RandomKind::All;
680 })};
681
682public:
683 llvm::cl::opt<std::string> outputAnnotationFilename{
684 "output-annotation-file",
685 llvm::cl::desc("Optional output annotation file"),
686 llvm::cl::CommaSeparated, llvm::cl::value_desc("filename")};
687
688 llvm::cl::opt<bool> enableAnnotationWarning{
689 "warn-on-unprocessed-annotations",
690 llvm::cl::desc(
691 "Warn about annotations that were not removed by lower-to-hw"),
692 llvm::cl::init(false)};
693
694 llvm::cl::opt<bool> warnOnTruncation{
695 "warn-on-implicit-truncation",
696 llvm::cl::desc("Warn when connects require implicit truncation"),
697 llvm::cl::init(false)};
698
699 llvm::cl::opt<bool> lowerToCore{
700 "lower-to-core",
701 llvm::cl::desc("Prefer core dialects over direct SV lowering for FIRRTL "
702 "verification and printf operations"),
703 llvm::cl::init(false)};
704
705 llvm::cl::opt<bool> addMuxPragmas{
706 "add-mux-pragmas",
707 llvm::cl::desc("Annotate mux pragmas for memory array access"),
708 llvm::cl::init(false)};
709
711 "verification-flavor",
712 llvm::cl::desc("Specify a verification flavor used in LowerFIRRTLToHW"),
713 llvm::cl::values(
714 clEnumValN(firrtl::VerificationFlavor::None, "none",
715 "Use the flavor specified by the op"),
716 clEnumValN(firrtl::VerificationFlavor::IfElseFatal, "if-else-fatal",
717 "Use Use `if(cond) else $fatal(..)` format"),
718 clEnumValN(firrtl::VerificationFlavor::Immediate, "immediate",
719 "Use immediate verif statements"),
720 clEnumValN(firrtl::VerificationFlavor::SVA, "sva", "Use SVA")),
721 llvm::cl::init(firrtl::VerificationFlavor::None)};
722
723 llvm::cl::opt<bool> emitSeparateAlwaysBlocks{
724 "emit-separate-always-blocks",
725 llvm::cl::desc(
726 "Prevent always blocks from being merged and emit constructs into "
727 "separate always blocks whenever possible"),
728 llvm::cl::init(false)};
729
730 llvm::cl::opt<bool> addVivadoRAMAddressConflictSynthesisBugWorkaround{
731 "add-vivado-ram-address-conflict-synthesis-bug-workaround",
732 llvm::cl::desc(
733 "Add a vivado specific SV attribute (* ram_style = "
734 "\"distributed\" *) to unpacked array registers as a workaronud "
735 "for a vivado synthesis bug that incorrectly modifies "
736 "address conflict behavivor of combinational memories"),
737 llvm::cl::init(false)};
738
739 //===----------------------------------------------------------------------===
740 // External Clock Gate Options
741 //===----------------------------------------------------------------------===
742
743 llvm::cl::opt<std::string> ckgModuleName{
744 "ckg-name", llvm::cl::desc("Clock gate module name"),
745 llvm::cl::init("EICG_wrapper")};
746
747 llvm::cl::opt<std::string> ckgInputName{
748 "ckg-input", llvm::cl::desc("Clock gate input port name"),
749 llvm::cl::init("in")};
750
751 llvm::cl::opt<std::string> ckgOutputName{
752 "ckg-output", llvm::cl::desc("Clock gate output port name"),
753 llvm::cl::init("out")};
754
755 llvm::cl::opt<std::string> ckgEnableName{
756 "ckg-enable", llvm::cl::desc("Clock gate enable port name"),
757 llvm::cl::init("en")};
758
759 llvm::cl::opt<std::string> ckgTestEnableName{
760 "ckg-test-enable",
761 llvm::cl::desc("Clock gate test enable port name (optional)"),
762 llvm::cl::init("test_en")};
763
764 llvm::cl::opt<bool> exportModuleHierarchy{
765 "export-module-hierarchy",
766 llvm::cl::desc("Export module and instance hierarchy as JSON"),
767 llvm::cl::init(false)};
768
769 llvm::cl::opt<bool> stripFirDebugInfo{
770 "strip-fir-debug-info",
771 llvm::cl::desc(
772 "Disable source fir locator information in output Verilog"),
773 llvm::cl::init(true)};
774
775 llvm::cl::opt<bool> stripDebugInfo{
776 "strip-debug-info",
777 llvm::cl::desc("Disable source locator information in output Verilog"),
778 llvm::cl::init(false)};
779
780 llvm::cl::opt<bool> fixupEICGWrapper{
781 "fixup-eicg-wrapper",
782 llvm::cl::desc("Lower `EICG_wrapper` modules into clock gate intrinsics"),
783 llvm::cl::init(false)};
784
785 llvm::cl::opt<bool> selectDefaultInstanceChoice{
786 "select-default-for-unspecified-instance-choice",
787 llvm::cl::desc(
788 "Specialize instance choice to default, if no option selected"),
789 llvm::cl::init(false)};
790
792 "symbolic-values",
793 llvm::cl::desc("Control how symbolic values are lowered"),
794 llvm::cl::init(verif::SymbolicValueLowering::ExtModule),
795 verif::symbolicValueLoweringCLValues()};
796
797 llvm::cl::opt<bool> disableWireElimination{
798 "disable-wire-elimination", llvm::cl::desc("Disable wire elimination"),
799 llvm::cl::init(false)};
800
801 llvm::cl::opt<bool> emitAllBindFiles{
802 "emit-all-bind-files",
803 llvm::cl::desc("Emit bindfiles for private modules"),
804 llvm::cl::init(false)};
805
806 llvm::cl::opt<bool> inlineInputOnlyModules{
807 "inline-input-only-modules", llvm::cl::desc("Inline input-only modules"),
808 llvm::cl::init(false)};
809
811 "domain-mode", llvm::cl::desc("Enable domain inference and checking"),
812 llvm::cl::init(firtool::FirtoolOptions::DomainMode::Strip),
813 llvm::cl::values(
814 clEnumValN(firtool::FirtoolOptions::DomainMode::Check, "check",
815 "Check domains without inference"),
816 clEnumValN(firtool::FirtoolOptions::DomainMode::Disable, "disable",
817 "Disable domain checking"),
818 clEnumValN(firtool::FirtoolOptions::DomainMode::Infer, "infer",
819 "Check domains with inference for private modules"),
820 clEnumValN(firtool::FirtoolOptions::DomainMode::InferAll, "infer-all",
821 "Check domains with inference for both public and private "
822 "modules"),
823 clEnumValN(firtool::FirtoolOptions::DomainMode::Strip, "strip",
824 "Erase all domain information"))};
825
826 llvm::cl::list<std::string> skippedDomains{
827 "skip-domain",
828 llvm::cl::desc("Names of domains (e.g. \"ClockDomain\") to exclude from "
829 "domain checking. Skipped domains will be erased from the "
830 "circuit after inference")};
831
832 //===----------------------------------------------------------------------===
833 // Lint options
834 //===----------------------------------------------------------------------===
835
836 llvm::cl::opt<bool> lintStaticAsserts{
837 "lint-static-asserts", llvm::cl::desc("Lint static assertions"),
838 llvm::cl::init(true)};
839 // TODO: Change this default to 'true' once this has been better tested and
840 // `-sv-extract-test-code` has been removed.
841 llvm::cl::opt<bool> lintXmrsInDesign{
842 "lint-xmrs-in-design", llvm::cl::desc("Lint XMRs in the design"),
843 llvm::cl::init(false)};
844};
845} // namespace
846
847static llvm::ManagedStatic<FirtoolCmdOptions> clOptions;
848
849/// Register a set of useful command-line options that can be used to configure
850/// various flags within the MLIRContext. These flags are used when constructing
851/// an MLIR context for initialization.
853 // Make sure that the options struct has been initialized.
854 *clOptions;
855}
856
857// Initialize the firtool options with defaults supplied by the cl::opts above.
859 : outputFilename("-"), disableAnnotationsUnknown(false),
860 disableAnnotationsClassless(false), lowerAnnotationsNoRefTypePorts(false),
861 probesToSignals(false),
862 preserveAggregate(firrtl::PreserveAggregate::None),
863 preserveMode(firrtl::PreserveValues::None), enableDebugInfo(false),
864 buildMode(BuildModeRelease), disableLayerSink(false),
865 disableOptimization(false), vbToBV(false), noDedup(false),
866 dedupClasses(true), companionMode(firrtl::CompanionMode::Bind),
867 noViews(false), disableAggressiveMergeConnections(false),
868 lowerMemories(false), blackBoxRootPath(""), replSeqMem(false),
869 replSeqMemFile(""), ignoreReadEnableMem(false),
870 disableRandom(RandomKind::None), outputAnnotationFilename(""),
871 enableAnnotationWarning(false), warnOnTruncation(false),
872 lowerToCore(false), addMuxPragmas(false),
873 verificationFlavor(firrtl::VerificationFlavor::None),
874 emitSeparateAlwaysBlocks(false),
875 addVivadoRAMAddressConflictSynthesisBugWorkaround(false),
876 ckgModuleName("EICG_wrapper"), ckgInputName("in"), ckgOutputName("out"),
877 ckgEnableName("en"), ckgTestEnableName("test_en"), ckgInstName("ckg"),
878 exportModuleHierarchy(false), stripFirDebugInfo(true),
879 stripDebugInfo(false), fixupEICGWrapper(false),
880 disableCSEinClasses(false), selectDefaultInstanceChoice(false),
881 symbolicValueLowering(verif::SymbolicValueLowering::ExtModule),
882 disableWireElimination(false), lintStaticAsserts(true),
883 lintXmrsInDesign(true), emitAllBindFiles(false),
884 inlineInputOnlyModules(false), domainMode(DomainMode::Disable) {
885 if (!clOptions.isConstructed())
886 return;
887 outputFilename = clOptions->outputFilename;
888 disableAnnotationsUnknown = clOptions->disableAnnotationsUnknown;
889 disableAnnotationsClassless = clOptions->disableAnnotationsClassless;
890 lowerAnnotationsNoRefTypePorts = clOptions->lowerAnnotationsNoRefTypePorts;
891 probesToSignals = clOptions->probesToSignals;
892 preserveAggregate = clOptions->preserveAggregate;
893 preserveMode = clOptions->preserveMode;
894 enableDebugInfo = clOptions->enableDebugInfo;
895 buildMode = clOptions->buildMode;
896 disableLayerSink = clOptions->disableLayerSink;
897 disableOptimization = clOptions->disableOptimization;
898 vbToBV = clOptions->vbToBV;
899 noDedup = clOptions->noDedup;
900 dedupClasses = clOptions->dedupClasses;
901 companionMode = clOptions->companionMode;
902 noViews = clOptions->noViews;
904 clOptions->disableAggressiveMergeConnections;
905 lowerMemories = clOptions->lowerMemories;
906 blackBoxRootPath = clOptions->blackBoxRootPath;
907 replSeqMem = clOptions->replSeqMem;
908 replSeqMemFile = clOptions->replSeqMemFile;
909 ignoreReadEnableMem = clOptions->ignoreReadEnableMem;
910 disableRandom = clOptions->disableRandomValue;
911 outputAnnotationFilename = clOptions->outputAnnotationFilename;
912 enableAnnotationWarning = clOptions->enableAnnotationWarning;
913 warnOnTruncation = clOptions->warnOnTruncation;
914 lowerToCore = clOptions->lowerToCore;
915 addMuxPragmas = clOptions->addMuxPragmas;
916 verificationFlavor = clOptions->verificationFlavor;
917 emitSeparateAlwaysBlocks = clOptions->emitSeparateAlwaysBlocks;
919 clOptions->addVivadoRAMAddressConflictSynthesisBugWorkaround;
920 ckgModuleName = clOptions->ckgModuleName;
921 ckgInputName = clOptions->ckgInputName;
922 ckgOutputName = clOptions->ckgOutputName;
923 ckgEnableName = clOptions->ckgEnableName;
924 ckgTestEnableName = clOptions->ckgTestEnableName;
925 exportModuleHierarchy = clOptions->exportModuleHierarchy;
926 stripFirDebugInfo = clOptions->stripFirDebugInfo;
927 stripDebugInfo = clOptions->stripDebugInfo;
928 fixupEICGWrapper = clOptions->fixupEICGWrapper;
929 selectDefaultInstanceChoice = clOptions->selectDefaultInstanceChoice;
930 symbolicValueLowering = clOptions->symbolicValueLowering;
931 disableWireElimination = clOptions->disableWireElimination;
932 lintStaticAsserts = clOptions->lintStaticAsserts;
933 lintXmrsInDesign = clOptions->lintXmrsInDesign;
934 emitAllBindFiles = clOptions->emitAllBindFiles;
935 inlineInputOnlyModules = clOptions->inlineInputOnlyModules;
936 domainMode = clOptions->domainMode;
937 skippedDomains.assign(clOptions->skippedDomains.begin(),
938 clOptions->skippedDomains.end());
939}
static llvm::ManagedStatic< FirtoolCmdOptions > clOptions
Definition Firtool.cpp:847
Set of options used to control the behavior of the firtool pipeline.
Definition Firtool.h:32
bool shouldStripDebugInfo() const
Definition Firtool.h:151
firrtl::PreserveAggregate::PreserveMode getPreserveAggregate() const
Definition Firtool.h:109
bool shouldAddVivadoRAMAddressConflictSynthesisBugWorkaround() const
Definition Firtool.h:165
bool shouldDisableLayerSink() const
Definition Firtool.h:143
firrtl::PreserveValues::PreserveMode preserveMode
Definition Firtool.h:445
auto getVerificationFlavor() const
Definition Firtool.h:160
StringRef getOutputFilename() const
Definition Firtool.h:102
bool shouldDisableAggressiveMergeConnections() const
Definition Firtool.h:154
bool shouldWarnOnTruncation() const
Definition Firtool.h:158
StringRef getReplaceSequentialMemoriesFile() const
Definition Firtool.h:104
bool addVivadoRAMAddressConflictSynthesisBugWorkaround
Definition Firtool.h:469
SmallVector< std::string > skippedDomains
Definition Firtool.h:489
bool shouldFixupEICGWrapper() const
Definition Firtool.h:168
bool shouldConvertProbesToSignals() const
Definition Firtool.h:141
firrtl::PreserveValues::PreserveMode getPreserveMode() const
Definition Firtool.h:90
bool shouldDedupClasses() const
Definition Firtool.h:147
StringRef getBlackBoxRootPath() const
Definition Firtool.h:103
bool shouldDisableCSEinClasses() const
Definition Firtool.h:169
bool shouldDisableOptimization() const
Definition Firtool.h:144
firrtl::CompanionMode getCompanionMode() const
Definition Firtool.h:112
bool shouldDisableClasslessAnnotations() const
Definition Firtool.h:135
bool getEmitAllBindFiles() const
Definition Firtool.h:183
bool shouldReplaceSequentialMemories() const
Definition Firtool.h:142
bool shouldIgnoreReadEnableMemories() const
Definition Firtool.h:149
bool isRandomEnabled(RandomKind kind) const
Definition Firtool.h:71
bool shouldDisableUnknownAnnotations() const
Definition Firtool.h:132
static RandomKind mergeRandomKind(RandomKind current, RandomKind incoming)
Advance the disabled-randomization lattice.
Definition Firtool.h:77
bool shouldAddMuxPragmas() const
Definition Firtool.h:164
bool shouldEnableAnnotationWarning() const
Definition Firtool.h:157
bool shouldConvertVecOfBundle() const
Definition Firtool.h:150
StringRef getOutputAnnotationFilename() const
Definition Firtool.h:105
bool shouldStripFirDebugInfo() const
Definition Firtool.h:152
std::string outputAnnotationFilename
Definition Firtool.h:462
firrtl::VerificationFlavor verificationFlavor
Definition Firtool.h:467
firrtl::PreserveAggregate::PreserveMode preserveAggregate
Definition Firtool.h:444
bool shouldLowerMemories() const
Definition Firtool.h:145
DomainMode getDomainMode() const
Definition Firtool.h:187
bool getLintStaticAsserts() const
Definition Firtool.h:179
bool shouldLowerNoRefTypePortAnnotations() const
Definition Firtool.h:138
verif::SymbolicValueLowering getSymbolicValueLowering() const
Definition Firtool.h:174
bool shouldExportModuleHierarchy() const
Definition Firtool.h:153
firrtl::CompanionMode companionMode
Definition Firtool.h:453
bool shouldDisableWireElimination() const
Definition Firtool.h:177
bool shouldSelectDefaultInstanceChoice() const
Definition Firtool.h:170
bool shouldInlineInputOnlyModules() const
Definition Firtool.h:185
verif::SymbolicValueLowering symbolicValueLowering
Definition Firtool.h:482
bool getLintXmrsInDesign() const
Definition Firtool.h:181
seq::ExternalizeClockGateOptions getClockGateOptions() const
Definition Firtool.h:116
bool shouldEnableDebugInfo() const
Definition Firtool.h:148
bool shouldEmitSeparateAlwaysBlocks() const
Definition Firtool.h:161
ArrayRef< std::string > getSkippedDomains() const
Definition Firtool.h:189
@ All
Preserve all aggregate values.
Definition Passes.h:45
@ OneDimVec
Preserve only 1d vectors of ground type (e.g. UInt<2>[3]).
Definition Passes.h:39
@ Vec
Preserve only vectors (e.g. UInt<2>[3][3]).
Definition Passes.h:42
@ None
Don't preserve aggregate at all.
Definition Passes.h:36
@ None
Don't explicitly preserve any named values.
Definition Passes.h:57
@ Strip
Strip all names. No name on declaration is preserved.
Definition Passes.h:53
LogicalResult populateLowFIRRTLToHW(mlir::PassManager &pm, const FirtoolOptions &opt, StringRef inputFilename)
Definition Firtool.cpp:245
LogicalResult populateHWToBTOR2(mlir::PassManager &pm, const FirtoolOptions &opt, llvm::raw_ostream &os)
BTOR2 emission pipeline, triggered with --btor2 flag.
Definition Firtool.cpp:462
LogicalResult populateExportSplitVerilog(mlir::PassManager &pm, const FirtoolOptions &opt, llvm::StringRef directory)
Definition Firtool.cpp:437
LogicalResult populateHWToSV(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:334
LogicalResult populateExportVerilog(mlir::PassManager &pm, const FirtoolOptions &opt, std::unique_ptr< llvm::raw_ostream > os)
Definition Firtool.cpp:418
LogicalResult populatePreprocessTransforms(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:27
void registerFirtoolCLOptions()
Register a set of useful command-line options that can be used to configure various flags within the ...
Definition Firtool.cpp:852
LogicalResult populateFinalizeIR(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:447
LogicalResult populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:54
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
std::unique_ptr< mlir::Pass > createExportSplitVerilogPass(llvm::StringRef directory="./")
std::unique_ptr< mlir::Pass > createLowerFIRRTLToHWPass(bool enableAnnotationWarning=false, firrtl::VerificationFlavor assertionFlavor=firrtl::VerificationFlavor::None, bool lowerToCore=false)
This is the pass constructor.
std::unique_ptr< OperationPass< hw::HWModuleOp > > createLowerVerifToSVPass()
Create the Verif to SV conversion pass.
std::unique_ptr< mlir::Pass > createLowerSeqToSVPass(const LowerSeqToSVOptions &options={})
Definition SeqToSV.cpp:859
std::unique_ptr< mlir::Pass > createLowerLTLToCorePass()
std::unique_ptr< mlir::Pass > createLowerSimToSVPass()
Definition SimToSV.cpp:1048
std::unique_ptr< Pass > createSimpleCanonicalizerPass()
Create a simple canonicalizer pass.
Definition Passes.cpp:15
std::unique_ptr< mlir::Pass > createConvertHWToBTOR2Pass()
std::unique_ptr< mlir::Pass > createExportVerilogPass()
std::unique_ptr< mlir::Pass > createStripDebugInfoWithPredPass(const std::function< bool(mlir::Location)> &pred)
Creates a pass to strip debug information from a function.
LogicalResult populatePrepareForExportVerilog(mlir::PassManager &pm, const firtool::FirtoolOptions &opt)
Definition Firtool.cpp:382
Definition verif.py:1