Project

General

Profile

[logo] 
 
Home
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Qmake and Verilator

Added by Kirill Bykov about 1 year ago

I am working on embedding a Verilator output into a SystemC memory simulation tool which uses qmake. I used Verilator to verilate a SV module and sourced it from inside the SystemC simulation tool. In qmake I included obj_dir, Verilator's include folders and added Vmodule_ALL.a_ as a library. But I am getting errors like:

In function `Vtop::~Vtop()':
Vtop__ALLcls.cpp:(.text+0x3d): undefined reference to `VerilatedModule::~VerilatedModule()'
In function `Vtop::_ctor_var_reset()':
Vtop__ALLcls.cpp:(.text+0x55a6c): undefined reference to `VL_RAND_RESET_Q(int)'

Which makes me think that I am missing Verilator itself, though I imported Verilator's include folder (share/verilator/import). I think I am still missing Verilator library itself, but I don't know how to import it in Qmake. I tried adding Verilator .cpp files to SOURCES, but it didn't help.

I checked how SystemC libraries are added into Qmake, so maybe I can add Verilator in a similar way:

LIBS += -L$${systemc_home}/lib-$${systemc_target_arch} -lsystemc

But I don't have Static Library, would it make sense for me to prodoce a static library for Verilater and add it in the same way? Though, I don't even know if there is a way to do it.

Or maybe I can add Verilator as a binary to Qmake?

Or maybe Verilator is already there, I am just missing something else?


I am using Ubuntu, Verilator 4.012, SystemC-2.3.1, gcc-7.4.0

I don't know if the output is of any use, but here is a little part of it:

g++ -lgcov --coverage -Wl,-O1 -Wl,-rpath,/opt/systemc-2.3.1a//lib-linux64 -o Sys main.o   -L/opt/systemc-2.3.1a//lib-linux64 -lsystemc ../library/Sys.a ../../src/libdrampower.a ../../obj_dir/Vtop.a -lsqlite3 
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::~Vtop()':
Vtop__ALLcls.cpp:(.text+0x3d): undefined reference to `VerilatedModule::~VerilatedModule()'
Vtop__ALLcls.cpp:(.text+0x49): undefined reference to `VerilatedModule::~VerilatedModule()'
Vtop__ALLcls.cpp:(.text+0x55): undefined reference to `VerilatedModule::~VerilatedModule()'
Vtop__ALLcls.cpp:(.text+0x61): undefined reference to `VerilatedModule::~VerilatedModule()'
Vtop__ALLcls.cpp:(.text+0x6d): undefined reference to `VerilatedModule::~VerilatedModule()'
../../obj_dir/Vtop.a(Vtop__ALLcls.o):Vtop__ALLcls.cpp:(.text+0x79): more undefined references to `VerilatedModule::~VerilatedModule()' follow
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::~Vtop()':
Vtop__ALLcls.cpp:(.text+0xed): undefined reference to `VerilatedSyms::~VerilatedSyms()'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_settle__TOP__1(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x31d4): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x1e6f8): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_combo__TOP__2(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x2a8ab): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x2b148): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_sequent__TOP__3(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x2b9e2): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x2ba7a): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_sequent__TOP__4(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x2baa4): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x46018): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_sequent__TOP__5(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x4c492): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x4c54a): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_combo__TOP__6(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x4c584): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x51340): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_sequent__TOP__7(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x54782): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x54882): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_sequent__TOP__8(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x5489b): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x54cc8): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_combo__TOP__9(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x54dbd): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x55468): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_eval(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x5548b): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x5561a): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_eval_initial(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x55632): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x5567a): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::final()':
Vtop__ALLcls.cpp:(.text+0x55682): undefined reference to `Verilated::s_s'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_eval_settle(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x556a2): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x556ca): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_change_request(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x556e8): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x5572d): undefined reference to `VL_DBG_MSGF(char const*, ...)'
Vtop__ALLcls.cpp:(.text+0x55737): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x55763): undefined reference to `VL_DBG_MSGF(char const*, ...)'
../../obj_dir/Vtop.a(Vtop__ALLcls.o): In function `Vtop::_eval_initial_loop(Vtop__Syms*)':
Vtop__ALLcls.cpp:(.text+0x557c3): undefined reference to `Verilated::s_s'
Vtop__ALLcls.cpp:(.text+0x557cd): undefined reference to `Verilated::debug(int)'
Vtop__ALLcls.cpp:(.text+0x557e2): undefined reference to `Verilated::debug(int)'
Vtop__ALLcls.cpp:(.text+0x557f9): undefined reference to `VL_FATAL_MT(char const*, int, char const*, char const*)'
.........

Replies (2)

RE: Qmake and Verilator - Added by Wilson Snyder about 1 year ago

You are missing linking in verilated.cpp. Note there are other .cpp files sometimes needed too - they are listed in the .mk file made by verilator.

RE: Qmake and Verilator - Added by Kirill Bykov about 1 year ago

Yes, thank you, I found them under VM_GLOBAL_FAST in Classes MakeFile

    (1-2/2)