Skip to content

Commit

Permalink
Compiler mini fix (#23)
Browse files Browse the repository at this point in the history
* Fixed file path error when no output dir specified

* Specified empty list for outputDir

---------

Co-authored-by: John Patrick Drab <[email protected]>
  • Loading branch information
johndrab and John Patrick Drab authored Apr 9, 2024
1 parent 9167e79 commit 7974dc9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/scala/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,16 @@ class EssentCompiler(opt: OptFlags) {
val firrtlCompiler = new transforms.Compiler(readyForEssent)
val resultState = firrtlCompiler.execute(CircuitState(circuit, Seq()))
if (opt.dumpLoFirrtl) {
val debugWriter = new FileWriter(new File(opt.outputDir(), s"$topName.lo.fir"))
val debugFilename = new File(opt.outputDir(), s"$topName.lo.fir")
val debugWriter = new FileWriter(debugFilename)
debugWriter.write(resultState.circuit.serialize)
debugWriter.close()
}
val dutWriter = new FileWriter(new File(opt.outputDir(), s"$topName.h"))

val outputDir = if (opt.outputDir().nonEmpty) opt.outputDir() else System.getProperty("user.dir")
val dutFile = new File(outputDir, s"$topName.h")

val dutWriter = new FileWriter(dutFile)
val emitter = new EssentEmitter(opt, dutWriter,resultState.circuit)
emitter.execute(resultState.circuit)
dutWriter.close()
Expand Down

0 comments on commit 7974dc9

Please sign in to comment.