8000 ChiselSim - simulate a circuit with debug "-g" fitool option · Issue #3932 · chipsalliance/chisel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
ChiselSim - simulate a circuit with debug "-g" fitool option #3932
Closed
@rameloni

Description

@rameloni

I have created a new simulator that uses svsim to output a vcd file with the verilator backend. I used the EphemeralSimulator as starting point.

Now I would like to use the "-g" option for the simulation, however I haven't find any way to do that. It seems it is not possible at the moment. I have seen that the annotations passed to chiselStage.execute are fixed.

implicit class ChiselWorkspace(workspace: Workspace) {
def elaborateGeneratedModule[T <: RawModule](
generateModule: () => T
): ElaboratedModule[T] = {
// Use CIRCT to generate SystemVerilog sources, and potentially additional artifacts
var someDut: Option[T] = None
val outputAnnotations = (new circt.stage.ChiselStage).execute(
Array("--target", "systemverilog", "--split-verilog"),
Seq(
chisel3.stage.ChiselGeneratorAnnotation { () =>
val dut = generateModule()
someDut = Some(dut)
dut
},
circt.stage.FirtoolOption("-disable-annotation-unknown"),
firrtl.options.TargetDirAnnotation(workspace.supportArtifactsPath)
)
)

It would be nice to have something that allows to select optimization options or directly passing firtooloptions like here. Either as a field of workspace or of the simulator or as an argument here.

  def elaborateGeneratedModule[T <: RawModule](
      generateModule: () => T
  )(firtoolArgs: Seq[String] = Seq()): ElaboratedModule[T] = {
    // Use CIRCT to generate SystemVerilog sources, and potentially additional artifacts
    var someDut: Option[T] = None

    val firtoolOptions = firtoolArgs.map(circt.stage.FirtoolOption)

    val outputAnnotations = (new circt.stage.ChiselStage).execute(
      Array("--target", "systemverilog", "--split-verilog"),
      Seq(
        chisel3.stage.ChiselGeneratorAnnotation { () =>
          val dut = generateModule()
          someDut = Some(dut)
          dut
        },
        circt.stage.FirtoolOption("-disable-annotation-unknown"),
        firrtl.options.TargetDirAnnotation(workspace.supportArtifactsPath),
      ) ++
        firtoolOptions,
    ) 
    // ....
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0