chipsalliance / rocket-chip

Rocket Chip Generator
Other
3.15k stars 1.11k forks source link

Support building mdoc through Mill on dev #3312

Open michael-etzkorn opened 1 year ago

michael-etzkorn commented 1 year ago

Type of issue: feature request

Impact: no functional change

Development Phase: request

Other information

What is the current behavior? Since merging https://github.com/chipsalliance/rocket-chip/commit/0b7fef44f82b35bf289949b3f8fdc139641f8e10, the steps to build mdoc are no longer supported and need a Mill build equivalent to check the mdoc against the latest dev branch.

FurryAcetylCoA commented 6 months ago

We can use yoohaemin/mill-mdoc to generate mdoc with mill. Note: the readme.md in this fork is not up to date. com.yoohaemin::mill-mdoc::0.0.3-7-355e3e-SNAPSHOT is the first release compatible with mill 0.11.

However, I'm not sure were to mix the MDocModule trait in. I tried to mix it with RocketChip and while it did compile the docs but it failed at emitting SystemVerilog(adder_tutorial.md:315). This issue arises because chisel5 compilation requires the plugin, and 'm not familiar with build.sc structure used by rocketchip. I don't know how to fix it ( should I just use another object extended from RocketChip ? )

Also, there are problems with executing ChiselStage.elaborate(top.module) in select_tutorial.md:80 even after adjusting the package path. I believe it has something to do with the internal API change of chisel, which, unfortunately, I'm also not familiar with.