confusion on the built process of the rocket chip generator

158 views
Skip to first unread message

Jerry Ho

unread,
Sep 12, 2020, 11:03:17 PM9/12/20
to RISC-V HW Dev
Inside the directory of Rocket chip generator, there is a file name build.wake, I googled that it is a build tool.  I have no idea how that is correlated with sbt?
As far as I understand, the project uses 3 build system---make, sbt and wake. Can anyone clarify to me why they decide build the whole system this way?
I am new to the make system, and I have no idea why type "make" inside the emulator directory will cause the scala project to be compiled and the verilog emited, I thought there will be some stuff like" sbt run" literals in the makefile inside the emulator directory,  unfortunately I didnt  find any.  I know this is a trivial question, but can anyone help out about this, I am new to the build system,
Any comments will be appreciated! 

Jack Koenig

unread,
Sep 15, 2020, 2:22:57 PM9/15/20
to Jerry Ho, RISC-V HW Dev
Rocket Chip's build flow is a bit messy so your confusion is understandable.

I'll start with SBT and Make because that is the legacy Rocket Chip build flow. SBT is the most popular build tool in the Scala community, and as Rocket Chip is primarily Scala code, it is the most natural tool to use. Things get tricky though, because unlike in normal Scala projects where pretty much everything runs on the JVM, Rocket Chip generates Verilog which then needs to tie into more traditional hardware flows. SBT is really a JVM-specific tool and isn't all that well suited for calling Verilog simulators, synthesis tools and the like. Thus, Rocket Chip also has a Make flow for handling all of that. The separation of what is SBT vs. what is Make is super inelegant due to historic limitations, so unfortunately SBT has to be called twice (once to build FIRRTL on it's own, then again to build all of the rest of the Scala).

Wake is a new build tool from SiFive that is trying to solve the kind of problems I just described in the Make and SBT flow. Hardware design is fundamentally composed of many languages and many flows, and Wake is intended to provide a common build orchestration level to manage these many languages and flows. Wake has many great aspects, but it is new and has far less documentation and integration than Make or SBT.

Per things like "sbt run", you won't find that exactly because Rocket Chip uses SBT from the sbt-launch.jar via a direct Java call, but there is the equivalent: https://github.com/chipsalliance/rocket-chip/blob/aaa1f4bc30106d5f701436fe17a00a64b82f1e1b/emulator/Makefrag-verilator#L13

I am in the process of cleaning up the Make/SBT flow while bumping Chisel and FIRRTL to the next major Chisel version 3.4. This should clean up the use from the Makefile perspective because the entire Scala build will be managed by SBT. Keep an eye on https://github.com/chipsalliance/rocket-chip/pull/2617

--
You received this message because you are subscribed to the Google Groups "RISC-V HW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/hw-dev/74ef1332-df6a-4169-afb5-9259df72f59en%40groups.riscv.org.
Reply all
Reply to author
Forward
0 new messages