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