feat(build): Support generating XiangShan in docker envrionment #4538
feat(build): Support generating XiangShan in docker envrionment #4538Tang-Haojin merged 10 commits intomasterfrom
Conversation
a7768f9 to
c329b0b
Compare
|
[Generated by IPC robot]
master branch:
|
|
I think @cebarobot had a dockerfile for XiangShan (the demo used for last RISC-V Summit Europe?). Maybe we need coordination between groups to avoid duplicated work. Should we discuss how we are going to maintain the environment and let everyone know? |
No, I don't have such dockerfile. Recent work on xs-env is just setting up basic tools in an Ubuntu images, which is not the best practice of development container. Currently xs-env provides basic images for Ubuntu (20.04, 22.04, 24.04) and CentOS, mainly for building NEMU and SPIKE. |
Where's the docker that BOSC published before? Who owns it? |
I believe that docker image is owned by Director An and hosted on Baidu Pan. I remember those images were manually built rather than based on Dockerfile, so they don't offer much reference value. I've been wanting to replace them with a new workflow for a while. |
Fine. Then we should work again for that docker. Let's use this PR. |
poemonsense
left a comment
There was a problem hiding this comment.
Probably we should reuse the prebuilt containers from xs-env
9626044 to
87d1bc0
Compare
|
[Generated by IPC robot]
master branch:
|
|
[Generated by IPC robot]
master branch:
|
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
3b3c897 to
100b30a
Compare
…ncies Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
75f38c3 to
c8d4390
Compare
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
Signed-off-by: Jiuyue Ma <majiuyue@bosc.ac.cn>
|
[Generated by IPC robot]
master branch:
|
In this PR, we provide a docker-based XiangShan build environment, which can effectively reduce the dependency on the host environments and ensure that everyone can use the same environment to generate RTL and subsequent emulator(verilator) sources.
The base docker image will be named as
ghcr.io/openxiangshan/xsdev, which was based onghcr.io/openxiangshan/xs-env:latestimage from OpenXiangShan/xs-env. It also contains the chisel/mill environment that XiangShan relies on to generate RTL.When we use
make verilogormake sim-verilogto generate RTL, it will automatically detect whether docker was installed on the system and the required image was exist. If so, the task will be executed in the docker environment, otherwise it will still be executed in the host as usual.update:
make emu-mkwas supported, now the verilating job was done in docker.The image does not contain any XiangShan source code inside. As an alternative, they will be injected into the container by bind-mount mechanism provided by
docker runcommand at runtime as following:By default, the source code will be bind-mounted to
/workdirectory withreadonlypermission to prevent it from being modified by mistake. Two additional directories/work/buildand/work/outwill be mounted withwritepermission for the final build output and intermediate files of mill. We use separated.docker-mill-outfor mill inside docker to prevent it from interfering with the host mill runs.For subsequent image updates, we provide a
make imagetarget to update the image content according toDockerfileandbuild.sc, which means that future changes to the environments should be synchronized to the Dockerfile as while.This PR mainly consists of the following parts:
buildinstead ofsrctree(because of the read-only mount of srctree)make imageand related Dockerfile for docker image buildmake pull-imageto pull latest xsdev image from ghcr.iomake shto start an interactive container of xsdev imageverilog,sim-verilog,emu-mk, andtest-jartargets so that they can be executed in the docker envrionmentFuture works: