Problems building with Scala Metals and Chisel v3.4.0

251 views
Skip to first unread message

Øyvind Harboe

unread,
Aug 25, 2020, 10:01:02 AM8/25/20
to chisel-users
I got this error in Scala Metals today.

ERROR Unexpected error when compiling fiddlybob: 'Multiple phases want to run right after typer; followers: chiselcomponent,semanticdb-typer; created phase-order.dot'

I *suspect* the problem is that I've added the chisel3-plugin incorrectly:

+addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % "3.4.0-RC1" cross CrossVersion.full)
+
 

Jack Koenig

unread,
Aug 25, 2020, 2:44:28 PM8/25/20
to chisel...@googlegroups.com
Actually, I think this is a real bug. The chisel3-plugin is currently saying it needs to run "right after" the typer phase of scalac, but semanticdb-typer (used by metals and lots of other projects) also says it needs to run "right after". Since chisel3-plugin is actually more flexible, we just need to loosen that dependency.

Thanks for trying it out, Øyvind! This was a good catch.

~Jack

--
You received this message because you are subscribed to the Google Groups "chisel-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chisel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/bba504f8-902e-463e-8eca-b5001538a01fn%40googlegroups.com.

Øyvind Harboe

unread,
Aug 25, 2020, 3:14:38 PM8/25/20
to chisel...@googlegroups.com
Other than reverting my change, any ideas for a workaround?

Perhaps I could add this plugin only when I elaborate and not inside VSCode?


I compile with VScode to navigate and syntax check the code, not to elaborate or run tests.

You received this message because you are subscribed to a topic in the Google Groups "chisel-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chisel-users/K_vuliudgLg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chisel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/CAFooY_Rr3x0Z_9fJyWbTjEzqXPK9MTV1cSgvWR48rkkqTE0uog%40mail.gmail.com.

Jack Koenig

unread,
Aug 25, 2020, 3:40:23 PM8/25/20
to chisel...@googlegroups.com
The only workaround (other than reverting) I can think of is building from source with the bugfix:
You can use the branch or wait for the PR to be merged and use master: https://github.com/freechipsproject/chisel3/pull/1568

cd chisel3
git checkout relax-plugin-scalac-phase-order
sbt
> project plugin
> +publishLocal

Then switch to using the locally published SNAPSHOT in your build.sbt

addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % "3.4-SNAPSHOT" cross CrossVersion.full)

You shouldn't need to follow full chisel3 build-from-source instructions because we're only building the compiler plugin which has few dependencies.
Make sure to do the `project plugin` bit or you'll probably run into other issues like needing to build firrtl. This should be unnecessary.
Also note that +publishLocal publishes for all support Scala minor versions. I don't know what version you're using so that's the safest bet. You could only publish for the version you're using via:

sbt
> project plugin
> ++2.12.<X>
> publishLocal

~Jack

Øyvind Harboe

unread,
Aug 26, 2020, 1:32:39 AM8/26/20
to chisel-users
In our setup we don't have our own private repository for maven artifacts, so doing this locally doesn't work with our flow. It won't include build servers or other developers...

I'm going to google a bit to see if I can have some conditional code under bloop(bulid system of choice for Scala Metals under VSCode), or I'll revert for now.

Øyvind Harboe

unread,
Sep 19, 2020, 2:59:01 AM9/19/20
to chisel-users
This is fixed in v3.4.0-RC2.

Thanks!

Øyvind Harboe

unread,
Sep 21, 2020, 6:48:54 AM9/21/20
to chisel-users
Ooops... Strike that.

It still doesn't work in v3.4.0-RC2.

2020.09.21 10:48:22 ERROR Unexpected error when compiling aptos: 'Multiple phases want to run right after typer; followers: chiselcomponent,semanticdb-typer; created phase-order.dot'

Jack Koenig

unread,
Sep 21, 2020, 12:07:10 PM9/21/20
to chisel...@googlegroups.com
Sorry about that Øyvind,

RC2 was a little bit of a misfire, another release candidate is coming shortly.

~Jack

Øyvind Harboe

unread,
Sep 21, 2020, 12:46:16 PM9/21/20
to chisel-users
OK. Will try again.

Jack Koenig

unread,
Sep 24, 2020, 2:37:07 PM9/24/20
to chisel...@googlegroups.com
Hi Øyvind (and everyone),

Chisel 3.4.0-RC3 is live, please try it out! Many improvements since RC1, including the fix for this particular issue.

~Jack

Øyvind Harboe

unread,
Sep 24, 2020, 3:48:26 PM9/24/20
to chisel-users
Scala Metals now works w/v3.4.0-RC3 and the chisel3-plugin(which provides better Verilog names).

Thanks!

Reply all
Reply to author
Forward
0 new messages