OpenXiangShan / xs-env

XiangShan Frontend Develop Environment
https://xiangshan-doc.readthedocs.io/zh_CN/latest/tools/xsenv/
Other
44 stars 47 forks source link

ubuntu20.04执行xs-env.sh脚本失败:edu.berkeley.cs:chisel3_2.12:3.5-SNAPSHOT #14

Closed MapleLeafFall closed 2 years ago

MapleLeafFall commented 2 years ago

嗨all, 我的环境上执行 source setup.sh

跑过mill的安装命令后,现在失败在下一步。

cwq@ubuntu:~/1_xiangshan/xs-env$ source setup.sh
SPECIALIZE_TYPE=RISCV SOFTFLOAT_OPTS="-DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32 -fPIC" make -s -C /home/cwq/1_xiangshan/xs-env/NEMU/resource/softfloat/repo/build/Linux-x86_64-GCC all
mkdir -p resource/softfloat/build
ln -sf /home/cwq/1_xiangshan/xs-env/NEMU/resource/softfloat/repo/build/Linux-x86_64-GCC/softfloat.a resource/softfloat/build/softfloat.a
+ LD /home/cwq/1_xiangshan/xs-env/NEMU/build/riscv64-nemu-interpreter-so
# Building coremark [riscv64-xs] with AM_HOME {/home/cwq/1_xiangshan/xs-env/nexus-am}
# Building lib-am [riscv64-xs]
+ AS src/nemu/common/mainargs.S
+ AR -> build/am-riscv64-xs.a
# Building lib-klib [riscv64-xs]
# Creating binary image [riscv64-xs]
+ LD -> build/coremark-riscv64-xs.elf
+ OBJCOPY -> build/coremark-riscv64-xs.bin
git submodule update --init
Makefile:25: build Nutshell: SimTop.v begin...
Makefile:27: build Nutshell: SimTop.v after...
Makefile:29: build Nutshell: SimTop.v after1...
mkdir -p build
mill chiselModule.runMain top.TopMain -td build --output-file TopMain.v --infer-rw NutShellFPGATop --repl-seq-mem -c:NutShellFPGATop:-o:build/TopMain.v.conf BOARD=sim   CORE=inorder  
[20/63] difftest.resolvedIvyDeps | Downloading [4/4] artifacts (~0/0 bytes)
1 targets failed
difftest.resolvedIvyDeps 
Resolution failed for 1 modules:
--------------------------------------------
  edu.berkeley.cs:chisel3_2.12:3.5-SNAPSHOT 
        not found: /home/cwq/.ivy2/local/edu.berkeley.cs/chisel3_2.12/3.5-SNAPSHOT/ivys/ivy.xml
        not found: https://repo1.maven.org/maven2/edu/berkeley/cs/chisel3_2.12/3.5-SNAPSHOT/chisel3_2.12-3.5-SNAPSHOT.pom

make: *** [Makefile:26:build/TopMain.v] 错误 1
Makefile:53: begin...
Makefile:55: finish...
mkdir -p build
mill chiselModule.test.runMain top.TopMain -td build --output-file SimTop.v BOARD=sim CORE=inorder  
[20/85] difftest.resolvedIvyDeps | Downloading [4/4] artifacts (~0/0 bytes)
1 targets failed
difftest.resolvedIvyDeps 
Resolution failed for 1 modules:
--------------------------------------------
  edu.berkeley.cs:chisel3_2.12:3.5-SNAPSHOT 
        not found: /home/cwq/.ivy2/local/edu.berkeley.cs/chisel3_2.12/3.5-SNAPSHOT/ivys/ivy.xml
        not found: https://repo1.maven.org/maven2/edu/berkeley/cs/chisel3_2.12/3.5-SNAPSHOT/chisel3_2.12-3.5-SNAPSHOT.pom

make: *** [Makefile:54:build/SimTop.v] 错误 1

经过分析最后定位到是NutShell/Makefile的第25行mill命令的第1个参数“chiselModule.test.runMain”执行出错:

mill chiselModule.runMain top.$(TOP) -td $(@D) --output-file $(@F) --infer-rw $(FPGATOP) --repl-seq-mem -c:$(FPGATOP):-o:$(@D)/$(@F).conf BOARD=$(BOARD) CORE=$(CORE)

作为对比,我另外克隆了Nutshell的完整工程并按照readme编译,可以正常执行结束:

