Loading [MathJax]/extensions/tex2jax.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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(
31 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createCheckLayers());
32 // Legalize away "open" aggregates to hw-only versions.
33 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerOpenAggsPass());
34
35 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createResolvePathsPass());
36
37 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerFIRRTLAnnotationsPass(
42
43 if (opt.shouldEnableDebugInfo())
44 pm.nest<firrtl::CircuitOp>().addNestedPass<firrtl::FModuleOp>(
46
47 pm.nest<firrtl::CircuitOp>().addPass(
49 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
51
52 return success();
53}
54
55LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm,
56 const FirtoolOptions &opt) {
57 // TODO: Ensure instance graph and other passes can handle instance choice
58 // then run this pass after all diagnostic passes have run.
59 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createSpecializeOptionPass(
61 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerSignaturesPass());
62
63 // This pass is _not_ idempotent. It preserves its controlling annotation for
64 // use by ExtractInstances. This pass should be run before ExtractInstances.
65 //
66 // TODO: This pass should be deleted.
67 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInjectDUTHierarchyPass());
68
69 if (!opt.shouldDisableOptimization()) {
71 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
72 mlir::createCSEPass());
73 else
74 pm.nest<firrtl::CircuitOp>().nestAny().addPass(mlir::createCSEPass());
75 }
76
77 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
79
80 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
82
83 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
85
86 // Run LowerMatches before InferWidths, as the latter does not support the
87 // match statement, but it does support what they lower to.
88 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
90
91 // Width inference creates canonicalization opportunities.
92 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInferWidthsPass());
93
94 pm.nest<firrtl::CircuitOp>().addPass(
97
98 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInferResetsPass());
99
100 if (opt.shouldExportChiselInterface()) {
101 StringRef outdir = opt.getChiselInterfaceOutputDirectory();
102 if (opt.isDefaultOutputFilename() && outdir.empty()) {
103 pm.nest<firrtl::CircuitOp>().addPass(createExportChiselInterfacePass());
104 } else {
105 if (outdir.empty())
106 outdir = opt.getOutputFilename();
107 pm.nest<firrtl::CircuitOp>().addPass(
109 }
110 }
111
112 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createDropConstPass());
113
114 if (opt.shouldDedup())
115 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createDedupPass());
116
117 if (opt.shouldConvertVecOfBundle()) {
118 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createLowerFIRRTLTypesPass(
120 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createVBToBVPass());
121 }
122
123 if (!opt.shouldLowerMemories())
124 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
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::createLowerFIRRTLTypesPass(
132
133 {
134 auto &modulePM = pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>();
135 modulePM.addPass(firrtl::createExpandWhensPass());
136 modulePM.addPass(firrtl::createSFCCompatPass());
137 }
138
139 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createCheckCombLoopsPass());
140
141 // Must run this pass after all diagnostic passes have run, otherwise it can
142 // hide errors.
143 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createSpecializeLayersPass());
144
145 // Run after inference, layer specialization.
147 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createProbesToSignalsPass());
148
149 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInlinerPass());
150
151 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
153
154 // Preset the random initialization parameters for each module. The current
155 // implementation assumes it can run at a time where every register is
156 // currently in the final module it will be emitted in, all registers have
157 // been created, and no registers have yet been removed.
158 if (opt.isRandomEnabled(FirtoolOptions::RandomKind::Reg))
159 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
161
162 // If we parsed a FIRRTL file and have optimizations enabled, clean it up.
163 if (!opt.shouldDisableOptimization())
164 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
166
167 // Run the infer-rw pass, which merges read and write ports of a memory with
168 // mutually exclusive enables.
169 if (!opt.shouldDisableOptimization())
170 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
172
174 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerMemoryPass());
175
176 if (opt.shouldAddCompanionAssume())
177 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
179
180 if (!opt.shouldDisableOptimization())
181 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createIMConstPropPass());
182
183 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createAddSeqMemPortsPass());
184
188
189 // This pass must be run after InjectDUTHierarchy.
190 //
191 // TODO: This pass should be deleted along with InjectDUTHierarchy.
192 pm.addNestedPass<firrtl::CircuitOp>(firrtl::createExtractInstancesPass());
193
194 // Run SymbolDCE as late as possible, but before InnerSymbolDCE. This is for
195 // hierpathop's and just for general cleanup.
196 pm.addNestedPass<firrtl::CircuitOp>(mlir::createSymbolDCEPass());
197
198 // Run InnerSymbolDCE as late as possible, but before IMDCE.
200
201 // The above passes, IMConstProp in particular, introduce additional
202 // canonicalization opportunities that we should pick up here before we
203 // proceed to output-specific pipelines.
204 if (!opt.shouldDisableOptimization()) {
206 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
208 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
210 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
212 // Re-run IMConstProp to propagate constants produced by register
213 // optimizations.
214 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createIMConstPropPass());
215 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
218 }
219
220 // Always run this, required for legalization.
221 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
224
225 if (!opt.shouldDisableOptimization())
226 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
228
229 return success();
230}
231
232LogicalResult firtool::populateLowFIRRTLToHW(mlir::PassManager &pm,
233 const FirtoolOptions &opt,
234 StringRef inputFilename) {
235 // Run layersink immediately before LowerXMR. LowerXMR will "freeze" the
236 // location of probed objects by placing symbols on them. Run layersink first
237 // so that probed objects can be sunk if possible.
238 if (!opt.shouldDisableLayerSink()) {
239 if (opt.shouldAdvancedLayerSink())
240 pm.nest<firrtl::CircuitOp>().addPass(
242 else
243 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
245 }
246
247 // Lower the ref.resolve and ref.send ops and remove the RefType ports.
248 // LowerToHW cannot handle RefType so, this pass must be run to remove all
249 // RefType ports and ops.
250 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerXMRPass());
251
252 // Layer lowering passes. Move operations into layers when possible and
253 // remove layers by converting them to other constructs. This lowering
254 // process can create a few optimization opportunities.
255 //
256 // TODO: Improve LowerLayers to avoid the need for canonicalization. See:
257 // https://github.com/llvm/circt/issues/7896
258
259 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerLayersPass());
260 if (!opt.shouldDisableOptimization())
261 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
263
264 auto outputFilename = opt.getOutputFilename();
265 if (outputFilename == "-")
266 outputFilename = "";
267
268 pm.nest<firrtl::CircuitOp>().addPass(
269 firrtl::createAssignOutputDirsPass(outputFilename));
270
271 // Run passes to resolve Grand Central features. This should run before
272 // BlackBoxReader because Grand Central needs to inform BlackBoxReader where
273 // certain black boxes should be placed. Note: all Grand Central Taps related
274 // collateral is resolved entirely by LowerAnnotations.
275 // Run this after output directories are (otherwise) assigned,
276 // so generated interfaces can be appropriately marked.
277 pm.addNestedPass<firrtl::CircuitOp>(
279
280 // Read black box source files into the IR.
281 StringRef blackBoxRoot = opt.getBlackBoxRootPath().empty()
282 ? llvm::sys::path::parent_path(inputFilename)
283 : opt.getBlackBoxRootPath();
284 pm.nest<firrtl::CircuitOp>().addPass(
286
287 // Remove TraceAnnotations and write their updated paths to an output
288 // annotation file.
289 pm.nest<firrtl::CircuitOp>().addPass(
291
292 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerDPIPass());
293 pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerClassesPass());
294 pm.nest<firrtl::CircuitOp>().addPass(om::createVerifyObjectFieldsPass());
295
296 // Check for static asserts.
297 pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
299
301 opt.getVerificationFlavor()));
302
303 if (!opt.shouldDisableOptimization()) {
304 auto &modulePM = pm.nest<hw::HWModuleOp>();
305 modulePM.addPass(mlir::createCSEPass());
306 modulePM.addPass(createSimpleCanonicalizerPass());
307 }
308
309 // Check inner symbols and inner refs.
310 pm.addPass(hw::createVerifyInnerRefNamespacePass());
311
312 // Check OM object fields.
313 pm.addPass(om::createVerifyObjectFieldsPass());
314
315 // Run the verif op verification pass
316 pm.addNestedPass<hw::HWModuleOp>(verif::createVerifyClockedAssertLikePass());
317
318 return success();
319}
320
321LogicalResult firtool::populateHWToSV(mlir::PassManager &pm,
322 const FirtoolOptions &opt) {
323 pm.nestAny().addPass(verif::createStripContractsPass());
324 pm.addPass(verif::createLowerFormalToHWPass());
325 pm.addPass(
326 verif::createLowerSymbolicValuesPass({opt.getSymbolicValueLowering()}));
327
328 if (opt.shouldExtractTestCode())
329 pm.addPass(sv::createSVExtractTestCodePass(
333
334 pm.addPass(seq::createExternalizeClockGatePass(opt.getClockGateOptions()));
335 pm.addPass(circt::createLowerSimToSVPass());
337 {/*disableRegRandomization=*/!opt.isRandomEnabled(
338 FirtoolOptions::RandomKind::Reg),
339 /*disableMemRandomization=*/
340 !opt.isRandomEnabled(FirtoolOptions::RandomKind::Mem),
341 /*emitSeparateAlwaysBlocks=*/
343 pm.addNestedPass<hw::HWModuleOp>(createLowerVerifToSVPass());
344 pm.addPass(seq::createHWMemSimImplPass(
345 {/*disableMemRandomization=*/!opt.isRandomEnabled(
346 FirtoolOptions::RandomKind::Mem),
347 /*disableRegRandomization=*/
348 !opt.isRandomEnabled(FirtoolOptions::RandomKind::Reg),
349 /*replSeqMem=*/opt.shouldReplaceSequentialMemories(),
350 /*readEnableMode=*/opt.shouldIgnoreReadEnableMemories()
351 ? seq::ReadEnableMode::Ignore
352 : seq::ReadEnableMode::Undefined,
353 /*addMuxPragmas=*/opt.shouldAddMuxPragmas(),
354 /*addVivadoRAMAddressConflictSynthesisBugWorkaround=*/
356
357 // If enabled, run the optimizer.
358 if (!opt.shouldDisableOptimization()) {
359 auto &modulePM = pm.nest<hw::HWModuleOp>();
360 modulePM.addPass(mlir::createCSEPass());
361 modulePM.addPass(createSimpleCanonicalizerPass());
362 modulePM.addPass(mlir::createCSEPass());
363 modulePM.addPass(sv::createHWCleanupPass(
364 /*mergeAlwaysBlocks=*/!opt.shouldEmitSeparateAlwaysBlocks()));
365 }
366
367 // Check inner symbols and inner refs.
368 pm.addPass(hw::createVerifyInnerRefNamespacePass());
369
370 // Check OM object fields.
371 pm.addPass(om::createVerifyObjectFieldsPass());
372
373 return success();
374}
375
376namespace detail {
377LogicalResult
379 const firtool::FirtoolOptions &opt) {
380
381 // Run the verif op verification pass
382 pm.addNestedPass<hw::HWModuleOp>(verif::createVerifyClockedAssertLikePass());
383
384 // Legalize unsupported operations within the modules.
386
387 // Tidy up the IR to improve verilog emission quality.
388 if (!opt.shouldDisableOptimization())
389 pm.nest<hw::HWModuleOp>().addPass(sv::createPrettifyVerilogPass());
390
391 if (opt.shouldStripFirDebugInfo())
392 pm.addPass(circt::createStripDebugInfoWithPredPass([](mlir::Location loc) {
393 if (auto fileLoc = dyn_cast<FileLineColLoc>(loc))
394 return fileLoc.getFilename().getValue().ends_with(".fir");
395 return false;
396 }));
397
398 if (opt.shouldStripDebugInfo())
400 [](mlir::Location loc) { return true; }));
401
402 // Emit module and testbench hierarchy JSON files.
405
406 // Check inner symbols and inner refs.
408
409 // Check OM object fields.
411
412 return success();
413}
414} // namespace detail
415
416LogicalResult
417firtool::populateExportVerilog(mlir::PassManager &pm, const FirtoolOptions &opt,
418 std::unique_ptr<llvm::raw_ostream> os) {
420 return failure();
421
422 pm.addPass(createExportVerilogPass(std::move(os)));
423 return success();
424}
425
426LogicalResult firtool::populateExportVerilog(mlir::PassManager &pm,
427 const FirtoolOptions &opt,
428 llvm::raw_ostream &os) {
430 return failure();
431
432 pm.addPass(createExportVerilogPass(os));
433 return success();
434}
435
436LogicalResult firtool::populateExportSplitVerilog(mlir::PassManager &pm,
437 const FirtoolOptions &opt,
438 llvm::StringRef directory) {
440 return failure();
441
442 pm.addPass(createExportSplitVerilogPass(directory));
443 return success();
444}
445
446LogicalResult firtool::populateFinalizeIR(mlir::PassManager &pm,
447 const FirtoolOptions &opt) {
448 pm.addPass(firrtl::createFinalizeIRPass());
449 pm.addPass(om::createFreezePathsPass());
450
451 return success();
452}
453
454LogicalResult firtool::populateHWToBTOR2(mlir::PassManager &pm,
455 const FirtoolOptions &opt,
456 llvm::raw_ostream &os) {
458 pm.addNestedPass<hw::HWModuleOp>(circt::verif::createPrepareForFormalPass());
460 pm.addPass(circt::createConvertHWToBTOR2Pass(os));
461 return success();
462}
463
464//===----------------------------------------------------------------------===//
465// FIRTOOL CommandLine Options
466//===----------------------------------------------------------------------===//
467
468namespace {
469/// This struct contains command line options that can be used to initialize
470/// various bits of a Firtool pipeline. This uses a struct wrapper to avoid the
471/// need for global command line options.
472struct FirtoolCmdOptions {
473 llvm::cl::opt<std::string> outputFilename{
474 "o",
475 llvm::cl::desc("Output filename, or directory for split output"),
476 llvm::cl::value_desc("filename"),
477 llvm::cl::init("-"),
478 };
479
480 llvm::cl::opt<bool> disableAnnotationsUnknown{
481 "disable-annotation-unknown",
482 llvm::cl::desc("Ignore unknown annotations when parsing"),
483 llvm::cl::init(false)};
484
485 llvm::cl::opt<bool> disableAnnotationsClassless{
486 "disable-annotation-classless",
487 llvm::cl::desc("Ignore annotations without a class when parsing"),
488 llvm::cl::init(false)};
489
490 llvm::cl::opt<bool> lowerAnnotationsNoRefTypePorts{
491 "lower-annotations-no-ref-type-ports",
492 llvm::cl::desc(
493 "Create real ports instead of ref type ports when resolving "
494 "wiring problems inside the LowerAnnotations pass"),
495 llvm::cl::init(false), llvm::cl::Hidden};
496
497 llvm::cl::opt<bool> allowAddingPortsOnPublic{
498 "allow-adding-ports-on-public-modules",
499 llvm::cl::desc("Allow adding ports to public modules"),
500 llvm::cl::init(false), llvm::cl::Hidden};
501
502 llvm::cl::opt<bool> probesToSignals{
503 "probes-to-signals",
504 llvm::cl::desc("Convert probes to non-probe signals"),
505 llvm::cl::init(false), llvm::cl::Hidden};
506
508 preserveAggregate{
509 "preserve-aggregate",
510 llvm::cl::desc("Specify input file format:"),
511 llvm::cl::values(
513 "Preserve no aggregate"),
515 "Preserve only 1d vectors of ground type"),
517 "Preserve only vectors"),
519 "Preserve vectors and bundles")),
521 };
522
524 "preserve-values",
525 llvm::cl::desc("Specify the values which can be optimized away"),
526 llvm::cl::values(
527 clEnumValN(firrtl::PreserveValues::Strip, "strip",
528 "Strip all names. No name is preserved"),
529 clEnumValN(firrtl::PreserveValues::None, "none",
530 "Names could be preserved by best-effort unlike `strip`"),
531 clEnumValN(firrtl::PreserveValues::Named, "named",
532 "Preserve values with meaningful names"),
533 clEnumValN(firrtl::PreserveValues::All, "all",
534 "Preserve all values")),
535 llvm::cl::init(firrtl::PreserveValues::None)};
536
537 llvm::cl::opt<bool> enableDebugInfo{
538 "g", llvm::cl::desc("Enable the generation of debug information"),
539 llvm::cl::init(false)};
540
541 // Build mode options.
543 "O", llvm::cl::desc("Controls how much optimization should be performed"),
544 llvm::cl::values(clEnumValN(firtool::FirtoolOptions::BuildModeDebug,
545 "debug",
546 "Compile with only necessary optimizations"),
548 "release", "Compile with optimizations")),
550
551 llvm::cl::opt<bool> disableLayerSink{"disable-layer-sink",
552 llvm::cl::desc("Disable layer sink"),
553 cl::init(false)};
554
555 llvm::cl::opt<bool> disableOptimization{
556 "disable-opt",
557 llvm::cl::desc("Disable optimizations"),
558 };
559
560 llvm::cl::opt<bool> exportChiselInterface{
561 "export-chisel-interface",
562 llvm::cl::desc("Generate a Scala Chisel interface to the top level "
563 "module of the firrtl circuit"),
564 llvm::cl::init(false)};
565
566 llvm::cl::opt<std::string> chiselInterfaceOutDirectory{
567 "chisel-interface-out-dir",
568 llvm::cl::desc(
569 "The output directory for generated Chisel interface files"),
570 llvm::cl::init("")};
571
572 llvm::cl::opt<bool> vbToBV{
573 "vb-to-bv",
574 llvm::cl::desc("Transform vectors of bundles to bundles of vectors"),
575 llvm::cl::init(false)};
576
577 llvm::cl::opt<bool> noDedup{
578 "no-dedup",
579 llvm::cl::desc("Disable deduplication of structurally identical modules"),
580 llvm::cl::init(false)};
581
583 "grand-central-companion-mode",
584 llvm::cl::desc("Specifies the handling of Grand Central companions"),
585 ::llvm::cl::values(
586 clEnumValN(firrtl::CompanionMode::Bind, "bind",
587 "Lower companion instances to SystemVerilog binds"),
588 clEnumValN(firrtl::CompanionMode::Instantiate, "instantiate",
589 "Instantiate companions in the design"),
590 clEnumValN(firrtl::CompanionMode::Drop, "drop",
591 "Remove companions from the design")),
592 llvm::cl::init(firrtl::CompanionMode::Bind),
593 llvm::cl::Hidden,
594 };
595
596 llvm::cl::opt<bool> disableAggressiveMergeConnections{
597 "disable-aggressive-merge-connections",
598 llvm::cl::desc(
599 "Disable aggressive merge connections (i.e. merge all field-level "
600 "connections into bulk connections)"),
601 llvm::cl::init(false)};
602
603 llvm::cl::opt<bool> advancedLayerSink{
604 "advanced-layer-sink",
605 llvm::cl::desc("Sink logic into layer blocks (advanced)"),
606 llvm::cl::init(false)};
607
608 llvm::cl::opt<bool> lowerMemories{
609 "lower-memories",
610 llvm::cl::desc("Lower memories to have memories with masks as an "
611 "array with one memory per ground type"),
612 llvm::cl::init(false)};
613
614 llvm::cl::opt<std::string> blackBoxRootPath{
615 "blackbox-path",
616 llvm::cl::desc(
617 "Optional path to use as the root of black box annotations"),
618 llvm::cl::value_desc("path"),
619 llvm::cl::init(""),
620 };
621
622 llvm::cl::opt<bool> replSeqMem{
623 "repl-seq-mem",
624 llvm::cl::desc("Replace the seq mem for macro replacement and emit "
625 "relevant metadata"),
626 llvm::cl::init(false)};
627
628 llvm::cl::opt<std::string> replSeqMemFile{
629 "repl-seq-mem-file", llvm::cl::desc("File name for seq mem metadata"),
630 llvm::cl::init("")};
631
632 llvm::cl::opt<bool> extractTestCode{
633 "extract-test-code", llvm::cl::desc("Run the extract test code pass"),
634 llvm::cl::init(false)};
635
636 llvm::cl::opt<bool> ignoreReadEnableMem{
637 "ignore-read-enable-mem",
638 llvm::cl::desc("Ignore the read enable signal, instead of "
639 "assigning X on read disable"),
640 llvm::cl::init(false)};
641
643 llvm::cl::desc(
644 "Disable random initialization code (may break semantics!)"),
645 llvm::cl::values(
646 clEnumValN(firtool::FirtoolOptions::RandomKind::Mem,
647 "disable-mem-randomization",
648 "Disable emission of memory randomization code"),
649 clEnumValN(firtool::FirtoolOptions::RandomKind::Reg,
650 "disable-reg-randomization",
651 "Disable emission of register randomization code"),
652 clEnumValN(firtool::FirtoolOptions::RandomKind::All,
653 "disable-all-randomization",
654 "Disable emission of all randomization code")),
655 llvm::cl::init(firtool::FirtoolOptions::RandomKind::None)};
656
657 llvm::cl::opt<std::string> outputAnnotationFilename{
658 "output-annotation-file",
659 llvm::cl::desc("Optional output annotation file"),
660 llvm::cl::CommaSeparated, llvm::cl::value_desc("filename")};
661
662 llvm::cl::opt<bool> enableAnnotationWarning{
663 "warn-on-unprocessed-annotations",
664 llvm::cl::desc(
665 "Warn about annotations that were not removed by lower-to-hw"),
666 llvm::cl::init(false)};
667
668 llvm::cl::opt<bool> addMuxPragmas{
669 "add-mux-pragmas",
670 llvm::cl::desc("Annotate mux pragmas for memory array access"),
671 llvm::cl::init(false)};
672
674 "verification-flavor",
675 llvm::cl::desc("Specify a verification flavor used in LowerFIRRTLToHW"),
676 llvm::cl::values(
677 clEnumValN(firrtl::VerificationFlavor::None, "none",
678 "Use the flavor specified by the op"),
679 clEnumValN(firrtl::VerificationFlavor::IfElseFatal, "if-else-fatal",
680 "Use Use `if(cond) else $fatal(..)` format"),
681 clEnumValN(firrtl::VerificationFlavor::Immediate, "immediate",
682 "Use immediate verif statements"),
683 clEnumValN(firrtl::VerificationFlavor::SVA, "sva", "Use SVA")),
684 llvm::cl::init(firrtl::VerificationFlavor::None)};
685
686 llvm::cl::opt<bool> emitSeparateAlwaysBlocks{
687 "emit-separate-always-blocks",
688 llvm::cl::desc(
689 "Prevent always blocks from being merged and emit constructs into "
690 "separate always blocks whenever possible"),
691 llvm::cl::init(false)};
692
693 llvm::cl::opt<bool> etcDisableInstanceExtraction{
694 "etc-disable-instance-extraction",
695 llvm::cl::desc("Disable extracting instances only that feed test code"),
696 llvm::cl::init(false)};
697
698 llvm::cl::opt<bool> etcDisableRegisterExtraction{
699 "etc-disable-register-extraction",
700 llvm::cl::desc("Disable extracting registers that only feed test code"),
701 llvm::cl::init(false)};
702
703 llvm::cl::opt<bool> etcDisableModuleInlining{
704 "etc-disable-module-inlining",
705 llvm::cl::desc("Disable inlining modules that only feed test code"),
706 llvm::cl::init(false)};
707
708 llvm::cl::opt<bool> addVivadoRAMAddressConflictSynthesisBugWorkaround{
709 "add-vivado-ram-address-conflict-synthesis-bug-workaround",
710 llvm::cl::desc(
711 "Add a vivado specific SV attribute (* ram_style = "
712 "\"distributed\" *) to unpacked array registers as a workaronud "
713 "for a vivado synthesis bug that incorrectly modifies "
714 "address conflict behavivor of combinational memories"),
715 llvm::cl::init(false)};
716
717 //===----------------------------------------------------------------------===
718 // External Clock Gate Options
719 //===----------------------------------------------------------------------===
720
721 llvm::cl::opt<std::string> ckgModuleName{
722 "ckg-name", llvm::cl::desc("Clock gate module name"),
723 llvm::cl::init("EICG_wrapper")};
724
725 llvm::cl::opt<std::string> ckgInputName{
726 "ckg-input", llvm::cl::desc("Clock gate input port name"),
727 llvm::cl::init("in")};
728
729 llvm::cl::opt<std::string> ckgOutputName{
730 "ckg-output", llvm::cl::desc("Clock gate output port name"),
731 llvm::cl::init("out")};
732
733 llvm::cl::opt<std::string> ckgEnableName{
734 "ckg-enable", llvm::cl::desc("Clock gate enable port name"),
735 llvm::cl::init("en")};
736
737 llvm::cl::opt<std::string> ckgTestEnableName{
738 "ckg-test-enable",
739 llvm::cl::desc("Clock gate test enable port name (optional)"),
740 llvm::cl::init("test_en")};
741
742 llvm::cl::opt<bool> exportModuleHierarchy{
743 "export-module-hierarchy",
744 llvm::cl::desc("Export module and instance hierarchy as JSON"),
745 llvm::cl::init(false)};
746
747 llvm::cl::opt<bool> stripFirDebugInfo{
748 "strip-fir-debug-info",
749 llvm::cl::desc(
750 "Disable source fir locator information in output Verilog"),
751 llvm::cl::init(true)};
752
753 llvm::cl::opt<bool> stripDebugInfo{
754 "strip-debug-info",
755 llvm::cl::desc("Disable source locator information in output Verilog"),
756 llvm::cl::init(false)};
757
758 llvm::cl::opt<bool> fixupEICGWrapper{
759 "fixup-eicg-wrapper",
760 llvm::cl::desc("Lower `EICG_wrapper` modules into clock gate intrinsics"),
761 llvm::cl::init(false)};
762
763 llvm::cl::opt<bool> addCompanionAssume{
764 "add-companion-assume",
765 llvm::cl::desc("Add companion assumes to assertions"),
766 llvm::cl::init(false)};
767
768 llvm::cl::opt<bool> selectDefaultInstanceChoice{
769 "select-default-for-unspecified-instance-choice",
770 llvm::cl::desc(
771 "Specialize instance choice to default, if no option selected"),
772 llvm::cl::init(false)};
773
775 "symbolic-values",
776 llvm::cl::desc("Control how symbolic values are lowered"),
777 llvm::cl::init(verif::SymbolicValueLowering::ExtModule),
778 verif::symbolicValueLoweringCLValues()};
779
780 llvm::cl::opt<bool> disableWireElimination{
781 "disable-wire-elimination", llvm::cl::desc("Disable wire elimination"),
782 llvm::cl::init(false)};
783};
784} // namespace
785
786static llvm::ManagedStatic<FirtoolCmdOptions> clOptions;
787
788/// Register a set of useful command-line options that can be used to configure
789/// various flags within the MLIRContext. These flags are used when constructing
790/// an MLIR context for initialization.
792 // Make sure that the options struct has been initialized.
793 *clOptions;
794}
795
796// Initialize the firtool options with defaults supplied by the cl::opts above.
798 : outputFilename("-"), disableAnnotationsUnknown(false),
799 disableAnnotationsClassless(false), lowerAnnotationsNoRefTypePorts(false),
800 allowAddingPortsOnPublic(false), probesToSignals(false),
801 preserveAggregate(firrtl::PreserveAggregate::None),
802 preserveMode(firrtl::PreserveValues::None), enableDebugInfo(false),
803 buildMode(BuildModeRelease), disableLayerSink(false),
804 disableOptimization(false), exportChiselInterface(false),
805 chiselInterfaceOutDirectory(""), vbToBV(false), noDedup(false),
806 companionMode(firrtl::CompanionMode::Bind),
807 disableAggressiveMergeConnections(false), advancedLayerSink(false),
808 lowerMemories(false), blackBoxRootPath(""), replSeqMem(false),
809 replSeqMemFile(""), extractTestCode(false), ignoreReadEnableMem(false),
810 disableRandom(RandomKind::None), outputAnnotationFilename(""),
811 enableAnnotationWarning(false), addMuxPragmas(false),
812 verificationFlavor(firrtl::VerificationFlavor::None),
813 emitSeparateAlwaysBlocks(false), etcDisableInstanceExtraction(false),
814 etcDisableRegisterExtraction(false), etcDisableModuleInlining(false),
815 addVivadoRAMAddressConflictSynthesisBugWorkaround(false),
816 ckgModuleName("EICG_wrapper"), ckgInputName("in"), ckgOutputName("out"),
817 ckgEnableName("en"), ckgTestEnableName("test_en"), ckgInstName("ckg"),
818 exportModuleHierarchy(false), stripFirDebugInfo(true),
819 stripDebugInfo(false), fixupEICGWrapper(false), addCompanionAssume(false),
820 disableCSEinClasses(false), selectDefaultInstanceChoice(false),
821 symbolicValueLowering(verif::SymbolicValueLowering::ExtModule),
822 disableWireElimination(false) {
823 if (!clOptions.isConstructed())
824 return;
825 outputFilename = clOptions->outputFilename;
826 disableAnnotationsUnknown = clOptions->disableAnnotationsUnknown;
827 disableAnnotationsClassless = clOptions->disableAnnotationsClassless;
828 lowerAnnotationsNoRefTypePorts = clOptions->lowerAnnotationsNoRefTypePorts;
829 allowAddingPortsOnPublic = clOptions->allowAddingPortsOnPublic;
830 probesToSignals = clOptions->probesToSignals;
831 preserveAggregate = clOptions->preserveAggregate;
832 preserveMode = clOptions->preserveMode;
833 enableDebugInfo = clOptions->enableDebugInfo;
834 buildMode = clOptions->buildMode;
835 disableLayerSink = clOptions->disableLayerSink;
836 disableOptimization = clOptions->disableOptimization;
837 exportChiselInterface = clOptions->exportChiselInterface;
838 chiselInterfaceOutDirectory = clOptions->chiselInterfaceOutDirectory;
839 vbToBV = clOptions->vbToBV;
840 noDedup = clOptions->noDedup;
841 companionMode = clOptions->companionMode;
843 clOptions->disableAggressiveMergeConnections;
844 advancedLayerSink = clOptions->advancedLayerSink;
845 lowerMemories = clOptions->lowerMemories;
846 blackBoxRootPath = clOptions->blackBoxRootPath;
847 replSeqMem = clOptions->replSeqMem;
848 replSeqMemFile = clOptions->replSeqMemFile;
849 extractTestCode = clOptions->extractTestCode;
850 ignoreReadEnableMem = clOptions->ignoreReadEnableMem;
851 disableRandom = clOptions->disableRandom;
852 outputAnnotationFilename = clOptions->outputAnnotationFilename;
853 enableAnnotationWarning = clOptions->enableAnnotationWarning;
854 addMuxPragmas = clOptions->addMuxPragmas;
855 verificationFlavor = clOptions->verificationFlavor;
856 emitSeparateAlwaysBlocks = clOptions->emitSeparateAlwaysBlocks;
857 etcDisableInstanceExtraction = clOptions->etcDisableInstanceExtraction;
858 etcDisableRegisterExtraction = clOptions->etcDisableRegisterExtraction;
859 etcDisableModuleInlining = clOptions->etcDisableModuleInlining;
861 clOptions->addVivadoRAMAddressConflictSynthesisBugWorkaround;
862 ckgModuleName = clOptions->ckgModuleName;
863 ckgInputName = clOptions->ckgInputName;
864 ckgOutputName = clOptions->ckgOutputName;
865 ckgEnableName = clOptions->ckgEnableName;
866 ckgTestEnableName = clOptions->ckgTestEnableName;
867 exportModuleHierarchy = clOptions->exportModuleHierarchy;
868 stripFirDebugInfo = clOptions->stripFirDebugInfo;
869 stripDebugInfo = clOptions->stripDebugInfo;
870 fixupEICGWrapper = clOptions->fixupEICGWrapper;
871 addCompanionAssume = clOptions->addCompanionAssume;
872 selectDefaultInstanceChoice = clOptions->selectDefaultInstanceChoice;
873 symbolicValueLowering = clOptions->symbolicValueLowering;
874 disableWireElimination = clOptions->disableWireElimination;
875}
static LogicalResult exportChiselInterface(CircuitOp circuit, llvm::raw_ostream &os)
Exports a Chisel interface to the output stream.
static llvm::ManagedStatic< FirtoolCmdOptions > clOptions
Definition Firtool.cpp:786
Set of options used to control the behavior of the firtool pipeline.
Definition Firtool.h:31
bool shouldStripDebugInfo() const
Definition Firtool.h:118
firrtl::PreserveAggregate::PreserveMode getPreserveAggregate() const
Definition Firtool.h:65
bool shouldAddVivadoRAMAddressConflictSynthesisBugWorkaround() const
Definition Firtool.h:130
bool shouldDisableLayerSink() const
Definition Firtool.h:100
firrtl::PreserveValues::PreserveMode preserveMode
Definition Firtool.h:403
bool shouldAddCompanionAssume() const
Definition Firtool.h:135
auto getVerificationFlavor() const
Definition Firtool.h:125
bool isDefaultOutputFilename() const
Definition Firtool.h:85
StringRef getOutputFilename() const
Definition Firtool.h:55
bool shouldDisableAggressiveMergeConnections() const
Definition Firtool.h:121
StringRef getReplaceSequentialMemoriesFile() const
Definition Firtool.h:60
bool addVivadoRAMAddressConflictSynthesisBugWorkaround
Definition Firtool.h:430
bool shouldExportChiselInterface() const
Definition Firtool.h:107
bool shouldAdvancedLayerSink() const
Definition Firtool.h:102
bool shouldExtractTestCode() const
Definition Firtool.h:133
std::string chiselInterfaceOutDirectory
Definition Firtool.h:409
bool shouldFixupEICGWrapper() const
Definition Firtool.h:134
bool shouldConvertProbesToSignals() const
Definition Firtool.h:98
firrtl::PreserveValues::PreserveMode getPreserveMode() const
Definition Firtool.h:43
StringRef getBlackBoxRootPath() const
Definition Firtool.h:56
bool shouldDisableCSEinClasses() const
Definition Firtool.h:136
bool shouldDisableOptimization() const
Definition Firtool.h:101
firrtl::CompanionMode getCompanionMode() const
Definition Firtool.h:68
bool shouldDisableClasslessAnnotations() const
Definition Firtool.h:89
bool shouldReplaceSequentialMemories() const
Definition Firtool.h:99
bool shouldIgnoreReadEnableMemories() const
Definition Firtool.h:106
bool isRandomEnabled(RandomKind kind) const
Definition Firtool.h:39
bool shouldDisableUnknownAnnotations() const
Definition Firtool.h:86
bool shouldAddMuxPragmas() const
Definition Firtool.h:129
bool shouldEnableAnnotationWarning() const
Definition Firtool.h:124
bool shouldEtcDisableInstanceExtraction() const
Definition Firtool.h:109
bool shouldConvertVecOfBundle() const
Definition Firtool.h:108
StringRef getOutputAnnotationFilename() const
Definition Firtool.h:61
bool shouldStripFirDebugInfo() const
Definition Firtool.h:119
bool shouldEtcDisableRegisterExtraction() const
Definition Firtool.h:112
std::string outputAnnotationFilename
Definition Firtool.h:422
firrtl::VerificationFlavor verificationFlavor
Definition Firtool.h:425
firrtl::PreserveAggregate::PreserveMode preserveAggregate
Definition Firtool.h:402
bool shouldLowerMemories() const
Definition Firtool.h:103
bool shouldEtcDisableModuleInlining() const
Definition Firtool.h:115
bool shouldAllowAddingPortsOnPublic() const
Definition Firtool.h:95
bool shouldLowerNoRefTypePortAnnotations() const
Definition Firtool.h:92
verif::SymbolicValueLowering getSymbolicValueLowering() const
Definition Firtool.h:141
bool shouldExportModuleHierarchy() const
Definition Firtool.h:120
firrtl::CompanionMode companionMode
Definition Firtool.h:412
bool shouldDisableWireElimination() const
Definition Firtool.h:144
bool shouldSelectDefaultInstanceChoice() const
Definition Firtool.h:137
verif::SymbolicValueLowering symbolicValueLowering
Definition Firtool.h:444
seq::ExternalizeClockGateOptions getClockGateOptions() const
Definition Firtool.h:70
bool shouldEnableDebugInfo() const
Definition Firtool.h:105
bool shouldEmitSeparateAlwaysBlocks() const
Definition Firtool.h:126
StringRef getChiselInterfaceOutputDirectory() const
Definition Firtool.h:57
@ All
Preserve all aggregate values.
Definition Passes.h:42
@ OneDimVec
Preserve only 1d vectors of ground type (e.g. UInt<2>[3]).
Definition Passes.h:36
@ Vec
Preserve only vectors (e.g. UInt<2>[3][3]).
Definition Passes.h:39
@ None
Don't preserve aggregate at all.
Definition Passes.h:33
@ None
Don't explicitly preserve any named values.
Definition Passes.h:54
@ Strip
Strip all names. No name on declaration is preserved.
Definition Passes.h:50
std::unique_ptr< mlir::Pass > createInferReadWritePass()
std::unique_ptr< mlir::Pass > createCheckCombLoopsPass()
std::unique_ptr< mlir::Pass > createCheckLayers()
std::unique_ptr< mlir::Pass > createCheckRecursiveInstantiation()
std::unique_ptr< mlir::Pass > createFinalizeIRPass()
std::unique_ptr< mlir::Pass > createLowerFIRRTLTypesPass(PreserveAggregate::PreserveMode mode=PreserveAggregate::None, PreserveAggregate::PreserveMode memoryMode=PreserveAggregate::None)
This is the pass constructor.
std::unique_ptr< mlir::Pass > createResolvePathsPass()
std::unique_ptr< mlir::Pass > createLowerFIRRTLAnnotationsPass(bool ignoreUnhandledAnnotations=false, bool ignoreClasslessAnnotations=false, bool noRefTypePorts=false, bool allowAddingPortsOnPublic=false)
This is the pass constructor.
std::unique_ptr< mlir::Pass > createLowerSignaturesPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createVBToBVPass()
Definition VBToBV.cpp:993
std::unique_ptr< mlir::Pass > createGrandCentralPass(CompanionMode companionMode=CompanionMode::Bind)
std::unique_ptr< mlir::Pass > createLowerDPIPass()
Definition LowerDPI.cpp:294
std::unique_ptr< mlir::Pass > createLowerIntmodulesPass(bool fixupEICGWrapper=false)
This is the pass constructor.
std::unique_ptr< mlir::Pass > createIMConstPropPass()
std::unique_ptr< mlir::Pass > createCreateCompanionAssume()
std::unique_ptr< mlir::Pass > createAdvancedLayerSinkPass()
std::unique_ptr< mlir::Pass > createLayerMergePass()
std::unique_ptr< mlir::Pass > createInlinerPass()
std::unique_ptr< mlir::Pass > createVectorizationPass()
std::unique_ptr< mlir::Pass > createLowerMemoryPass()
std::unique_ptr< mlir::Pass > createDropNamesPass(PreserveValues::PreserveMode mode=PreserveValues::None)
Definition DropName.cpp:101
std::unique_ptr< mlir::Pass > createLowerLayersPass()
std::unique_ptr< mlir::Pass > createIMDeadCodeElimPass()
std::unique_ptr< mlir::Pass > createLintingPass()
Definition Lint.cpp:98
std::unique_ptr< mlir::Pass > createEliminateWiresPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createPassiveWiresPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createExtractInstancesPass()
std::unique_ptr< mlir::Pass > createDedupPass()
Definition Dedup.cpp:1891
std::unique_ptr< mlir::Pass > createSpecializeOptionPass(bool selectDefaultInstanceChoice=false)
std::unique_ptr< mlir::Pass > createLayerSinkPass()
Definition LayerSink.cpp:58
std::unique_ptr< mlir::Pass > createSpecializeLayersPass()
std::unique_ptr< mlir::Pass > createLowerCHIRRTLPass()
std::unique_ptr< mlir::Pass > createInnerSymbolDCEPass()
std::unique_ptr< mlir::Pass > createExpandWhensPass()
std::unique_ptr< mlir::Pass > createLowerXMRPass()
Definition LowerXMR.cpp:875
std::unique_ptr< mlir::Pass > createLowerIntrinsicsPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createInferWidthsPass()
std::unique_ptr< mlir::Pass > createResolveTracesPass(mlir::StringRef outputAnnotationFilename="")
std::unique_ptr< mlir::Pass > createMemToRegOfVecPass(bool replSeqMem=false, bool ignoreReadEnable=false)
std::unique_ptr< mlir::Pass > createCreateSiFiveMetadataPass(bool replSeqMem=false, mlir::StringRef replSeqMemFile="")
std::unique_ptr< mlir::Pass > createAssignOutputDirsPass(mlir::StringRef outputDir="")
std::unique_ptr< mlir::Pass > createBlackBoxReaderPass(std::optional< mlir::StringRef > inputPrefix={})
std::unique_ptr< mlir::Pass > createLowerOpenAggsPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createDropConstPass()
std::unique_ptr< mlir::Pass > createSFCCompatPass()
std::unique_ptr< mlir::Pass > createInjectDUTHierarchyPass()
std::unique_ptr< mlir::Pass > createRandomizeRegisterInitPass()
std::unique_ptr< mlir::Pass > createLowerClassesPass()
std::unique_ptr< mlir::Pass > createAddSeqMemPortsPass()
std::unique_ptr< mlir::Pass > createRegisterOptimizerPass()
std::unique_ptr< mlir::Pass > createLowerMatchesPass()
std::unique_ptr< mlir::Pass > createProbesToSignalsPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createMergeConnectionsPass(bool enableAggressiveMerging=false)
std::unique_ptr< mlir::Pass > createInferResetsPass()
std::unique_ptr< mlir::Pass > createFlattenMemoryPass()
std::unique_ptr< mlir::Pass > createMaterializeDebugInfoPass()
LogicalResult populateLowFIRRTLToHW(mlir::PassManager &pm, const FirtoolOptions &opt, StringRef inputFilename)
Definition Firtool.cpp:232
LogicalResult populateHWToBTOR2(mlir::PassManager &pm, const FirtoolOptions &opt, llvm::raw_ostream &os)
Definition Firtool.cpp:454
LogicalResult populateExportSplitVerilog(mlir::PassManager &pm, const FirtoolOptions &opt, llvm::StringRef directory)
Definition Firtool.cpp:436
LogicalResult populateHWToSV(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:321
LogicalResult populateExportVerilog(mlir::PassManager &pm, const FirtoolOptions &opt, std::unique_ptr< llvm::raw_ostream > os)
Definition Firtool.cpp:417
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:791
LogicalResult populateFinalizeIR(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:446
LogicalResult populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:55
std::unique_ptr< mlir::Pass > createFlattenModulesPass()
std::unique_ptr< mlir::Pass > createVerifyInnerRefNamespacePass()
std::unique_ptr< mlir::Pass > createVerifyObjectFieldsPass()
std::unique_ptr< mlir::Pass > createHWExportModuleHierarchyPass()
std::unique_ptr< mlir::Pass > createHWLegalizeModulesPass()
std::unique_ptr< mlir::Pass > createPrettifyVerilogPass()
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
std::unique_ptr< mlir::Pass > createExportSplitVerilogPass(llvm::StringRef directory="./")
std::unique_ptr< mlir::Pass > createExportSplitChiselInterfacePass(mlir::StringRef outputDirectory="./")
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:852
std::unique_ptr< mlir::Pass > createLowerLTLToCorePass()
std::unique_ptr< mlir::Pass > createLowerFIRRTLToHWPass(bool enableAnnotationWarning=false, firrtl::VerificationFlavor assertionFlavor=firrtl::VerificationFlavor::None)
This is the pass constructor.
std::unique_ptr< mlir::Pass > createLowerSimToSVPass()
Definition SimToSV.cpp:379
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 > createExportChiselInterfacePass()
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:378
Definition verif.py:1