Chisel tester with newest verilator as backend got a compile error
See original GitHub issueType of issue: bug report
Impact: no functional change
Development Phase: request
Other information
In this commit of verilator, the function Verilated::flushCall
has split into Verilated::runFlushCallbacks
and Verilated::runExitCallbacks
. This breaking change leads to a compile error when we want to run PeekPokeTester against newest verilator on macOS.
If the current behavior is a bug, please provide the steps to reproduce the problem:
Use brew update && brew upgrade
to update your enviroment, then run sbt test
in chisel-template, then you will see the following text:
cd /Users/name1e5s/Documents/Code/chisel-template/test_run_dir/make_no_vcd && verilator --cc GCD.v --assert -Wno-fatal -Wno-WIDTH -Wno-STMTDLY -O1 --top-module GCD +define+TOP_TYPE=VGCD +define+PRINTF_COND=!GCD.reset +define+STOP_COND=!GCD.reset -CFLAGS "-Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VGCD -DVL_USER_FINISH -include VGCD.h" -Mdir /Users/name1e5s/Documents/Code/chisel-template/test_run_dir/make_no_vcd --exe /Users/name1e5s/Documents/Code/chisel-template/test_run_dir/make_no_vcd/GCD-harness.cpp
clang++ -I. -MMD -I/usr/local/Cellar/verilator/4.040/share/verilator/include -I/usr/local/Cellar/verilator/4.040/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=0 -faligned-new -fbracket-depth=4096 -fcf-protection=none -Qunused-arguments -Wno-parentheses-equality -Wno-sign-compare -Wno-uninitialized -Wno-unused-parameter -Wno-unused-variable -Wno-shadow -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VGCD -DVL_USER_FINISH -include VGCD.h -Os -c -o GCD-harness.o /Users/name1e5s/Documents/Code/chisel-template/test_run_dir/make_no_vcd/GCD-harness.cpp
clang++ -I. -MMD -I/usr/local/Cellar/verilator/4.040/share/verilator/include -I/usr/local/Cellar/verilator/4.040/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=0 -faligned-new -fbracket-depth=4096 -fcf-protection=none -Qunused-arguments -Wno-parentheses-equality -Wno-sign-compare -Wno-uninitialized -Wno-unused-parameter -Wno-unused-variable -Wno-shadow -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VGCD -DVL_USER_FINISH -include VGCD.h -Os -c -o verilated.o /usr/local/Cellar/verilator/4.040/share/verilator/include/verilated.cpp
/usr/bin/perl /usr/local/Cellar/verilator/4.040/share/verilator/bin/verilator_includer -DVL_INCLUDE_OPT=include VGCD.cpp VGCD__Slow.cpp VGCD__Syms.cpp > VGCD__ALL.cpp
clang++ -I. -MMD -I/usr/local/Cellar/verilator/4.040/share/verilator/include -I/usr/local/Cellar/verilator/4.040/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=0 -faligned-new -fbracket-depth=4096 -fcf-protection=none -Qunused-arguments -Wno-parentheses-equality -Wno-sign-compare -Wno-uninitialized -Wno-unused-parameter -Wno-unused-variable -Wno-shadow -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VGCD -DVL_USER_FINISH -include VGCD.h -Os -c -o VGCD__ALL.o VGCD__ALL.cpp
ar -cr VGCD__ALL.a VGCD__ALL.o
ranlib VGCD__ALL.a
/Users/name1e5s/Documents/Code/chisel-template/test_run_dir/make_no_vcd/GCD-harness.cpp:101:14: error: no member named 'flushCall' in 'Verilated'
Verilated::flushCall();
~~~~~~~~~~~^
1 error generated.
make: *** [GCD-harness.o] Error 1
make: *** Waiting for unfinished jobs....
[info] GCDTester:
[info] GCD
[info] - should calculate proper greatest common denominator (with firrtl)
[info] GCD
[info] - should calculate proper greatest common denominator (with verilator) *** FAILED ***
[info] java.lang.AssertionError: assertion failed:
[info] at scala.Predef$.assert(Predef.scala:223)
[info] at chisel3.assert$.apply(Assert.scala:76)
[info] at chisel3.iotesters.setupVerilatorBackend$.apply(VerilatorBackend.scala:275)
[info] at chisel3.iotesters.Driver$.$anonfun$execute$2(Driver.scala:55)
[info] at scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:23)
[info] at logger.Logger$.$anonfun$makeScope$2(Logger.scala:168)
[info] at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[info] at logger.Logger$.makeScope(Logger.scala:166)
[info] at logger.Logger$.makeScope(Logger.scala:127)
[info] at chisel3.iotesters.Driver$.$anonfun$execute$1(Driver.scala:38)
[info] ...
What is the current behavior?
Running sbt test
will get a depressing compile error.
What is the expected behavior? The test should runs correctly.
Please tell us about your environment:
- version:
3.3.1
- OS:
64bit Mac OS X 10.15.6 19G2021
- verilator:
4.040
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
I just ran into this. Apparently,
flushCall
is deprecated and it got removed at some point, but it was added back for backwards compatibility. Unfortunately, Ubuntu 20.10 ships with the affected Verilator version.This seems to fix it:
…though 2 tests are still failing. I am also not sure when
runFlushCallbacks
was added.If anyone found the same problem, you can firstly
and then
to downgrade the verilator to 4.036.
It is not a good solution, but it works.😂