OpenXiangShan / XiangShan

Open-source high-performance RISC-V processor
https://xiangshan.cc
Other
4.84k stars 663 forks source link

在Verilator中编译香山时出现报错 #2339

Closed zhangkanqi closed 1 year ago

zhangkanqi commented 1 year ago

你好,在Verilator中编译香山时出现了以下报错,请问这是因为使用的Verilator版本不对导致的吗?香山能兼容v4.106版本的Verilator吗?

verilator -cc --exe -Mdir XSTop_vpd -DCOCOTB_SIM=1 --top-module XSTop -DPRINTF_COND=0 -DSTOP_COND=0 -Wno-PINMISSING --vpi --public-flat-rw --prefix Vtop -o XSTop -LDFLAGS "-Wl,-rpath,/usr/local/lib/python3.11/dist-packages/cocotb/libs -L/usr/local/lib/python3.11/dist-packages/cocotb/libs -lcocotbvpi_verilator" --trace --trace-structs --timescale 1us/1us /home/xxxxxx/XSTop.v /usr/local/lib/python3.11/dist-packages/cocotb/share/lib/verilator/verilator.cpp

image

poemonsense commented 1 year ago

我们不对非香山默认提供的verilator编译选项正确性负责,如果要将香山结合cocotb等框架进行仿真,请自行确认verilator和相关选项的正确性。

香山的RTL是兼容Verilator v4和v5的。截图上的报错是因为cocotb或者其他工具在调用verilator时没有设置 -Wno-WIDTH 选项,可以参考香山的verilator命令进行调整:https://github.com/OpenXiangShan/difftest/blob/master/verilator.mk#L101