@@ -14,20 +14,19 @@ private[tywaves] object TypedConverter {
1414 private val chiselStageBaseArgs =
1515 Array (" --target" , " systemverilog" , " --split-verilog" , " --firtool-binary-path" , firtoolBinaryPath)
1616
17+ val firtoolBaseArgs : Seq [String ] =
18+ Seq (" -O=debug" , " -g" , " --emit-hgldd" , " --split-verilog" ) // Run in debug mode compiled with optimizations
1719 // Directories where the debug information is stored
1820 private var hglddDebugDir = " hgldd/debug"
1921 private var hglddWithOptDir = " hgldd/opt" // TODO: remove
2022 private var workingDir : Option [String ] = None
2123 private val topModuleName = TopModuleName (None )
2224
2325 // Default firtool options encoded as annotations for ChiselStage
24- private val defaultFirtoolOptAnno =
25- createFirtoolOptions(Seq (
26- " --emit-hgldd"
27- // "-disable-annotation-unknown",
28- // "--hgldd-output-prefix=<path>",
29- /* ,"--output-final-mlir=WORK.mlir"*/
30- ))
26+ private val defaultFirtoolOptAnno = createFirtoolOptions(firtoolBaseArgs)
27+ // "-disable-annotation-unknown",
28+ // "--hgldd-output-prefix=<path>",
29+ /* ,"--output-final-mlir=WORK.mlir"*/
3130
3231 // Map any sequence of string into FirtoolOptions
3332 private def createFirtoolOptions (args : Seq [String ]) = args.map(circt.stage.FirtoolOption )
@@ -37,8 +36,9 @@ private[tywaves] object TypedConverter {
3736 * [[circt.stage.ChiselStage ]]
3837 */
3938 def createDebugInfoHgldd [T <: RawModule ](
40- generateModule : () => T ,
41- workingDir : String = " workingDir" ,
39+ generateModule : () => T ,
40+ workingDir : String = " workingDir" ,
41+ additionalFirtoolArgs : Seq [String ],
4242 ): Unit = {
4343 this .workingDir = Some (workingDir)
4444 hglddWithOptDir = workingDir + " /" + hglddWithOptDir
@@ -54,10 +54,9 @@ private[tywaves] object TypedConverter {
5454 // annotations,
5555 // ) // execute returns the passThrough annotations in CIRCT transform stage
5656
57- // Run with debug mode
5857 val finalAnno = chiselStage.execute(
5958 chiselStageBaseArgs ++ Array (" --target-dir" , hglddDebugDir),
60- annotations ++ createFirtoolOptions( Seq ( " -O=debug " , " -g " )) ,
59+ createFirtoolOptions(additionalFirtoolArgs) ++ annotations ,
6160 ) // execute returns the passThrough annotations in CIRCT transform stage
6261
6362 // Get the module name
0 commit comments