diff options
| author | Boyang Han | 2021-08-12 01:36:03 -0700 |
|---|---|---|
| committer | Boyang Han | 2021-08-12 01:36:03 -0700 |
| commit | aae627919336f0efff98dc47b2ea5694728d5350 (patch) | |
| tree | 5ecfade3a77e433a6e3675a98a9c5e5f93de9c14 /src/main/scala/chisel3/util/experimental | |
| parent | 75c00606df6a2ba48d5354f32d5dbe327552ad45 (diff) | |
Pass truth table to espresso using stdin instead of temp file
Diffstat (limited to 'src/main/scala/chisel3/util/experimental')
| -rw-r--r-- | src/main/scala/chisel3/util/experimental/decode/EspressoMinimizer.scala | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/scala/chisel3/util/experimental/decode/EspressoMinimizer.scala b/src/main/scala/chisel3/util/experimental/decode/EspressoMinimizer.scala index 0351a46a..3ecec048 100644 --- a/src/main/scala/chisel3/util/experimental/decode/EspressoMinimizer.scala +++ b/src/main/scala/chisel3/util/experimental/decode/EspressoMinimizer.scala @@ -56,20 +56,18 @@ object EspressoMinimizer extends Minimizer with LazyLogging { .toMap } - // Since Espresso don't implements pipe, we use a temp file to do so. val input = writeTable(table) logger.trace(s"""espresso input table: |$input |""".stripMargin) - val f = os.temp(input) - val o = try { - os.proc("espresso", f).call().out.chunks.mkString + val output = try { + os.proc("espresso").call(stdin = input).out.chunks.mkString } catch { case e: java.io.IOException if e.getMessage.contains("error=2, No such file or directory") => throw EspressoNotFoundException } logger.trace(s"""espresso output table: - |$o + |$output |""".stripMargin) - TruthTable(readTable(o), table.default) + TruthTable(readTable(output), table.default) } } |
