aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/stage/FirrtlCli.scala
blob: d416e25faf4d7767d62bcf1151f8734f69b81ff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: Apache-2.0

package firrtl.stage

import firrtl.options.Shell
import firrtl.passes.CommonSubexpressionElimination
import firrtl.transforms.{CustomRadixTransform, NoCircuitDedupAnnotation}

/** [[firrtl.options.Shell Shell]] mixin that provides command line options for FIRRTL. This does not include any
  * [[firrtl.options.RegisteredLibrary RegisteredLibrary]] or [[firrtl.options.RegisteredTransform RegisteredTransform]]
  * as those are automatically loaded by the [[firrtl.options.Stage Stage]] using this [[firrtl.options.Shell Shell]].
  */
trait FirrtlCli { this: Shell =>
  parser.note("FIRRTL Compiler Options")
  Seq(
    FirrtlFileAnnotation,
    FirrtlDirectoryAnnotation,
    OutputFileAnnotation,
    InfoModeAnnotation,
    FirrtlSourceAnnotation,
    RunFirrtlTransformAnnotation,
    firrtl.EmitCircuitAnnotation,
    firrtl.EmitAllModulesAnnotation,
    NoCircuitDedupAnnotation,
    WarnNoScalaVersionDeprecation,
    PrettyNoExprInlining,
    DisableFold,
    OptimizeForFPGA,
    CurrentFirrtlStateAnnotation,
    CommonSubexpressionElimination,
    AllowUnrecognizedAnnotations,
    CustomRadixTransform
  )
    .map(_.addOptions(parser))

  phases.DriverCompatibility.TopNameAnnotation.addOptions(parser)
  phases.DriverCompatibility.EmitOneFilePerModuleAnnotation.addOptions(parser)
}