[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  SystemPerl
  Voneline
  WFH
General Info
  Papers

Issue #535

SystemC 2.3.0 does not work with Verilator tests

Added by Jeremy Bennett 10 months ago. Updated 7 months ago.

Status:NoFixNeeded Start date:07/23/2012
Priority:Low Due date:
Assignee:- % Done:

0%

Category:Configure/Make/Compiling
Target version:-

Description

I've just discovered that the Verilator tests (make test) do not work with the new SystemC 2.3.0, failing due to lack of a -pthread library specification. Here is the failure

g++     -L/opt/systemc/lib-linux64  -g sc_main.o verilated.o verilated_vcd_c.o verilated_vcd_sc.o Vtop__ALL.a /opt/systemc/lib-linux64/libsystemc.a    -o simx -lsystemc -lm -lstdc++ 2>&1 | c++filt
/opt/systemc/lib-linux64/libsystemc.a(sc_prim_channel.o): In function `sc_core::sc_host_mutex::trylock()':
sc_prim_channel.cpp:(.text._ZN7sc_core13sc_host_mutex7trylockEv[sc_core::sc_host_mutex::trylock()]+0x9): undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
make[2]: Leaving directory `/home/verilator/src/test_sc/obj_dir'
obj_dir/simx
make[1]: obj_dir/simx: Command not found
make[1]: *** [run] Error 127
make[1]: Leaving directory `/home/verilator/src/test_sc'
make: *** [test_sc] Error 2

Manually rerunning the g++ command with -lpthread added cures the problem. There is no problem when using SystemC 2.2.0.

I have no urgent need for this - I just noticed it when running on a new System, where I installed the latest SystemC. I'm quite happy to keep using 2.2.0 for the time being.

History

Updated by Wilson Snyder 10 months ago

Yes, you need to

export SYSTEMC_CXX_FLAGS=-pthread

Annoyingly that wasn't needed in the pre-released 2.3.0.

Verilator can't easily assume -pthread as it's platform specific, and depends on how SystemC was built. There's probably a way to write a fancy configure.ac rule to detect if this is needed or not automatically. If you'd like to attempt it, that would probably help others.

Updated by Wilson Snyder 10 months ago

  • Category set to Configure/Make/Compiling
  • Status changed from New to Assigned

Updated by Wilson Snyder 7 months ago

  • Status changed from Assigned to NoFixNeeded

Fix given earlier.

Also available in: Atom