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