Error while building VTA in chisel

Under the chisel directory ‘/tvm/3rdparty/vta-hw/hardware/chisel’, I tried to build hardware shared library by running make.An error occurred as followed:

/home/llf/tvm/3rdparty/vta-hw/hardware/dpi/tsim_device.cc: In function ‘int VTADPISim()’: /home/llf/tvm/3rdparty/vta-hw/hardware/dpi/tsim_device.cc:96:14: error: ‘flushCall’ is not a member of ‘Verilated’ 96 | Verilated::flushCall(); | ^~~~~~~~~ make: *** [Makefile:175:/home/llf/tvm/3rdparty/vta-hw/build/verilator/tsim_device.o] 错误 1

Could anyone help me?

According to this issue, it’s a compatibility issue of verilator. Could you check your verilator version and try upgrading it to v4.102 or later? They fixed it in v4.102.

Thank u greatly! I upgrade verilator version to v4.202 and this issue has solved. However another errors occurred as followed:

home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest_DotProduct__Slow.cpp:12:1: error: ISO C++ forbids declaration of ‘VL_CTOR_IMP’ with no type [-fpermissive] 12 | VL_CTOR_IMP(VTest_DotProduct) { | ^~~~~~~~~~~ /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest_DotProduct__Slow.cpp: In function ‘int VL_CTOR_IMP(VTest_DotProduct)’: /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest_DotProduct__Slow.cpp:15:5: error: ‘_ctor_var_reset’ was not declared in this scope 15 | _ctor_var_reset(); | ^~~~~~~~~~~~~~~ /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest_DotProduct__Slow.cpp:16:1: warning: no return statement in function returning non-void [-Wreturn-type] 16 | } | ^ /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp:12:1: error: ISO C++ forbids declaration of ‘VL_CTOR_IMP’ with no type [-fpermissive] 12 | VL_CTOR_IMP(VTest) { | ^~~~~~~~~~~ /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp: In function ‘int VL_CTOR_IMP(VTest)’: /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp:13:39: error: ‘__VlSymsp’ was not declared in this scope; did you mean ‘vlSymsp’? 13 | VTest__Syms* __restrict vlSymsp = __VlSymsp = new VTest__Syms(this, name()); | ^~~~~~~~~ | vlSymsp /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp:13:67: error: invalid use of ‘this’ in non-member function 13 | VTest__Syms* __restrict vlSymsp = __VlSymsp = new VTest__Syms(this, name()); | ^~~~ /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp:13:73: error: ‘name’ was not declared in this scope; did you mean ‘tzname’? 13 | VTest__Syms* __restrict vlSymsp = __VlSymsp = new VTest__Syms(this, name()); | ^~~~ | tzname /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp:34:5: error: ‘_ctor_var_reset’ was not declared in this scope 34 | _ctor_var_reset(); | ^~~~~~~~~~~~~~~ /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp:35:1: warning: no return statement in function returning non-void [-Wreturn-type] 35 | } | ^ /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp: In member function ‘void VTest::__Vconfigure(VTest__Syms*, bool)’: /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp:41:28: error: no matching function for call to ‘Verilated::timeunit(int)’ 41 | Verilated::timeunit(-12); | ^ In file included from /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest.h:11, from : /usr/local/share/verilator/include/verilated.h:785:16: note: candidate: ‘static int Verilated::timeunit()’ 785 | static int timeunit() VL_MT_SAFE { return Verilated::threadContextp()->timeunit(); } | ^~~~~~~~ /usr/local/share/verilator/include/verilated.h:785:16: note: candidate expects 0 arguments, 1 provided /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Slow.cpp:42:33: error: no matching function for call to ‘Verilated::timeprecision(int)’ 42 | Verilated::timeprecision(-12); | ^ In file included from /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest.h:11, from : /usr/local/share/verilator/include/verilated.h:786:16: note: candidate: ‘static int Verilated::timeprecision()’ 786 | static int timeprecision() VL_MT_SAFE { return Verilated::threadContextp()->timeprecision(); } | ^~~~~~~~~~~~~ /usr/local/share/verilator/include/verilated.h:786:16: note: candidate expects 0 arguments, 1 provided /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Syms.cpp: In constructor ‘VTest__Syms::VTest__Syms(VTest*, const char*)’: /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest__Syms.cpp:31:181: error: no matching function for call to ‘VerilatedSyms::VerilatedSyms()’ 31 | 9(Verilated::catName(topp->name(), “Test.vta_shell.core.compute.tensorGemm.mvc.dot_9”)) | ^

In file included from /home/llf/tvm/3rdparty/vta-hw/build/verilator/VTest.h:11, from : /usr/local/share/verilator/include/verilated.h:568:14: note: candidate: ‘VerilatedSyms::VerilatedSyms(VerilatedContext*)’ 568 | explicit VerilatedSyms(VerilatedContext* contextp); // Pass null for default context | ^~~~~~~~~~~~~ /usr/local/share/verilator/include/verilated.h:568:14: note: candidate expects 1 argument, 0 provided /usr/local/share/verilator/include/verilated.h:560:7: note: candidate: ‘constexpr VerilatedSyms::VerilatedSyms(const VerilatedSyms&)’ 560 | class VerilatedSyms VL_NOT_FINAL { | ^~~~~~~~~~~~~ /usr/local/share/verilator/include/verilated.h:560:7: note: candidate expects 1 argument, 0 provided

I dont know what’s wrong and am really confused. My sbt version is 1.4.9. :disappointed_relieved:

You are welcome! I suspect there might be an issue of verilator v4.202… I use verilator v4.200 which is a stable version. Could you remove the verilator v4.202 you installed, and install the verilator v4.200? If you are on Mac, you could do brew install verilator, this will install the verilator v4.200. And do make cleanall, and then make.

Thank you greatly! Now no error occurred! :grin:

Glad to hear! Have fun! :smile: