Project

General

Profile

[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
  Voneline
  WFH
General Info
  Papers

Issue #1377

Segmentation Fault when tracing is enabled

Added by Aaron Kelly about 1 month ago. Updated about 1 month ago.

Status:
AskedReporter
Priority:
Normal
Assignee:
Category:
WrongRuntimeResult
% Done:

0%


Description

Hi all,

First off let me thank you for this amazing software - I have compiled a 250k gate design with some of the more exotic system verilog constructs without any issue.

I have however ran into an issue when compiling a static library with tracing turned on that is used within another program. On smaller designs this is fine however on this larger design it seems to not like one of the files. Is there a way of bisect debuggging this by changing verilators scope when tracing? I have applied a /*verilator tracing_off*/ at the top level module and for packages but it seems like just having the switch turned on causes a memeory error.

I looked into <ip>__trace__slow.cpp and see all the signals are commented out.

History

#1 Updated by Wilson Snyder about 1 month ago

  • Status changed from New to AskedReporter

Thanks.

There's numerous trace control methods, probably --trace-depth is the first to try, see others in the manual.

If you're getting a core dump, I'd however instead suggest compiling with debug and running under gdb, then doing a backtrace. Usually it gets very close to the problem.

Good luck, please post back what the problem is, even if something outside Verilator.

#2 Updated by Aaron Kelly about 1 month ago

Wilson Snyder wrote:

Thanks.

There's numerous trace control methods, probably --trace-depth is the first to try, see others in the manual.

If you're getting a core dump, I'd however instead suggest compiling with debug and running under gdb, then doing a backtrace. Usually it gets very close to the problem.

Good luck, please post back what the problem is, even if something outside Verilator.

Thanks for the quick reply, I've tried setting --trace-depth to 1 and 0. The files compiles and simulates fine in my test bench without the --trace switch but --trace/--trace-depth 0 cause a segmentation error. I have also tried it on other projects and it dumps the waves it just seems to be this bigger project with interface files.

I tried activating the --debug switch, do I need the --gdb switch too?

I'm not an expert in GDB but I got back a very obscure message back

Program received signal SIGSEGV, Segmentation fault. 0x0000000000026816 in ?? ()

I just saw the configuration files section mentioning

tracing_on [-file "<filename>" [-lines <line> [ - <line> ]]]

tracing_off [-file "<filename>" [-lines <line> [ - <line> ]]]

I might try that and see which file is crashing when it gets traced.

#3 Updated by Wilson Snyder about 1 month ago

Program received signal SIGSEGV, Segmentation fault. 0x0000000000026816 in ?? ()

You need to compile with debug on. Depends on your compiler, but with GDB it's something like --ggdb. Add that to your makefile, or

verilator ... -CFLAGS '-DVL_DEBUG -ggdb'

#4 Updated by Aaron Kelly about 1 month ago

Wilson Snyder wrote:

Program received signal SIGSEGV, Segmentation fault. 0x0000000000026816 in ?? ()

You need to compile with debug on. Depends on your compiler, but with GDB it's something like --ggdb. Add that to your makefile, or

verilator ... -CFLAGS '-DVL_DEBUG -ggdb'

The symbols seems to get stripped out somewhere along my flow I tried adding -ggdb to each step but couldn't get it working.

I have however got it working to trace the file now but it required me to go into the generated ventilator code and change some stuff. It seems with this project it has dumped extra files

V<IP>_<interface1>.cpp/h

V<IP>_<interface2>.cpp/h

and within them they seem to reference

public:
  static void traceInit(VerilatedVcd* vcdp, void* userthis, uint32_t code);
  static void traceFull(VerilatedVcd* vcdp, void* userthis, uint32_t code);
  static void traceChg(VerilatedVcd* vcdp, void* userthis, uint32_t code);

When I remove this from <IP>_unit.cpp and V<IP>_<interface1/2>.cpp it traces correctly, is a pointer maybe getting overwritten?

The difference in this project is that I have used -top-module.

Would it be worth sending a testcase?

#5 Updated by Wilson Snyder about 1 month ago

Perhaps you didn't link with -ggdb?

A test case would be appreciated.

Also available in: Atom