CIRCT  20.0.0git
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 
18 #include "circt/Support/Passes.h"
20 #include "mlir/Transforms/Passes.h"
21 #include "llvm/Support/FileSystem.h"
22 #include "llvm/Support/Path.h"
23 
24 using namespace llvm;
25 using namespace circt;
26 
27 LogicalResult 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 
55 LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm,
56  const FirtoolOptions &opt,
57  StringRef inputFilename) {
58  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerSignaturesPass());
59 
60  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInjectDUTHierarchyPass());
61 
62  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
64 
65  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
67 
68  if (!opt.shouldDisableOptimization())
69  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
70  mlir::createCSEPass());
71 
72  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
74 
75  // Run LowerMatches before InferWidths, as the latter does not support the
76  // match statement, but it does support what they lower to.
77  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
79 
80  // Width inference creates canonicalization opportunities.
81  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInferWidthsPass());
82 
83  pm.nest<firrtl::CircuitOp>().addPass(
86 
87  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInferResetsPass());
88 
89  if (opt.shouldExportChiselInterface()) {
90  StringRef outdir = opt.getChiselInterfaceOutputDirectory();
91  if (opt.isDefaultOutputFilename() && outdir.empty()) {
92  pm.nest<firrtl::CircuitOp>().addPass(createExportChiselInterfacePass());
93  } else {
94  if (outdir.empty())
95  outdir = opt.getOutputFilename();
96  pm.nest<firrtl::CircuitOp>().addPass(
98  }
99  }
100 
101  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createDropConstPass());
102 
103  if (opt.shouldDedup())
104  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createDedupPass());
105 
106  if (opt.shouldConvertVecOfBundle()) {
107  pm.addNestedPass<firrtl::CircuitOp>(firrtl::createLowerFIRRTLTypesPass(
109  pm.addNestedPass<firrtl::CircuitOp>(firrtl::createVBToBVPass());
110  }
111 
112  if (!opt.shouldLowerMemories())
113  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
115 
116  // The input mlir file could be firrtl dialect so we might need to clean
117  // things up.
118  // pm.addNestedPass<firrtl::CircuitOp>(firrtl::createLowerSignaturesPass());
119  pm.addNestedPass<firrtl::CircuitOp>(firrtl::createLowerFIRRTLTypesPass(
120  opt.getPreserveAggregate(), firrtl::PreserveAggregate::None));
121 
122  {
123  auto &modulePM = pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>();
124  modulePM.addPass(firrtl::createExpandWhensPass());
125  modulePM.addPass(firrtl::createSFCCompatPass());
126  }
127 
128  pm.addNestedPass<firrtl::CircuitOp>(firrtl::createCheckCombLoopsPass());
129 
130  // Must run this pass after all diagnostic passes have run, otherwise it can
131  // hide errors.
132  pm.addNestedPass<firrtl::CircuitOp>(firrtl::createSpecializeLayersPass());
133 
134  // Run after inference, layer specialization.
136  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createProbesToSignalsPass());
137 
138  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
140 
141  if (opt.shouldAdvancedLayerSink())
142  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createAdvancedLayerSinkPass());
143  else
144  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
146 
147  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInlinerPass());
148 
149  // Preset the random initialization parameters for each module. The current
150  // implementation assumes it can run at a time where every register is
151  // currently in the final module it will be emitted in, all registers have
152  // been created, and no registers have yet been removed.
153  if (opt.isRandomEnabled(FirtoolOptions::RandomKind::Reg))
154  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
156 
157  // If we parsed a FIRRTL file and have optimizations enabled, clean it up.
158  if (!opt.shouldDisableOptimization())
159  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
161 
162  // Run the infer-rw pass, which merges read and write ports of a memory with
163  // mutually exclusive enables.
164  if (!opt.shouldDisableOptimization())
165  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
167 
169  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerMemoryPass());
170 
171  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createPrefixModulesPass());
172 
173  if (opt.shouldAddCompanionAssume())
174  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
176 
177  if (!opt.shouldDisableOptimization())
178  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createIMConstPropPass());
179 
180  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerLayersPass());
181 
182  pm.addNestedPass<firrtl::CircuitOp>(firrtl::createAddSeqMemPortsPass());
183 
187 
188  pm.addNestedPass<firrtl::CircuitOp>(firrtl::createExtractInstancesPass());
189 
190  // Run passes to resolve Grand Central features. This should run before
191  // BlackBoxReader because Grand Central needs to inform BlackBoxReader where
192  // certain black boxes should be placed. Note: all Grand Central Taps related
193  // collateral is resolved entirely by LowerAnnotations.
194  pm.addNestedPass<firrtl::CircuitOp>(
196 
197  // Run SymbolDCE as late as possible, but before InnerSymbolDCE. This is for
198  // hierpathop's and just for general cleanup.
199  pm.addNestedPass<firrtl::CircuitOp>(mlir::createSymbolDCEPass());
200 
201  // Run InnerSymbolDCE as late as possible, but before IMDCE.
202  pm.addPass(firrtl::createInnerSymbolDCEPass());
203 
204  // The above passes, IMConstProp in particular, introduce additional
205  // canonicalization opportunities that we should pick up here before we
206  // proceed to output-specific pipelines.
207  if (!opt.shouldDisableOptimization()) {
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.addPass(firrtl::createIMDeadCodeElimPass());
216  }
217 
218  if (opt.shouldEmitOMIR())
219  pm.nest<firrtl::CircuitOp>().addPass(
221 
222  // Always run this, required for legalization.
223  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
226 
227  if (!opt.shouldDisableOptimization())
228  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
230 
231  auto outputFilename = opt.getOutputFilename();
232  if (outputFilename == "-")
233  outputFilename = "";
234 
235  pm.nest<firrtl::CircuitOp>().addPass(
236  firrtl::createAssignOutputDirsPass(outputFilename));
237 
238  // Read black box source files into the IR.
239  StringRef blackBoxRoot = opt.getBlackBoxRootPath().empty()
240  ? llvm::sys::path::parent_path(inputFilename)
241  : opt.getBlackBoxRootPath();
242  pm.nest<firrtl::CircuitOp>().addPass(
243  firrtl::createBlackBoxReaderPass(blackBoxRoot));
244  return success();
245 }
246 
247 LogicalResult firtool::populateLowFIRRTLToHW(mlir::PassManager &pm,
248  const FirtoolOptions &opt) {
249  // Remove TraceAnnotations and write their updated paths to an output
250  // annotation file.
251  pm.nest<firrtl::CircuitOp>().addPass(
253 
254  // Lower the ref.resolve and ref.send ops and remove the RefType ports.
255  // LowerToHW cannot handle RefType so, this pass must be run to remove all
256  // RefType ports and ops.
257  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerXMRPass());
258 
259  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerDPIPass());
260  pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerClassesPass());
261  pm.nest<firrtl::CircuitOp>().addPass(om::createVerifyObjectFieldsPass());
262 
263  // Check for static asserts.
264  pm.nest<firrtl::CircuitOp>().nest<firrtl::FModuleOp>().addPass(
266 
268  opt.getVerificationFlavor()));
269 
270  if (!opt.shouldDisableOptimization()) {
271  auto &modulePM = pm.nest<hw::HWModuleOp>();
272  modulePM.addPass(mlir::createCSEPass());
273  modulePM.addPass(createSimpleCanonicalizerPass());
274  }
275 
276  // Check inner symbols and inner refs.
278 
279  // Check OM object fields.
280  pm.addPass(om::createVerifyObjectFieldsPass());
281 
282  // Run the verif op verification pass
283  pm.addNestedPass<hw::HWModuleOp>(verif::createVerifyClockedAssertLikePass());
284 
285  return success();
286 }
287 
288 LogicalResult firtool::populateHWToSV(mlir::PassManager &pm,
289  const FirtoolOptions &opt) {
290 
291  if (opt.shouldExtractTestCode())
296 
298  pm.addPass(circt::createLowerSimToSVPass());
300  {/*disableRegRandomization=*/!opt.isRandomEnabled(
301  FirtoolOptions::RandomKind::Reg),
302  /*disableMemRandomization=*/
303  !opt.isRandomEnabled(FirtoolOptions::RandomKind::Mem),
304  /*emitSeparateAlwaysBlocks=*/
306  pm.addNestedPass<hw::HWModuleOp>(createLowerVerifToSVPass());
307  pm.addPass(seq::createHWMemSimImplPass(
308  {/*disableMemRandomization=*/!opt.isRandomEnabled(
309  FirtoolOptions::RandomKind::Mem),
310  /*disableRegRandomization=*/
311  !opt.isRandomEnabled(FirtoolOptions::RandomKind::Reg),
312  /*replSeqMem=*/opt.shouldReplaceSequentialMemories(),
313  /*readEnableMode=*/opt.shouldIgnoreReadEnableMemories()
314  ? seq::ReadEnableMode::Ignore
315  : seq::ReadEnableMode::Undefined,
316  /*addMuxPragmas=*/opt.shouldAddMuxPragmas(),
317  /*addVivadoRAMAddressConflictSynthesisBugWorkaround=*/
319 
320  // If enabled, run the optimizer.
321  if (!opt.shouldDisableOptimization()) {
322  auto &modulePM = pm.nest<hw::HWModuleOp>();
323  modulePM.addPass(mlir::createCSEPass());
324  modulePM.addPass(createSimpleCanonicalizerPass());
325  modulePM.addPass(mlir::createCSEPass());
326  modulePM.addPass(sv::createHWCleanupPass(
327  /*mergeAlwaysBlocks=*/!opt.shouldEmitSeparateAlwaysBlocks()));
328  }
329 
330  // Check inner symbols and inner refs.
332 
333  // Check OM object fields.
334  pm.addPass(om::createVerifyObjectFieldsPass());
335 
336  return success();
337 }
338 
339 namespace detail {
340 LogicalResult
341 populatePrepareForExportVerilog(mlir::PassManager &pm,
342  const firtool::FirtoolOptions &opt) {
343 
344  // Run the verif op verification pass
345  pm.addNestedPass<hw::HWModuleOp>(verif::createVerifyClockedAssertLikePass());
346 
347  // Legalize unsupported operations within the modules.
348  pm.nest<hw::HWModuleOp>().addPass(sv::createHWLegalizeModulesPass());
349 
350  // Tidy up the IR to improve verilog emission quality.
351  if (!opt.shouldDisableOptimization())
352  pm.nest<hw::HWModuleOp>().addPass(sv::createPrettifyVerilogPass());
353 
354  if (opt.shouldStripFirDebugInfo())
355  pm.addPass(circt::createStripDebugInfoWithPredPass([](mlir::Location loc) {
356  if (auto fileLoc = dyn_cast<FileLineColLoc>(loc))
357  return fileLoc.getFilename().getValue().ends_with(".fir");
358  return false;
359  }));
360 
361  if (opt.shouldStripDebugInfo())
363  [](mlir::Location loc) { return true; }));
364 
365  // Emit module and testbench hierarchy JSON files.
366  if (opt.shouldExportModuleHierarchy())
368 
369  // Check inner symbols and inner refs.
371 
372  // Check OM object fields.
373  pm.addPass(om::createVerifyObjectFieldsPass());
374 
375  return success();
376 }
377 } // namespace detail
378 
379 LogicalResult
380 firtool::populateExportVerilog(mlir::PassManager &pm, const FirtoolOptions &opt,
381  std::unique_ptr<llvm::raw_ostream> os) {
382  if (failed(::detail::populatePrepareForExportVerilog(pm, opt)))
383  return failure();
384 
385  pm.addPass(createExportVerilogPass(std::move(os)));
386  return success();
387 }
388 
389 LogicalResult firtool::populateExportVerilog(mlir::PassManager &pm,
390  const FirtoolOptions &opt,
391  llvm::raw_ostream &os) {
392  if (failed(::detail::populatePrepareForExportVerilog(pm, opt)))
393  return failure();
394 
395  pm.addPass(createExportVerilogPass(os));
396  return success();
397 }
398 
399 LogicalResult firtool::populateExportSplitVerilog(mlir::PassManager &pm,
400  const FirtoolOptions &opt,
401  llvm::StringRef directory) {
402  if (failed(::detail::populatePrepareForExportVerilog(pm, opt)))
403  return failure();
404 
405  pm.addPass(createExportSplitVerilogPass(directory));
406  return success();
407 }
408 
409 LogicalResult firtool::populateFinalizeIR(mlir::PassManager &pm,
410  const FirtoolOptions &opt) {
411  pm.addPass(firrtl::createFinalizeIRPass());
412  pm.addPass(om::createFreezePathsPass());
413 
414  return success();
415 }
416 
417 LogicalResult firtool::populateHWToBTOR2(mlir::PassManager &pm,
418  const FirtoolOptions &opt,
419  llvm::raw_ostream &os) {
420  pm.addNestedPass<hw::HWModuleOp>(circt::createLowerLTLToCorePass());
421  pm.addNestedPass<hw::HWModuleOp>(circt::verif::createPrepareForFormalPass());
423  pm.addNestedPass<hw::HWModuleOp>(circt::createConvertHWToBTOR2Pass(os));
424  return success();
425 }
426 
427 //===----------------------------------------------------------------------===//
428 // FIRTOOL CommandLine Options
429 //===----------------------------------------------------------------------===//
430 
431 namespace {
432 /// This struct contains command line options that can be used to initialize
433 /// various bits of a Firtool pipeline. This uses a struct wrapper to avoid the
434 /// need for global command line options.
435 struct FirtoolCmdOptions {
436  llvm::cl::opt<std::string> outputFilename{
437  "o",
438  llvm::cl::desc("Output filename, or directory for split output"),
439  llvm::cl::value_desc("filename"),
440  llvm::cl::init("-"),
441  };
442 
443  llvm::cl::opt<bool> disableAnnotationsUnknown{
444  "disable-annotation-unknown",
445  llvm::cl::desc("Ignore unknown annotations when parsing"),
446  llvm::cl::init(false)};
447 
448  llvm::cl::opt<bool> disableAnnotationsClassless{
449  "disable-annotation-classless",
450  llvm::cl::desc("Ignore annotations without a class when parsing"),
451  llvm::cl::init(false)};
452 
453  llvm::cl::opt<bool> lowerAnnotationsNoRefTypePorts{
454  "lower-annotations-no-ref-type-ports",
455  llvm::cl::desc(
456  "Create real ports instead of ref type ports when resolving "
457  "wiring problems inside the LowerAnnotations pass"),
458  llvm::cl::init(false), llvm::cl::Hidden};
459 
460  llvm::cl::opt<bool> allowAddingPortsOnPublic{
461  "allow-adding-ports-on-public-modules",
462  llvm::cl::desc("Allow adding ports to public modules"),
463  llvm::cl::init(false), llvm::cl::Hidden};
464 
465  llvm::cl::opt<bool> probesToSignals{
466  "probes-to-signals",
467  llvm::cl::desc("Convert probes to non-probe signals"),
468  llvm::cl::init(false), llvm::cl::Hidden};
469 
471  preserveAggregate{
472  "preserve-aggregate",
473  llvm::cl::desc("Specify input file format:"),
474  llvm::cl::values(
475  clEnumValN(circt::firrtl::PreserveAggregate::None, "none",
476  "Preserve no aggregate"),
477  clEnumValN(circt::firrtl::PreserveAggregate::OneDimVec, "1d-vec",
478  "Preserve only 1d vectors of ground type"),
479  clEnumValN(circt::firrtl::PreserveAggregate::Vec, "vec",
480  "Preserve only vectors"),
481  clEnumValN(circt::firrtl::PreserveAggregate::All, "all",
482  "Preserve vectors and bundles")),
484  };
485 
487  "preserve-values",
488  llvm::cl::desc("Specify the values which can be optimized away"),
489  llvm::cl::values(
490  clEnumValN(firrtl::PreserveValues::Strip, "strip",
491  "Strip all names. No name is preserved"),
492  clEnumValN(firrtl::PreserveValues::None, "none",
493  "Names could be preserved by best-effort unlike `strip`"),
494  clEnumValN(firrtl::PreserveValues::Named, "named",
495  "Preserve values with meaningful names"),
496  clEnumValN(firrtl::PreserveValues::All, "all",
497  "Preserve all values")),
498  llvm::cl::init(firrtl::PreserveValues::None)};
499 
500  llvm::cl::opt<bool> enableDebugInfo{
501  "g", llvm::cl::desc("Enable the generation of debug information"),
502  llvm::cl::init(false)};
503 
504  // Build mode options.
506  "O", llvm::cl::desc("Controls how much optimization should be performed"),
507  llvm::cl::values(clEnumValN(firtool::FirtoolOptions::BuildModeDebug,
508  "debug",
509  "Compile with only necessary optimizations"),
510  clEnumValN(firtool::FirtoolOptions::BuildModeRelease,
511  "release", "Compile with optimizations")),
512  llvm::cl::init(firtool::FirtoolOptions::BuildModeDefault)};
513 
514  llvm::cl::opt<bool> disableOptimization{
515  "disable-opt",
516  llvm::cl::desc("Disable optimizations"),
517  };
518 
520  "export-chisel-interface",
521  llvm::cl::desc("Generate a Scala Chisel interface to the top level "
522  "module of the firrtl circuit"),
523  llvm::cl::init(false)};
524 
525  llvm::cl::opt<std::string> chiselInterfaceOutDirectory{
526  "chisel-interface-out-dir",
527  llvm::cl::desc(
528  "The output directory for generated Chisel interface files"),
529  llvm::cl::init("")};
530 
531  llvm::cl::opt<bool> vbToBV{
532  "vb-to-bv",
533  llvm::cl::desc("Transform vectors of bundles to bundles of vectors"),
534  llvm::cl::init(false)};
535 
536  llvm::cl::opt<bool> noDedup{
537  "no-dedup",
538  llvm::cl::desc("Disable deduplication of structurally identical modules"),
539  llvm::cl::init(false)};
540 
542  "grand-central-companion-mode",
543  llvm::cl::desc("Specifies the handling of Grand Central companions"),
544  ::llvm::cl::values(
545  clEnumValN(firrtl::CompanionMode::Bind, "bind",
546  "Lower companion instances to SystemVerilog binds"),
547  clEnumValN(firrtl::CompanionMode::Instantiate, "instantiate",
548  "Instantiate companions in the design"),
549  clEnumValN(firrtl::CompanionMode::Drop, "drop",
550  "Remove companions from the design")),
551  llvm::cl::init(firrtl::CompanionMode::Bind),
552  llvm::cl::Hidden,
553  };
554 
555  llvm::cl::opt<bool> disableAggressiveMergeConnections{
556  "disable-aggressive-merge-connections",
557  llvm::cl::desc(
558  "Disable aggressive merge connections (i.e. merge all field-level "
559  "connections into bulk connections)"),
560  llvm::cl::init(false)};
561 
562  llvm::cl::opt<bool> emitOMIR{
563  "emit-omir", llvm::cl::desc("Emit OMIR annotations to a JSON file"),
564  llvm::cl::init(true)};
565 
566  llvm::cl::opt<std::string> omirOutFile{
567  "output-omir", llvm::cl::desc("File name for the output omir"),
568  llvm::cl::init("")};
569 
570  llvm::cl::opt<bool> advancedLayerSink{
571  "advanced-layer-sink",
572  llvm::cl::desc("Sink logic into layer blocks (advanced)"),
573  llvm::cl::init(false)};
574 
575  llvm::cl::opt<bool> lowerMemories{
576  "lower-memories",
577  llvm::cl::desc("Lower memories to have memories with masks as an "
578  "array with one memory per ground type"),
579  llvm::cl::init(false)};
580 
581  llvm::cl::opt<std::string> blackBoxRootPath{
582  "blackbox-path",
583  llvm::cl::desc(
584  "Optional path to use as the root of black box annotations"),
585  llvm::cl::value_desc("path"),
586  llvm::cl::init(""),
587  };
588 
589  llvm::cl::opt<bool> replSeqMem{
590  "repl-seq-mem",
591  llvm::cl::desc("Replace the seq mem for macro replacement and emit "
592  "relevant metadata"),
593  llvm::cl::init(false)};
594 
595  llvm::cl::opt<std::string> replSeqMemFile{
596  "repl-seq-mem-file", llvm::cl::desc("File name for seq mem metadata"),
597  llvm::cl::init("")};
598 
599  llvm::cl::opt<bool> extractTestCode{
600  "extract-test-code", llvm::cl::desc("Run the extract test code pass"),
601  llvm::cl::init(false)};
602 
603  llvm::cl::opt<bool> ignoreReadEnableMem{
604  "ignore-read-enable-mem",
605  llvm::cl::desc("Ignore the read enable signal, instead of "
606  "assigning X on read disable"),
607  llvm::cl::init(false)};
608 
610  llvm::cl::desc(
611  "Disable random initialization code (may break semantics!)"),
612  llvm::cl::values(
613  clEnumValN(firtool::FirtoolOptions::RandomKind::Mem,
614  "disable-mem-randomization",
615  "Disable emission of memory randomization code"),
616  clEnumValN(firtool::FirtoolOptions::RandomKind::Reg,
617  "disable-reg-randomization",
618  "Disable emission of register randomization code"),
620  "disable-all-randomization",
621  "Disable emission of all randomization code")),
622  llvm::cl::init(firtool::FirtoolOptions::RandomKind::None)};
623 
624  llvm::cl::opt<std::string> outputAnnotationFilename{
625  "output-annotation-file",
626  llvm::cl::desc("Optional output annotation file"),
627  llvm::cl::CommaSeparated, llvm::cl::value_desc("filename")};
628 
629  llvm::cl::opt<bool> enableAnnotationWarning{
630  "warn-on-unprocessed-annotations",
631  llvm::cl::desc(
632  "Warn about annotations that were not removed by lower-to-hw"),
633  llvm::cl::init(false)};
634 
635  llvm::cl::opt<bool> addMuxPragmas{
636  "add-mux-pragmas",
637  llvm::cl::desc("Annotate mux pragmas for memory array access"),
638  llvm::cl::init(false)};
639 
641  "verification-flavor",
642  llvm::cl::desc("Specify a verification flavor used in LowerFIRRTLToHW"),
643  llvm::cl::values(
644  clEnumValN(firrtl::VerificationFlavor::None, "none",
645  "Use the flavor specified by the op"),
646  clEnumValN(firrtl::VerificationFlavor::IfElseFatal, "if-else-fatal",
647  "Use Use `if(cond) else $fatal(..)` format"),
648  clEnumValN(firrtl::VerificationFlavor::Immediate, "immediate",
649  "Use immediate verif statements"),
650  clEnumValN(firrtl::VerificationFlavor::SVA, "sva", "Use SVA")),
651  llvm::cl::init(firrtl::VerificationFlavor::None)};
652 
653  llvm::cl::opt<bool> emitSeparateAlwaysBlocks{
654  "emit-separate-always-blocks",
655  llvm::cl::desc(
656  "Prevent always blocks from being merged and emit constructs into "
657  "separate always blocks whenever possible"),
658  llvm::cl::init(false)};
659 
660  llvm::cl::opt<bool> etcDisableInstanceExtraction{
661  "etc-disable-instance-extraction",
662  llvm::cl::desc("Disable extracting instances only that feed test code"),
663  llvm::cl::init(false)};
664 
665  llvm::cl::opt<bool> etcDisableRegisterExtraction{
666  "etc-disable-register-extraction",
667  llvm::cl::desc("Disable extracting registers that only feed test code"),
668  llvm::cl::init(false)};
669 
670  llvm::cl::opt<bool> etcDisableModuleInlining{
671  "etc-disable-module-inlining",
672  llvm::cl::desc("Disable inlining modules that only feed test code"),
673  llvm::cl::init(false)};
674 
675  llvm::cl::opt<bool> addVivadoRAMAddressConflictSynthesisBugWorkaround{
676  "add-vivado-ram-address-conflict-synthesis-bug-workaround",
677  llvm::cl::desc(
678  "Add a vivado specific SV attribute (* ram_style = "
679  "\"distributed\" *) to unpacked array registers as a workaronud "
680  "for a vivado synthesis bug that incorrectly modifies "
681  "address conflict behavivor of combinational memories"),
682  llvm::cl::init(false)};
683 
684  //===----------------------------------------------------------------------===
685  // External Clock Gate Options
686  //===----------------------------------------------------------------------===
687 
688  llvm::cl::opt<std::string> ckgModuleName{
689  "ckg-name", llvm::cl::desc("Clock gate module name"),
690  llvm::cl::init("EICG_wrapper")};
691 
692  llvm::cl::opt<std::string> ckgInputName{
693  "ckg-input", llvm::cl::desc("Clock gate input port name"),
694  llvm::cl::init("in")};
695 
696  llvm::cl::opt<std::string> ckgOutputName{
697  "ckg-output", llvm::cl::desc("Clock gate output port name"),
698  llvm::cl::init("out")};
699 
700  llvm::cl::opt<std::string> ckgEnableName{
701  "ckg-enable", llvm::cl::desc("Clock gate enable port name"),
702  llvm::cl::init("en")};
703 
704  llvm::cl::opt<std::string> ckgTestEnableName{
705  "ckg-test-enable",
706  llvm::cl::desc("Clock gate test enable port name (optional)"),
707  llvm::cl::init("test_en")};
708 
709  llvm::cl::opt<bool> exportModuleHierarchy{
710  "export-module-hierarchy",
711  llvm::cl::desc("Export module and instance hierarchy as JSON"),
712  llvm::cl::init(false)};
713 
714  llvm::cl::opt<bool> stripFirDebugInfo{
715  "strip-fir-debug-info",
716  llvm::cl::desc(
717  "Disable source fir locator information in output Verilog"),
718  llvm::cl::init(true)};
719 
720  llvm::cl::opt<bool> stripDebugInfo{
721  "strip-debug-info",
722  llvm::cl::desc("Disable source locator information in output Verilog"),
723  llvm::cl::init(false)};
724 
725  llvm::cl::opt<bool> fixupEICGWrapper{
726  "fixup-eicg-wrapper",
727  llvm::cl::desc("Lower `EICG_wrapper` modules into clock gate intrinsics"),
728  llvm::cl::init(false)};
729 
730  llvm::cl::opt<bool> addCompanionAssume{
731  "add-companion-assume",
732  llvm::cl::desc("Add companion assumes to assertions"),
733  llvm::cl::init(false)};
734 };
735 } // namespace
736 
737 static llvm::ManagedStatic<FirtoolCmdOptions> clOptions;
738 
739 /// Register a set of useful command-line options that can be used to configure
740 /// various flags within the MLIRContext. These flags are used when constructing
741 /// an MLIR context for initialization.
743  // Make sure that the options struct has been initialized.
744  *clOptions;
745 }
746 
747 // Initialize the firtool options with defaults supplied by the cl::opts above.
749  : outputFilename("-"), disableAnnotationsUnknown(false),
750  disableAnnotationsClassless(false), lowerAnnotationsNoRefTypePorts(false),
751  allowAddingPortsOnPublic(false), probesToSignals(false),
752  preserveAggregate(firrtl::PreserveAggregate::None),
753  preserveMode(firrtl::PreserveValues::None), enableDebugInfo(false),
754  buildMode(BuildModeRelease), disableOptimization(false),
755  exportChiselInterface(false), chiselInterfaceOutDirectory(""),
756  vbToBV(false), noDedup(false), companionMode(firrtl::CompanionMode::Bind),
757  disableAggressiveMergeConnections(false), emitOMIR(true), omirOutFile(""),
758  advancedLayerSink(false), lowerMemories(false), blackBoxRootPath(""),
759  replSeqMem(false), replSeqMemFile(""), extractTestCode(false),
760  ignoreReadEnableMem(false), disableRandom(RandomKind::None),
761  outputAnnotationFilename(""), enableAnnotationWarning(false),
762  addMuxPragmas(false),
763  verificationFlavor(firrtl::VerificationFlavor::None),
764  emitSeparateAlwaysBlocks(false), etcDisableInstanceExtraction(false),
765  etcDisableRegisterExtraction(false), etcDisableModuleInlining(false),
766  addVivadoRAMAddressConflictSynthesisBugWorkaround(false),
767  ckgModuleName("EICG_wrapper"), ckgInputName("in"), ckgOutputName("out"),
768  ckgEnableName("en"), ckgTestEnableName("test_en"), ckgInstName("ckg"),
769  exportModuleHierarchy(false), stripFirDebugInfo(true),
770  stripDebugInfo(false), fixupEICGWrapper(false),
771  addCompanionAssume(false) {
772  if (!clOptions.isConstructed())
773  return;
774  outputFilename = clOptions->outputFilename;
775  disableAnnotationsUnknown = clOptions->disableAnnotationsUnknown;
776  disableAnnotationsClassless = clOptions->disableAnnotationsClassless;
777  lowerAnnotationsNoRefTypePorts = clOptions->lowerAnnotationsNoRefTypePorts;
778  allowAddingPortsOnPublic = clOptions->allowAddingPortsOnPublic;
779  probesToSignals = clOptions->probesToSignals;
780  preserveAggregate = clOptions->preserveAggregate;
781  preserveMode = clOptions->preserveMode;
782  enableDebugInfo = clOptions->enableDebugInfo;
783  buildMode = clOptions->buildMode;
784  disableOptimization = clOptions->disableOptimization;
785  exportChiselInterface = clOptions->exportChiselInterface;
786  chiselInterfaceOutDirectory = clOptions->chiselInterfaceOutDirectory;
787  vbToBV = clOptions->vbToBV;
788  noDedup = clOptions->noDedup;
789  companionMode = clOptions->companionMode;
791  clOptions->disableAggressiveMergeConnections;
792  emitOMIR = clOptions->emitOMIR;
793  omirOutFile = clOptions->omirOutFile;
794  advancedLayerSink = clOptions->advancedLayerSink;
795  lowerMemories = clOptions->lowerMemories;
796  blackBoxRootPath = clOptions->blackBoxRootPath;
797  replSeqMem = clOptions->replSeqMem;
798  replSeqMemFile = clOptions->replSeqMemFile;
799  extractTestCode = clOptions->extractTestCode;
800  ignoreReadEnableMem = clOptions->ignoreReadEnableMem;
801  disableRandom = clOptions->disableRandom;
802  outputAnnotationFilename = clOptions->outputAnnotationFilename;
803  enableAnnotationWarning = clOptions->enableAnnotationWarning;
804  addMuxPragmas = clOptions->addMuxPragmas;
805  verificationFlavor = clOptions->verificationFlavor;
806  emitSeparateAlwaysBlocks = clOptions->emitSeparateAlwaysBlocks;
807  etcDisableInstanceExtraction = clOptions->etcDisableInstanceExtraction;
808  etcDisableRegisterExtraction = clOptions->etcDisableRegisterExtraction;
809  etcDisableModuleInlining = clOptions->etcDisableModuleInlining;
811  clOptions->addVivadoRAMAddressConflictSynthesisBugWorkaround;
812  ckgModuleName = clOptions->ckgModuleName;
813  ckgInputName = clOptions->ckgInputName;
814  ckgOutputName = clOptions->ckgOutputName;
815  ckgEnableName = clOptions->ckgEnableName;
816  ckgTestEnableName = clOptions->ckgTestEnableName;
817  exportModuleHierarchy = clOptions->exportModuleHierarchy;
818  stripFirDebugInfo = clOptions->stripFirDebugInfo;
819  stripDebugInfo = clOptions->stripDebugInfo;
820  fixupEICGWrapper = clOptions->fixupEICGWrapper;
821  addCompanionAssume = clOptions->addCompanionAssume;
822 }
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:737
Set of options used to control the behavior of the firtool pipeline.
Definition: Firtool.h:30
bool shouldStripDebugInfo() const
Definition: Firtool.h:118
firrtl::PreserveAggregate::PreserveMode getPreserveAggregate() const
Definition: Firtool.h:65
bool shouldAddVivadoRAMAddressConflictSynthesisBugWorkaround() const
Definition: Firtool.h:130
firrtl::PreserveValues::PreserveMode preserveMode
Definition: Firtool.h:379
bool shouldAddCompanionAssume() const
Definition: Firtool.h:135
auto getVerificationFlavor() const
Definition: Firtool.h:125
StringRef getOmirOutputFile() const
Definition: Firtool.h:55
bool isDefaultOutputFilename() const
Definition: Firtool.h:85
StringRef getOutputFilename() const
Definition: Firtool.h:54
bool shouldDisableAggressiveMergeConnections() const
Definition: Firtool.h:121
StringRef getReplaceSequentialMemoriesFile() const
Definition: Firtool.h:60
bool addVivadoRAMAddressConflictSynthesisBugWorkaround
Definition: Firtool.h:407
bool shouldExportChiselInterface() const
Definition: Firtool.h:107
bool shouldAdvancedLayerSink() const
Definition: Firtool.h:101
bool shouldExtractTestCode() const
Definition: Firtool.h:133
std::string chiselInterfaceOutDirectory
Definition: Firtool.h:384
bool shouldFixupEICGWrapper() const
Definition: Firtool.h:134
bool shouldConvertProbesToSignals() const
Definition: Firtool.h:98
firrtl::PreserveValues::PreserveMode getPreserveMode() const
Definition: Firtool.h:42
StringRef getBlackBoxRootPath() const
Definition: Firtool.h:56
bool shouldDisableOptimization() const
Definition: Firtool.h:100
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:105
bool isRandomEnabled(RandomKind kind) const
Definition: Firtool.h:38
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:399
firrtl::VerificationFlavor verificationFlavor
Definition: Firtool.h:402
firrtl::PreserveAggregate::PreserveMode preserveAggregate
Definition: Firtool.h:378
bool shouldLowerMemories() const
Definition: Firtool.h:102
bool shouldEtcDisableModuleInlining() const
Definition: Firtool.h:115
bool shouldAllowAddingPortsOnPublic() const
Definition: Firtool.h:95
bool shouldLowerNoRefTypePortAnnotations() const
Definition: Firtool.h:92
bool shouldExportModuleHierarchy() const
Definition: Firtool.h:120
firrtl::CompanionMode companionMode
Definition: Firtool.h:387
seq::ExternalizeClockGateOptions getClockGateOptions() const
Definition: Firtool.h:70
bool shouldEnableDebugInfo() const
Definition: Firtool.h:104
bool shouldEmitSeparateAlwaysBlocks() const
Definition: Firtool.h:126
StringRef getChiselInterfaceOutputDirectory() const
Definition: Firtool.h:57
std::unique_ptr< mlir::Pass > createDedupPass()
Definition: Dedup.cpp:744
@ 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
@ 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()
Definition: FinalizeIR.cpp:46
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 > createResolveTracesPass(mlir::StringRef outputAnnotationFilename="")
std::unique_ptr< mlir::Pass > createEmitOMIRPass(mlir::StringRef outputFilename="")
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:995
std::unique_ptr< mlir::Pass > createGrandCentralPass(CompanionMode companionMode=CompanionMode::Bind)
std::unique_ptr< mlir::Pass > createLowerDPIPass()
Definition: LowerDPI.cpp:296
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 > createBlackBoxReaderPass(std::optional< mlir::StringRef > inputPrefix={})
std::unique_ptr< mlir::Pass > createCreateCompanionAssume()
std::unique_ptr< mlir::Pass > createCreateSiFiveMetadataPass(bool replSeqMem=false, mlir::StringRef replSeqMemFile="")
std::unique_ptr< mlir::Pass > createAdvancedLayerSinkPass()
std::unique_ptr< mlir::Pass > createLayerMergePass()
Definition: LayerMerge.cpp:72
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:102
std::unique_ptr< mlir::Pass > createLowerLayersPass()
std::unique_ptr< mlir::Pass > createIMDeadCodeElimPass()
std::unique_ptr< mlir::Pass > createLintingPass()
Definition: Lint.cpp:78
std::unique_ptr< mlir::Pass > createPassiveWiresPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createExtractInstancesPass()
std::unique_ptr< mlir::Pass > createLayerSinkPass()
Definition: LayerSink.cpp:61
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:860
std::unique_ptr< mlir::Pass > createLowerIntrinsicsPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createInferWidthsPass()
std::unique_ptr< mlir::Pass > createMemToRegOfVecPass(bool replSeqMem=false, bool ignoreReadEnable=false)
std::unique_ptr< mlir::Pass > createLowerOpenAggsPass()
This is the pass constructor.
std::unique_ptr< mlir::Pass > createAssignOutputDirsPass(mlir::StringRef outputDir="")
std::unique_ptr< mlir::Pass > createDropConstPass()
Definition: DropConst.cpp:110
std::unique_ptr< mlir::Pass > createSFCCompatPass()
Definition: SFCCompat.cpp:167
std::unique_ptr< mlir::Pass > createPrefixModulesPass()
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 populateHWToBTOR2(mlir::PassManager &pm, const FirtoolOptions &opt, llvm::raw_ostream &os)
Definition: Firtool.cpp:417
LogicalResult populateExportSplitVerilog(mlir::PassManager &pm, const FirtoolOptions &opt, llvm::StringRef directory)
Definition: Firtool.cpp:399
LogicalResult populateHWToSV(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition: Firtool.cpp:288
LogicalResult populateLowFIRRTLToHW(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition: Firtool.cpp:247
LogicalResult populateExportVerilog(mlir::PassManager &pm, const FirtoolOptions &opt, std::unique_ptr< llvm::raw_ostream > os)
Definition: Firtool.cpp:380
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:742
LogicalResult populateFinalizeIR(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition: Firtool.cpp:409
LogicalResult populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm, const FirtoolOptions &opt, StringRef inputFilename)
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 > createFreezePathsPass(std::function< StringAttr(Operation *)> getOpNameFallback={})
std::unique_ptr< mlir::Pass > createHWMemSimImplPass(const HWMemSimImplOptions &options={})
std::unique_ptr< mlir::Pass > createExternalizeClockGatePass(const ExternalizeClockGateOptions &options={})
std::unique_ptr< mlir::Pass > createHWExportModuleHierarchyPass()
std::unique_ptr< mlir::Pass > createSVExtractTestCodePass(bool disableInstanceExtraction=false, bool disableRegisterExtraction=false, bool disableModuleInlining=false)
std::unique_ptr< mlir::Pass > createHWLegalizeModulesPass()
std::unique_ptr< mlir::Pass > createPrettifyVerilogPass()
std::unique_ptr< mlir::Pass > createHWCleanupPass(bool mergeAlwaysBlocks=true)
Definition: HWCleanup.cpp:252
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
std::unique_ptr< mlir::Pass > createExportSplitChiselInterfacePass(mlir::StringRef outputDirectory="./")
std::unique_ptr< mlir::Pass > createExportVerilogPass(std::unique_ptr< llvm::raw_ostream > os)
std::unique_ptr< mlir::Pass > createExportChiselInterfacePass(llvm::raw_ostream &os)
std::unique_ptr< mlir::Pass > createExportSplitVerilogPass(llvm::StringRef directory="./")
std::unique_ptr< mlir::Pass > createConvertHWToBTOR2Pass(llvm::raw_ostream &os)
Definition: HWToBTOR2.cpp:1024
std::unique_ptr< OperationPass< hw::HWModuleOp > > createLowerVerifToSVPass()
Create the Verif to SV conversion pass.
Definition: VerifToSV.cpp:243
std::unique_ptr< mlir::Pass > createLowerSeqToSVPass(const LowerSeqToSVOptions &options={})
Definition: SeqToSV.cpp:844
std::unique_ptr< mlir::Pass > createLowerLTLToCorePass()
Definition: LTLToCore.cpp:168
std::unique_ptr< mlir::Pass > createLowerFIRRTLToHWPass(bool enableAnnotationWarning=false, firrtl::VerificationFlavor assertionFlavor=firrtl::VerificationFlavor::None)
This is the pass constructor.
Definition: LowerToHW.cpp:586
std::unique_ptr< mlir::Pass > createLowerSimToSVPass()
Definition: SimToSV.cpp:370
std::unique_ptr< Pass > createSimpleCanonicalizerPass()
Create a simple canonicalizer pass.
Definition: Passes.cpp:15
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:341