Open TheZoq2 opened 2 years ago
Thanks for the report.
It looks like verilator changed the default naming scheme for the generated C++ source somewhere between 4.108 and 4.222.
I just repulled again (and switched to main). At efab3b3275bc49e2204053192a4306463da25dec cargo build
fails with
running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-I" "/usr/share/verilator/include" "-I" "/usr/share/verilator/include/vltstd" "-Wall" "-Wextra" "-std=gnu++17" "-faligned-new" "-Wno-bool-operation" "-Wno-sign-compare" "-Wno-uninitialized" "-Wno-unused-but-set-variable" "-Wno-unused-parameter" "-Wno-unused-variable" "-Wno-shadow" "-DVERILATOR_VERSION_MAJOR=4" "-DVERILATOR_VERSION_MINOR=226" "-o" "/home/tommy/projects/verilated-rs/target/debug/build/verilated-2b7a9d3a2d6377b6/out/src/verilatedvcdc_shim.o" "-c" "src/verilatedvcdc_shim.cpp"
cargo:warning=src/verilatedvcdc_shim.cpp: In function ‘void verilatedvcdc_rollover_mb(VerilatedVcdC*, size_t)’:
cargo:warning=src/verilatedvcdc_shim.cpp:47:10: error: ‘class VerilatedVcdC’ has no member named ‘rolloverMB’; did you mean ‘rolloverSize’?
cargo:warning= 47 | vcd->rolloverMB(rolloverMB);
cargo:warning= | ^~~~~~~~~~
cargo:warning= | rolloverSize
on Asahi Linux (fully up-to-date).
On up-to-date Ubuntu/RISC-V it fails with
...
Compiling memchr v2.5.0
/home/tommy/.rustup.riscv64-linux/toolchains/stable-riscv64gc-unknown-linux-gnu/bin/../lib/librustc_driver-ac972a4e10c98556.so(+0xc3d810)[0x3f93eb4810]
linux-vdso.so.1(__vdso_rt_sigreturn+0x0)[0x3f9a94a800]
...
/home/tommy/.rustup.riscv64-linux/toolchains/stable-riscv64gc-unknown-linux-gnu/bin/../lib/libstd-f41102d4d21d2c30.so(rust_metadata_std_ac92b06979af539e+0xa0542)[0x3f7e30c542]
/lib/riscv64-linux-gnu/libc.so.6(+0x6a450)[0x3f7e197450]
error: could not compile `unicode-xid`
Caused by:
process didn't exit successfully: `rustc --crate-name unicode_xid /home/tommy/.cargo.riscv64-linux/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.1.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -idory ea,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=86b26df15dd8bbd4 -C extra-filename=-86b26df15dd8bbd4 --out-dir /home/tommy/projects/verilated-rs/target/debug/deps -L dependency=/home/tommy/projects/verilated-rs/target/debug/deps --cap-lints allow` (signal: 1 IEG:iv11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: could not compile `memchr`
In all cases Rust is fully updated to version 1.64
Maybe it would make sense to include verilator as a submodule so we are building a known-good version?
FWIW, current version (version 0.1.6) builds and runs perfectly for me with Rust 1.64 on Ubuntu 22.10/{Arm64,AMD64,RISC-V}
(However clippy has something to say).
Also FWIW, it still fails to build on Asahi-Linux/M1, but I'm not sure that's the fault of verilated-rs.
I think we can close?
Executing verilator with --lib-create
and using make -f V{top_module}.mk
to build instead of calling cc manually may be the better solution.
And verilator renamed rolloverMB
to rolloverSize
(verilator/verilator#3570).
This seems like a super cool project, unfortunately, the example in the repo fails to build on my machine, with a missing cpp file:
Trying to build with rust 1.59 and verilator version 4.222