litex-hub / linux-on-litex-vexriscv

Linux on LiteX-VexRiscv
BSD 2-Clause "Simplified" License
552 stars 174 forks source link

sim.py fails with verilator unable to deal with $urandom #299

Closed smosanu closed 1 year ago

smosanu commented 1 year ago

Am dealing with this and wanted to make a record, hope it helps

%Error: /EnDigital/pythondata-cpu-vexriscv-smp/pythondata_cpu_vexriscv_smp/verilog/VexRiscvLitexSmpCluster_Cc1_Iw32Is128Iy1_Dw32Ds128Dy1_ITs4DTs4_Ood_Wm.v:14192: Unsupported or unknown PLI call: $urandom %Error: /EnDigital/pythondata-cpu-vexriscv-smp/pythondata_cpu_vexriscv_smp/verilog/VexRiscvLitexSmpCluster_Cc1_Iw32Is128Iy1_Dw32Ds128Dy1_ITs4DTs4_Ood_Wm.v:14193: Unsupported or unknown PLI call: $urandom %Error: /EnDigital/pythondata-cpu-vexriscv-smp/pythondata_cpu_vexriscv_smp/verilog/VexRiscvLitexSmpCluster_Cc1_Iw32Is128Iy1_Dw32Ds128Dy1_ITs4DTs4_Ood_Wm.v:14243: Unsupported or unknown PLI call: $urandom %Error: /EnDigital/pythondata-cpu-vexriscv-smp/pythondata_cpu_vexriscv_smp/verilog/VexRiscvLitexSmpCluster_Cc1_Iw32Is128Iy1_Dw32Ds128Dy1_ITs4DTs4_Ood_Wm.v:14244: Unsupported or unknown PLI call: $urandom

smosanu commented 1 year ago

As other threads and issues suggest, the issue was with the verilator version. Building and installing a new version fixes this, but a) really make sure that the old version is removed (don't just install on top) then build, checkout one of the latest versions (like v220) and check that it is the one used. https://verilator.org/guide/latest/install.html#git-quick-install