summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/ChiselExecutionOptions.scala
blob: a3644829fcaebafb9a4d41115293af604eda79da (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
39
40
41
// See LICENSE for license details.

package chisel3

import firrtl.{ExecutionOptionsManager, ComposableOptions}

//TODO: provide support for running firrtl as separate process, could alternatively be controlled by external driver
//TODO: provide option for not saving chirrtl file, instead calling firrtl with in memory chirrtl
/**
  * Options that are specific to chisel.
  *
  * @param runFirrtlCompiler when true just run chisel, when false run chisel then compile its output with firrtl
  * @note this extends FirrtlExecutionOptions which extends CommonOptions providing easy access to down chain options
  */
case class ChiselExecutionOptions(
                                   runFirrtlCompiler: Boolean = true,
                                   printFullStackTrace: Boolean = false
                                   // var runFirrtlAsProcess: Boolean = false
                                 ) extends ComposableOptions

trait HasChiselExecutionOptions {
  self: ExecutionOptionsManager =>

  var chiselOptions = ChiselExecutionOptions()

  parser.note("chisel3 options")

  parser.opt[Unit]("no-run-firrtl")
    .abbr("chnrf")
    .foreach { _ =>
      chiselOptions = chiselOptions.copy(runFirrtlCompiler = false)
    }
    .text("Stop after chisel emits chirrtl file")

  parser.opt[Unit]("full-stacktrace")
    .foreach { _ =>
      chiselOptions = chiselOptions.copy(printFullStackTrace = true)
    }
    .text("Do not trim stack trace")
}