cwq@ubuntu:~/4_nutshell$ git clone https://github.com/OSCPU/NutShell.git
正克隆到 'NutShell'...
remote: Enumerating objects: 13638, done.
remote: Counting objects: 100% (1115/1115), done.
remote: Compressing objects: 100% (617/617), done.
remote: Total 13638 (delta 570), reused 890 (delta 404), pack-reused 12523
接收对象中: 100% (13638/13638), 16.72 MiB | 6.05 MiB/s, 完成.
处理 delta 中: 100% (7918/7918), 完成.
cwq@ubuntu:~/4_nutshell$ cd NutShell/
cwq@ubuntu:~/4_nutshell/NutShell$ make
mkdir -p build
mill chiselModule.runMain top.TopMain -td build --output-file TopMain.v --infer-rw NutShellFPGATop --repl-seq-mem -c:NutShellFPGATop:-o:build/TopMain.v.conf BOARD=sim   CORE=inorder
[28/38] chiselModule.compile
Compiling compiler interface...
[info] compiling 78 Scala sources to /home/cwq/4_nutshell/NutShell/out/chiselModule/compile/dest/classes ...
[warn] /home/cwq/4_nutshell/NutShell/src/main/scala/top/TopMain.scala:66:12: method execute in object Driver is deprecated: Use chisel3.stage.ChiselStage.execute. This will be removed in 3.4.
[warn]     Driver.execute(args, () => new NutShellSimTop)
[warn]            ^
[warn] /home/cwq/4_nutshell/NutShell/src/main/scala/top/TopMain.scala:66:5: object Driver in package chisel3 is deprecated: Please switch to chisel3.stage.ChiselStage. Driver will be removed in 3.4.
[warn]     Driver.execute(args, () => new NutShellSimTop)
[warn]     ^
[warn] /home/cwq/4_nutshell/NutShell/src/main/scala/top/TopMain.scala:68:12: method execute in object Driver is deprecated: Use chisel3.stage.ChiselStage.execute. This will be removed in 3.4.
[warn]     Driver.execute(args, () => new Top)
[warn]            ^
[warn] /home/cwq/4_nutshell/NutShell/src/main/scala/top/TopMain.scala:68:5: object Driver in package chisel3 is deprecated: Please switch to chisel3.stage.ChiselStage. Driver will be removed in 3.4.
[warn]     Driver.execute(args, () => new Top)
[warn]     ^
[warn] there were 2788 feature warnings; re-run with -feature for details
[warn] 5 warnings found
[info] done compiling
[38/38] chiselModule.runMain
====== Settings = (sim, inorder) ======
EnableDebug = true
EnableILA = true
EnableMultiIssue = false
EnableOutOfOrderExec = false
EnableRVC = true
FPGAPlatform = false
HasDTLB = true
HasDcache = true
HasITLB = true
HasIcache = true
HasL2cache = true
HasPrefetch = true
IsRV32 = false
MMIOBase = 0x40000000
MMIOSize = 0x40000000
MemMapBase = 0x0
MemMapRegionBits = 0
MmodeOnly = false
NrExtIntr = 1
ResetVector = 0x80000000
[info] [0.001] Elaborating design...
[info] [5.509] Done elaborating.
Computed transform order in: 200.8 ms
Total FIRRTL Compile Time: 12588.8 ms
./scripts/vlsi_mem_gen build/TopMain.v.conf >> build/TopMain.v
sed -i -e 's/_\(aw\|ar\|w\|r\|b\)_\(\|bits_\)/_\1/g' build/TopMain.v
cwq@ubuntu:~/4_nutshell/NutShell$ ll build/TopMain.v
-rw-rw-r-- 1 cwq cwq 1812706 11月 21 02:28 build/TopMain.v
cwq@ubuntu:~/4_nutshell/NutShell$

更进一步地对比发现,xs-env和Nutshell代码的build.sc文件下object chiselModule定义不一样: xs-env多了对difftest模块的引用(我不知道这样描述对不对……)。我已经开启全局vpn,所以应该不是网络问题。

想问下:你们是否遇到过这种情况?可能是什么原因呢?

MapleLeafFall commented 2 years ago

已解决:是最新的提交引入的问题,具体原因未知。 从CI能看到报错和我本地的一样(https://github.com/OpenXiangShan/xs-env/runs/4164622996?check_suite_focus=true)。 所以解决办法是:克隆这个库后恢复到上一个正常commit来使用即可(必须要在source setup.sh命令执行之前): git reset --hard HEAD^

AugustusWillisWang commented 2 years ago

近期的更新导致 xs-env 环境不稳定. #16 应该已经修复了这一问题. 可以尝试使用这之后的版本.

MapleLeafFall commented 2 years ago

谢谢。 不过我环境上暂时不更新了,先把xiangshan的完整流程跑起来看看~