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