tdb-alcorn / chisel-formal

Other
23 stars 3 forks source link

NoSuchMethodError: void chisel3.Clock.$colon$eq(scala.Function0, chisel3.internal.sourceinfo.SourceInfo, chisel3.CompileOptions)' #9

Closed Martoni closed 4 years ago

Martoni commented 4 years ago

With following versions:

$ java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Debian-1deb10u1, mixed mode, sharing)
$ scala -version
Scala code runner version 2.12.12 -- Copyright 2002-2020, LAMP/EPFL and Lightbend, Inc.
$ sbt "sbtVersion"
$ sbt "sbtVersion"
[info] welcome to sbt 1.3.13 (Debian Java 11.0.8)

(I also forced sbt version 1.4.1 in chisel-formal file project/build.properties with the same error)

I'm trying to use chisel-formal on several computer with different installation. The Module under test is named GbWrite.

I published chisel-formal locally with git master clone :

$ sbt "publishLocal"

And in my project, if I comment the trait :

class GbWrite (val datawidth: Int = 8,
               val input_sync: Boolean = true,
               val aformal: Boolean = false) extends Module {//with Formal {

I can execute the driver correctly with sbt :

sbt "runMain gbvga.GbWriteDriver"
[info] welcome to sbt 1.4.1 (Debian Java 11.0.8)
[info] loading project definition from /media/stockage/projets/GbVga/chisel/project
[info] loading settings for project chisel from build.sbt ...
[info] set current project to gbvga (in build file:/media/stockage/projets/GbVga/chisel/)
[info] compiling 1 Scala source to /media/stockage/projets/GbVga/chisel/target/scala-2.12/classes ...
[info] running gbvga.GbWriteDriver 
[info] [0.004] Elaborating design...
[info] [0.187] Done elaborating.
[success] Total time: 14 s, completed Oct 22, 2020, 9:32:15 PM

But if I uncomment the trait with Formal I've got this stack error:

sbt "runMain gbvga.GbWriteDriver"
[info] welcome to sbt 1.4.1 (Debian Java 11.0.8)
[info] loading project definition from /media/stockage/projets/GbVga/chisel/project
[info] loading settings for project chisel from build.sbt ...
[info] set current project to gbvga (in build file:/media/stockage/projets/GbVga/chisel/)
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] compiling 5 Scala sources to /media/stockage/projets/GbVga/chisel/target/scala-2.12/classes ...
[info] running gbvga.GbWriteDriver 
[info] [0.003] Elaborating design...
[error] java.lang.NoSuchMethodError: 'void chisel3.Clock.$colon$eq(scala.Function0, chisel3.internal.sourceinfo.SourceInfo, chisel3.CompileOptions)'
[error]     ...
[error]     at gbvga.GbWrite.<init>(gbwrite.scala:12)
[error]     at gbvga.GbWriteDriver$.$anonfun$new$5(gbwrite.scala:84)
[error]     ... (Stack trace trimmed to user code only, rerun with --full-stacktrace if you wish to see the full stack trace)
[error] (run-main-0) firrtl.options.StageError: 
[error] firrtl.options.StageError: 
[error]     at chisel3.stage.ChiselStage.run(ChiselStage.scala:49)
[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:242)
[error]     at firrtl.options.Translator.transform$(Phase.scala:242)
[error]     at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]     at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:46)
[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:89)
[error]     at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:46)
[error]     at logger.Logger$.$anonfun$makeScope$2(Logger.scala:168)
[error]     at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]     at logger.Logger$.makeScope(Logger.scala:166)
[error]     at firrtl.options.Stage.transform(Stage.scala:46)
[error]     at firrtl.options.Stage.execute(Stage.scala:57)
[error]     at gbvga.GbWriteDriver$.delayedEndpoint$gbvga$GbWriteDriver$1(gbwrite.scala:84)
[error]     at gbvga.GbWriteDriver$delayedInit$body.apply(gbwrite.scala:82)
[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:392)
[error]     at scala.App.main(App.scala:80)
[error]     at scala.App.main$(App.scala:78)
[error]     at gbvga.GbWriteDriver$.main(gbwrite.scala:82)
[error]     at gbvga.GbWriteDriver.main(gbwrite.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] Caused by: chisel3.internal.ChiselException: Exception thrown when elaborating ChiselGeneratorAnnotation
[error]     at chisel3.stage.ChiselGeneratorAnnotation.elaborate(ChiselAnnotations.scala:55)
[error]     at chisel3.stage.phases.Elaborate.$anonfun$transform$1(Elaborate.scala:19)
[error]     at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:245)
[error]     at scala.collection.immutable.List.foreach(List.scala:392)
[error]     at scala.collection.TraversableLike.flatMap(TraversableLike.scala:245)
[error]     at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:242)
[error]     at scala.collection.immutable.List.flatMap(List.scala:355)
[error]     at chisel3.stage.phases.Elaborate.transform(Elaborate.scala:18)
[error]     at chisel3.stage.phases.Elaborate.transform(Elaborate.scala:16)
[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:242)
[error]     at firrtl.options.Translator.transform$(Phase.scala:242)
[error]     at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]     at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:267)
[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:89)
[error]     at firrtl.options.DependencyManager.transform(DependencyManager.scala:260)
[error]     at firrtl.options.DependencyManager.transform$(DependencyManager.scala:245)
[error]     at firrtl.options.PhaseManager.transform(DependencyManager.scala:424)
[error]     at chisel3.stage.ChiselStage.run(ChiselStage.scala:35)
[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:242)
[error]     at firrtl.options.Translator.transform$(Phase.scala:242)
[error]     at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]     at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:46)
[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:89)
[error]     at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:46)
[error]     at logger.Logger$.$anonfun$makeScope$2(Logger.scala:168)
[error]     at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]     at logger.Logger$.makeScope(Logger.scala:166)
[error]     at firrtl.options.Stage.transform(Stage.scala:46)
[error]     at firrtl.options.Stage.execute(Stage.scala:57)
[error]     at gbvga.GbWriteDriver$.delayedEndpoint$gbvga$GbWriteDriver$1(gbwrite.scala:84)
[error]     at gbvga.GbWriteDriver$delayedInit$body.apply(gbwrite.scala:82)
[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:392)
[error]     at scala.App.main(App.scala:80)
[error]     at scala.App.main$(App.scala:78)
[error]     at gbvga.GbWriteDriver$.main(gbwrite.scala:82)
[error]     at gbvga.GbWriteDriver.main(gbwrite.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] Caused by: java.lang.NoSuchMethodError: 'void chisel3.Clock.$colon$eq(scala.Function0, chisel3.internal.sourceinfo.SourceInfo, chisel3.CompileOptions)'
[error]     at chisel3.formal.Formal.$init$(Formal.scala:15)
[error]     at gbvga.GbWrite.<init>(gbwrite.scala:12)
[error]     at gbvga.GbWriteDriver$.$anonfun$new$5(gbwrite.scala:84)
[error]     at chisel3.Module$.do_apply(Module.scala:52)
[error]     at chisel3.stage.ChiselGeneratorAnnotation.$anonfun$elaborate$1(ChiselAnnotations.scala:50)
[error]     at chisel3.internal.Builder$.$anonfun$build$1(Builder.scala:413)
[error]     at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]     at chisel3.internal.Builder$.build(Builder.scala:411)
[error]     at chisel3.stage.ChiselGeneratorAnnotation.elaborate(ChiselAnnotations.scala:50)
[error]     at chisel3.stage.phases.Elaborate.$anonfun$transform$1(Elaborate.scala:19)
[error]     at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:245)
[error]     at scala.collection.immutable.List.foreach(List.scala:392)
[error]     at scala.collection.TraversableLike.flatMap(TraversableLike.scala:245)
[error]     at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:242)
[error]     at scala.collection.immutable.List.flatMap(List.scala:355)
[error]     at chisel3.stage.phases.Elaborate.transform(Elaborate.scala:18)
[error]     at chisel3.stage.phases.Elaborate.transform(Elaborate.scala:16)
[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:242)
[error]     at firrtl.options.Translator.transform$(Phase.scala:242)
[error]     at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]     at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:267)
[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:89)
[error]     at firrtl.options.DependencyManager.transform(DependencyManager.scala:260)
[error]     at firrtl.options.DependencyManager.transform$(DependencyManager.scala:245)
[error]     at firrtl.options.PhaseManager.transform(DependencyManager.scala:424)
[error]     at chisel3.stage.ChiselStage.run(ChiselStage.scala:35)
[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:242)
[error]     at firrtl.options.Translator.transform$(Phase.scala:242)
[error]     at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]     at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:46)
[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:89)
[error]     at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:46)
[error]     at logger.Logger$.$anonfun$makeScope$2(Logger.scala:168)
[error]     at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]     at logger.Logger$.makeScope(Logger.scala:166)
[error]     at firrtl.options.Stage.transform(Stage.scala:46)
[error]     at firrtl.options.Stage.execute(Stage.scala:57)
[error]     at gbvga.GbWriteDriver$.delayedEndpoint$gbvga$GbWriteDriver$1(gbwrite.scala:84)
[error]     at gbvga.GbWriteDriver$delayedInit$body.apply(gbwrite.scala:82)
[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:392)
[error]     at scala.App.main(App.scala:80)
[error]     at scala.App.main$(App.scala:78)
[error]     at gbvga.GbWriteDriver$.main(gbwrite.scala:82)
[error]     at gbvga.GbWriteDriver.main(gbwrite.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
[error] (Compile / runMain) Nonzero exit code: 1
[error] Total time: 15 s, completed Oct 22, 2020, 9:24:41 PM
ekiwi commented 4 years ago

It could be that you are seeing this error because of incompatible Chisel versions.

On a cursory glance it look like your project is using chisel 3.4.0: https://github.com/Martoni/GbVga/blob/master/chisel/build.sbt#L45

Whereas chisel-formal depends on chisel 3.4-RC1: https://github.com/tdb-alcorn/chisel-formal/blob/master/build.sbt#L32

Updating chisel-formal to use the 3.4.0 release version might help.

Martoni commented 4 years ago

Thank you, it was exactly that \o/ !

jackkoenig commented 4 years ago

As a tip, SBT does warn about these kind of things, but it's easy to ignore (everyone does, myself included):

sbt:gbvga> compile
[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] Compiling 5 Scala sources to /scratch/koenig/GbVga/chisel/target/scala-2.12/classes ...
[success] Total time: 2 s, completed Oct 23, 2020 11:49:56 AM

If you run evicted, you'll see:

sbt:gbvga> evicted
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]  * edu.berkeley.cs:firrtl_2.12:1.4.0 is selected over {1.4.0-RC1, 1.2.7, 1.2.7, 1.2.7}
[warn]      +- edu.berkeley.cs:chisel3-core_2.12:3.4.0            (depends on 1.4.0)
[warn]      +- edu.berkeley.cs:treadle_2.12:1.1.7                 (depends on 1.2.7)
[warn]      +- edu.berkeley.cs:firrtl-interpreter_2.12:1.2.7      (depends on 1.2.7)
[warn]      +- edu.berkeley.cs:chisel-iotesters_2.12:1.3.7        (depends on 1.2.7)
[warn]      +- edu.berkeley.cs:chisel-formal_2.12:0.1-SNAPSHOT    (depends on 1.4.0-RC1)
[info] Here are other dependency conflicts that were resolved:
[info]  * org.json4s:json4s-native_2.12:3.6.9 is selected over 3.6.7
[info]      +- edu.berkeley.cs:firrtl_2.12:1.4.0                  (depends on 3.6.9)
[info]      +- edu.berkeley.cs:treadle_2.12:1.1.7                 (depends on 3.6.7)
[success] Total time: 0 s, completed Oct 23, 2020 11:46:30 AM
sbt:gbvga> 

