sifive / chisel-circt

Library to compile Chisel circuits using LLVM/MLIR (CIRCT)
Apache License 2.0
70 stars 10 forks source link

Error message drowns #23

Closed oharboe closed 1 year ago

oharboe commented 2 years ago

The error message from firtool is drowned out. The line with the actual error message is an [info] line:

[info] Running CIRCT: 'firtool -format=fir -warn-on-unprocessed-annotations -verify-each=false --lowering-options=disallowPackedArrays --split-verilog --dedup --strip-debug-info --extract-test-code -o=foo/ -disable-infer-rw -annotation-file foo.anno.json < $input'
[error] java.io.IOException: Pipe closed
[error]     at java.base/java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:260)
[error]     at java.base/java.io.PipedInputStream.awaitSpace(PipedInputStream.java:268)
[error]     at java.base/java.io.PipedInputStream.receive(PipedInputStream.java:231)
[error]     at java.base/java.io.PipedOutputStream.write(PipedOutputStream.java:149)
[error]     at scala.sys.process.BasicIO$.loop$1(BasicIO.scala:265)
[error]     at scala.sys.process.BasicIO$.transferFullyImpl(BasicIO.scala:271)
[error]     at scala.sys.process.BasicIO$.transferFully(BasicIO.scala:252)
[error]     at scala.sys.process.ProcessImpl$PipeThread.runloop(ProcessImpl.scala:186)
[error]     at scala.sys.process.ProcessImpl$PipeSource.go$1(ProcessImpl.scala:202)
[error]     at scala.sys.process.ProcessImpl$PipeSource.run(ProcessImpl.scala:205)
[lots of deleted stuff]
[info] firtool: Unknown command line argument '-disable-infer-rw'.  Try: 'firtool --help'
seldridge commented 2 years ago

What version of chisel-circt were you using that showed this? There was supposed to be a bunch of work that @mwachs5 did in https://github.com/sifive/chisel-circt/pull/15 to make this look better.

On top-of-tree, I'm seeing outputs like:

sbt:chisel-circt> runMain circt.stage.phases.Foo
[info] running circt.stage.phases.Foo 
Running CIRCT: 'firtool -format=fir -warn-on-unprocessed-annotations -verify-each=false -infer-rw -disable-infer-rw -dedup -annotation-file Foo.anno.json < $input'
------------------------------------------------------------------------------
Error: firtool failed.
ExitCode:
1
STDOUT:

STDERR:
firtool: Unknown command line argument '-infer-rw'.  Try: 'firtool --help'
firtool: Did you mean '--ir-hw'?

------------------------------------------------------------------------------
[error] (run-main-2) firrtl.options.StageError: 
[error] firrtl.options.StageError: 
[error]     at circt.stage.phases.CIRCT.transform(CIRCT.scala:179)
[error]     at circt.stage.phases.CIRCT.transform(CIRCT.scala:45)
[error]     at firrtl.options.DependencyManager.$anonfun$transform$5(DependencyManager.scala:280)
[error]     at firrtl.Utils$.time(Utils.scala:181)
[error]     at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:280)
[error]     at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]     at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]     at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]     at firrtl.options.DependencyManager.transform(DependencyManager.scala:269)
[error]     at firrtl.options.DependencyManager.transform$(DependencyManager.scala:255)
[error]     at firrtl.options.PhaseManager.transform(DependencyManager.scala:443)
[error]     at circt.stage.CIRCTStage.run(CIRCTStage.scala:44)
[error]     at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]     at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]     at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]     at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]     at firrtl.options.Translator.transform(Phase.scala:248)
[error]     at firrtl.options.Translator.transform$(Phase.scala:248)
[error]     at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]     at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:47)
[error]     at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]     at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]     at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]     at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:47)
[error]     at logger.Logger$.$anonfun$makeScope$2(Logger.scala:137)
[error]     at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]     at logger.Logger$.makeScope(Logger.scala:135)
[error]     at firrtl.options.Stage.transform(Stage.scala:47)
[error]     at firrtl.options.Stage.transform(Stage.scala:17)
[error]     at firrtl.options.DependencyManager.$anonfun$transform$5(DependencyManager.scala:280)
[error]     at firrtl.Utils$.time(Utils.scala:181)
[error]     at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:280)
[error]     at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]     at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]     at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]     at firrtl.options.DependencyManager.transform(DependencyManager.scala:269)
[error]     at firrtl.options.DependencyManager.transform$(DependencyManager.scala:255)
[error]     at firrtl.options.PhaseManager.transform(DependencyManager.scala:443)
[error]     at circt.stage.ChiselStage.run(ChiselStage.scala:44)
[error]     at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]     at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]     at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]     at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]     at firrtl.options.Translator.transform(Phase.scala:248)
[error]     at firrtl.options.Translator.transform$(Phase.scala:248)
[error]     at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]     at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:47)
[error]     at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]     at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]     at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]     at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:47)
[error]     at logger.Logger$.$anonfun$makeScope$2(Logger.scala:137)
[error]     at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]     at logger.Logger$.makeScope(Logger.scala:135)
[error]     at firrtl.options.Stage.transform(Stage.scala:47)
[error]     at firrtl.options.Stage.execute(Stage.scala:58)
[error]     at circt.stage.phases.Foo$.delayedEndpoint$circt$stage$phases$Foo$1(CIRCT.scala:224)
[error]     at circt.stage.phases.Foo$delayedInit$body.apply(CIRCT.scala:211)
[error]     at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error]     at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error]     at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error]     at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error]     at scala.collection.immutable.List.foreach(List.scala:431)
[error]     at scala.App.main(App.scala:80)
[error]     at scala.App.main$(App.scala:78)
[error]     at circt.stage.phases.Foo$.main(CIRCT.scala:211)
[error]     at circt.stage.phases.Foo.main(CIRCT.scala)
[error]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] stack trace is suppressed; run last Compile / bgRunMain for the full output
[error] Nonzero exit code: 1

For a design like:

object Foo extends App {
  import chisel3._

  class Foo extends RawModule {
    val a = IO(Input(Bool()))
    val b = IO(Output(Bool()))

    b := a
  }

  (new circt.stage.ChiselStage)
    .execute(
      Array("--target", "systemverilog"),
      Seq(chisel3.stage.ChiselGeneratorAnnotation(() => new Foo), circt.stage.FirtoolOption("-infer-rw"))
    )

}
seldridge commented 1 year ago

I'm going to close this given that I think it's fixed. Any issues you're still seeing, feel free to open an issue on upstream Chisel.