1

I want to trace all signals in my design to VCD file. Is possible to automate this process? I don't want add each signal to trace manually ( with sc_trace (..) )

random
  • 3,868
  • 3
  • 22
  • 39
  • It is quite possible to automate the process. Most of the EDA vendor tools already provide such solutions. One thing I do is to write the tracing methods in all the available modules I have written and call the tracing method from the top most hierarchy. You can see an attempt [here](https://github.com/AmeyaVS/SystemC_ramblings/blob/master/src/02_adder/full_adder.cpp), not one of my most beautiful coding relic. – AmeyaVS Apr 18 '17 at 18:37
  • I've found out that proper solution is using lldb/gdb scripting to find all signals using debuginfo and add them into a trace. But I have not got time yet to implement it. – random Apr 18 '17 at 20:46
  • I think EDA vendors use gdb. – random Apr 18 '17 at 20:47
  • I don't think the EDA vendors would be using GDB due to licensing issues, they are very strict about their legacy code base and proprietary code magic. They might be using something similar or just calling sc_trace whenever you declare a sc_in/out port and bind them which is easily doable if you are daring to modify the OSCI SystemC implementation. – AmeyaVS Apr 19 '17 at 05:33
  • Modern commercial simulators support tracing of plain C++ variables (not only sc_objects). The only way to extract them is to use debug information and RTTI. And I don't think EDA vendors have enough resources and expertise to write gdb/lldb clone from scratch. So I'm 99% sure that they implement tracing using GDB scripting. – random Apr 19 '17 at 18:30
  • Basically they extract pointers to all variables in design using debug infromation, and then call something similar to sc_trace – random Apr 19 '17 at 18:31
  • I am not so sure about them doing through open source tools since they all love to re-invent the wheel all over again, instead of supporting/improving open tools and standards. – AmeyaVS Apr 20 '17 at 08:34

1 Answers1

2

I've ended up with implementing script for GDB debugger that automatically traces signals and other sc_module members in design.

In case it will be useful for someone else, here are sources: https://github.com/ripopov/gdb_systemc_trace

random
  • 3,868
  • 3
  • 22
  • 39