This is before your recent fix, however, even with the fix, you're likely to run into other binary incompatibilies:

sbt:gbvga> evicted
[warn] Found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[warn]  * edu.berkeley.cs:chisel3_2.12:3.4.0-RC1 is selected over 3.2.7
[warn]      +- eu.fabienm:gbvga_2.12:0.1                          (depends on 3.4.0-RC1)
[warn]      +- edu.berkeley.cs:chisel-iotesters_2.12:1.3.7        (depends on 3.2.7)
[warn]  * edu.berkeley.cs:firrtl_2.12:1.4.0-RC1 is selected over {1.2.7, 1.2.7, 1.2.7}
[warn]      +- edu.berkeley.cs:chisel-formal_2.12:0.1-SNAPSHOT    (depends on 1.4.0-RC1)
[warn]      +- edu.berkeley.cs:chisel3-core_2.12:3.4.0-RC1        (depends on 1.4.0-RC1)
[warn]      +- edu.berkeley.cs:chisel3_2.12:3.4.0-RC1             (depends on 1.4.0-RC1)
[warn]      +- edu.berkeley.cs:chisel3-macros_2.12:3.4.0-RC1      (depends on 1.4.0-RC1)
[warn]      +- edu.berkeley.cs:treadle_2.12:1.1.7                 (depends on 1.2.7)
[warn]      +- edu.berkeley.cs:firrtl-interpreter_2.12:1.2.7      (depends on 1.2.7)
[warn]      +- edu.berkeley.cs:chisel-iotesters_2.12:1.3.7        (depends on 1.2.7)
[info] Here are other dependency conflicts that were resolved:
[info]  * org.json4s:json4s-native_2.12:3.6.9 is selected over 3.6.7
[info]      +- edu.berkeley.cs:firrtl_2.12:1.4.0-RC1              (depends on 3.6.9)
[info]      +- edu.berkeley.cs:treadle_2.12:1.1.7                 (depends on 3.6.7)
[success] Total time: 0 s, completed Oct 23, 2020 11:51:01 AM
sbt:gbvga> 

In particular:

[warn]      +- edu.berkeley.cs:chisel-iotesters_2.12:1.3.7        (depends on 3.2.7)

You should update to chisel-iotesters to 1.5.0-RC1 (iotesters is always 1 major version ahead) which was published against chisel3 3.4.0-RC1.