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