XiangShan
XiangShan copied to clipboard
make emu failed: java.io.IOException: com.sun.jna.LastErrorException
运行代码 make emu CONFIG=MinimalConfig SIM_ARGS=--disable-log EMU_THREADS=2 -j10
出现如下错误
Done elaborating.
1 targets failed
XiangShan.test.runMain subprocess failed
java.io.IOException: com.sun.jna.LastErrorException: [104] 连接被对方重设
at org.scalasbt.ipcsocket.UnixDomainSocket$UnixDomainSocketInputStream.doRead(UnixDomainSocket.java:151)
at org.scalasbt.ipcsocket.UnixDomainSocket$UnixDomainSocketInputStream.read(UnixDomainSocket.java:122)
at mill.main.client.ProxyStreamPumper.run(ProxyStreamPumper.java:23)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.sun.jna.LastErrorException: [104] 连接被对方重设
at org.scalasbt.ipcsocket.UnixDomainSocketLibrary.read(Native Method)
at org.scalasbt.ipcsocket.UnixDomainSocket$UnixDomainSocketInputStream.doRead(UnixDomainSocket.java:149)
... 3 more
make: *** [Makefile:82:build/SimTop.v] 错误 1
Makefile:78~94为
$(SIM_TOP_V): $(SCALA_FILE) $(TEST_FILE)
mkdir -p $(@D)
@echo "\n[mill] Generating Verilog files..." > $(TIMELOG)
@date -R | tee -a $(TIMELOG)
$(TIME_CMD) mill XiangShan.test.runMain $(SIMTOP) -td $(@D) \
--config $(CONFIG) --full-stacktrace --output-file $(@F) \
--infer-rw --repl-seq-mem -c:$(SIMTOP):-o:$(@D)/$(@F).conf \
--num-cores $(NUM_CORES) $(SIM_ARGS)
$(MEM_GEN) $(@D)/$(@F).conf --output_file $(@D)/$(@F).sram.v
@git log -n 1 >> .__head__
@git diff >> .__diff__
@sed -i 's/^/\/\// ' .__head__
@sed -i 's/^/\/\//' .__diff__
@cat .__head__ .__diff__ $@ $(@D)/$(@F).sram.v > .__out__
@mv .__out__ $@
@rm .__head__ .__diff__
sed -i -e 's/$$fatal/xs_assert(`__LINE__)/g' $(SIM_TOP_V)
第82行为:
$(TIME_CMD) mill XiangShan.test.runMain $(SIMTOP) -td $(@D) \
java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
我百度了一下,或许是因为我的java版本不匹配?请问这个错误该怎么解决呢?
这个好像是 mill 的问题,有的时候会出现跑完之后断开的情况。可以看一下 build 目录,应该已经生成出来了 This seems to be the problem of mill, sometimes it will be disconnected after running. Take a look at the build directory.It should already be generated
好嘞,不过现在build目录下只有这两个文件
lock-emu
time.log
我再运行几次试试看~
Use mill -i
to avoid this issue.
i modify the Makefile
- $(TIME_CMD) mill XiangShan.test.runMain $(SIMTOP) -td $(@D) \
+ $(TIME_CMD) mill -i XiangShan.test.runMain $(SIMTOP) -td $(@D) \
But , I get the build error
make emu CONFIG=MinimalConfig SIM_ARGS=--disable-log EMU_THREADS=2 -j10
mkdir -p build
Sat, 17 Jul 2021 22:24:17 +0800
time -a -o ./build/time.log mill -i XiangShan.test.runMain top.SimTop -td build \
--config MinimalConfig --full-stacktrace --output-file SimTop.v \
--infer-rw --repl-seq-mem -c:top.SimTop:-o:build/SimTop.v.conf \
--num-cores 1 --disable-log
[213/213] XiangShan.test.runMain
Elaborating design...
FPGASoC cores: 1 banks: 4 block size: 64 bus size: 256
INT Regfile: 10R5W
FP Regfile: 5R4W
RS 0: type AluExeUnit, size 16, enq 2, deq 2, numSrc 2, fast 5, wakeup 5
RS 1: type MulDivExeUnit, size 8, enq 2, deq 1, numSrc 2, fast 3, wakeup 5
RS 2: type JmpExeUnit, size 8, enq 1, deq 1, numSrc 2, fast 3, wakeup 5
RS 3: type FmacExeUnit, size 8, enq 1, deq 1, numSrc 3, fast 1, wakeup 4
RS 4: type FmiscExeUnit, size 8, enq 1, deq 1, numSrc 2, fast 1, wakeup 4
RS 5: type LoadExu, size 8, enq 1, deq 1, numSrc 1, fast 5, wakeup 5
RS 6: type LoadExu, size 8, enq 1, deq 1, numSrc 1, fast 5, wakeup 5
RS 7: type StoreExu, size 8, enq 1, deq 1, numSrc 2, fast 3, wakeup 9
RS 8: type StoreExu, size 8, enq 1, deq 1, numSrc 2, fast 3, wakeup 9
Scheduler:
number of issue ports: 10
number of replay ports: 4
number of std ports: 2
number of outside fast wakeup ports: 2
[WARN] Signal |logTimestamp| has multiple sinks
[WARN] Signal |XSPERF_CLEAN| has multiple sinks
[WARN] Signal |XSPERF_DUMP| has multiple sinks
[WARN] Signal |DISPLAY_LOG_ENABLE| has multiple sinks
ImmUnion max len: 20
LoadQueue: size:16
StoreQueue: size:12
Regfile: size:64 read: 10write: 5
Regfile: size:64 read: 5write: 4
Fast wakeup: RS 0 -> List(0, 1, 2, 5, 6, 7, 8), source: [0,2)
Fast wakeup: RS 1 -> List(0, 1, 2, 5, 6, 7, 8), source: [4,5)
Fast wakeup: RS 3 -> List(3, 4), source [5, 6)
Fast wakeup: RS 5 -> List(0, 5, 6), source: [2,3)
Fast wakeup: RS 6 -> List(0, 5, 6), source: [3,4)
FPGAPlatform:false EnableDebug:false
Memory map:
[h00_0000_0000 -> h00_0FFF_FFFF] Width:unlimited Description:Reserved [RW]
[h00_1000_0000 -> h00_1FFF_FFFF] Width:unlimited Description:QSPI_Flash [RWX]
[h00_2000_0000 -> h00_2FFF_FFFF] Width:unlimited Description:Reserved [RW]
[h00_3000_0000 -> h00_3000_FFFF] Width:unlimited Description:DMA [RW]
[h00_3001_0000 -> h00_3004_FFFF] Width:unlimited Description:GPU [RWC]
[h00_3005_0000 -> h00_3006_FFFF] Width:unlimited Description:USB/SDMMC [RW]
[h00_3007_0000 -> h00_30FF_FFFF] Width:unlimited Description:Reserved [RW]
[h00_3100_0000 -> h00_3111_FFFF] Width:unlimited Description:MMIO [RW]
[h00_3112_0000 -> h00_37FF_FFFF] Width:unlimited Description:Reserved [RW]
[h00_3800_0000 -> h00_3800_FFFF] Width:unlimited Description:CLINT [RW]
[h00_3801_0000 -> h00_3801_FFFF] Width:unlimited Description:BEU [RW]
[h00_3802_0000 -> h00_3BFF_FFFF] Width:unlimited Description:Reserved []
[h00_3C00_0000 -> h00_3FFF_FFFF] Width:unlimited Description:PLIC [RW]
[h00_4000_0000 -> h00_7FFF_FFFF] Width:unlimited Description:PCIe [RW]
[h00_8000_0000 -> h1F_FFFF_FFFF] Width:unlimited Description:DDR [RWXIDSA]
Ftq: size:8
Roq: size:32 wbports:11 commitwidth:6
CSR: hasEmuPerfCnt:true
int wb arbiter:
[ AluExeUnit ] -> out #0
[ AluExeUnit ] -> out #1
[ LoadExu ] -> out #2
[ LoadExu ] -> out #3
[ MulDivExeUnit JmpExeUnit FmiscExeUnit ] -> arb -> out #4
fp wb arbiter:
[ FmacExeUnit ] -> out #0
[ LoadExu ] -> out #1
[ LoadExu ] -> out #2
[ FmiscExeUnit JmpExeUnit ] -> arb -> out #3
1 targets failed
XiangShan.test.runMain subprocess failed
make: *** [Makefile:82: build/SimTop.v] Error 1
这个好像是 mill 的问题,有的时候会出现跑完之后断开的情况。可以看一下 build 目录,应该已经生成出来了
我又试了几次,报错缺失一些头文件
/home/liqp/src/XS/src/test/csrc/common/device.cpp:17:10: fatal error: SDL2/SDL.h: 没有那个文件或目录
17 | #include <SDL2/SDL.h>
| ^~~~~~~~~~~~
compilation terminated.
/home/liqp/src/XS/src/test/csrc/common/vga.cpp:18:10: fatal error: SDL2/SDL.h: 没有那个文件或目录
18 | #include <SDL2/SDL.h>
| ^~~~~~~~~~~~
compilation terminated.
In file included from /home/liqp/src/XS/src/test/csrc/common/compress.cpp:16:
/home/liqp/src/XS/src/test/csrc/common/compress.h:21:10: fatal error: zlib.h: 没有那个文件或目录
21 | #include <zlib.h>
| ^~~~~~~~
compilation terminated.
make[2]: *** [VSimTop.mk:84:compress.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [VSimTop.mk:86:device.o] 错误 1
make[2]: *** [VSimTop.mk:98:vga.o] 错误 1
/home/liqp/src/XS/src/test/csrc/common/keyboard.cpp:18:10: fatal error: SDL2/SDL.h: 没有那个文件或目录
18 | #include <SDL2/SDL.h>
| ^~~~~~~~~~~~
compilation terminated.
make[2]: *** [VSimTop.mk:90:keyboard.o] 错误 1
In file included from /home/liqp/src/XS/src/test/csrc/common/ram.cpp:20:
/home/liqp/src/XS/src/test/csrc/common/compress.h:21:10: fatal error: zlib.h: 没有那个文件或目录
21 | #include <zlib.h>
| ^~~~~~~~
compilation terminated.
make[2]: *** [VSimTop.mk:92:ram.o] 错误 1
/home/liqp/src/XS/src/test/csrc/common/sdcard.cpp: In function ‘void sd_read(uint32_t*)’:
/home/liqp/src/XS/src/test/csrc/common/sdcard.cpp:30:8: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
30 | fread(data, 4, 1, fp);
| ~~~~~^~~~~~~~~~~~~~~~
/home/liqp/src/XS/src/test/csrc/common/uart.cpp:32:12: warning: ‘int uart_dequeue()’ defined but not used [-Wunused-function]
32 | static int uart_dequeue(void) {
| ^~~~~~~~~~~~
make[2]: 离开目录“/home/liqp/src/XS/build/emu-compile”
make[1]: *** [verilator.mk:118:build_emu_local] 错误 2
make[1]: 离开目录“/home/liqp/src/XS”
make: *** [verilator.mk:125:build/emu] 错误 2