我正在尝试编译和链接 Verilator (veripool.org) 的运行时支持代码。它构建得很好,但由于某种原因,有一些方法没有出现在相关的目标文件中,Verilated::timeunit(int)
并且Verilated::timeprecision(int)
.
这些表面上是在 include/verilated.h 中定义的:
static int timeunit() VL_MT_SAFE { return Verilated::threadContextp()->timeunit(); }
static int timeprecision() VL_MT_SAFE { return Verilated::threadContextp()->timeprecision(); }
现在,您可以看到调用函数中两种类型的方法都有一个参数,该参数int
显示在链接步骤中:
ld: /home/jon/controlix/src/nuttx/nuttx/staging/libcontrols.a(Vhello_world__ALL.o): in function `Vhello_world::__Vconfigure(Vhello_world__Syms*, bool)':
Vhello_world__ALL.cpp:(.text+0x15): undefined reference to `Verilated::timeunit(int)'
Vhello_world__ALL.cpp:(.text+0x15): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `Verilated::timeunit(int)'
ld: Vhello_world__ALL.cpp:(.text+0x20): undefined reference to `Verilated::timeprecision(int)'
Vhello_world__ALL.cpp:(.text+0x20): relocation truncated to fit: R_X86_64_PLT32 against undefined symbol `Verilated::timeprecision(int)'
l
我尝试将方法声明更改verilated.h
为将 int 作为参数,即使缺少该参数会导致编译时错误,但是这两个方法声明仍然没有出现在verilated.cpp
. 类中的其他方法Verilated::
显示得很好。
我错过了什么?