samyakjaroli Posted April 30, 2013 Report Posted April 30, 2013 Hi, I have a query regarding sc_trace. Is it possible to have directly get all the signals and ports dumped into the VCD file. I am trying something like this in sc_main: Top top1("top1"); sc_trace_file *tf = sc_create_vcd_trace_file("waveforms");sc_simcontext *context = sc_get_curr_simcontext();sc_object *optr = context->first_object();while(optr) { if (std::string(optr->kind()) == "sc_signal") optr->trace(tf); optr = context->next_object(); } With this I am not getting anything into the waveforms.vcd. Could anyone please suggest the correct way to do the above. Thanks for the help. -- Samyak Jaroli Student, India Quote
Philipp A Hartmann Posted April 30, 2013 Report Posted April 30, 2013 There has been a discussion on tracing all signals (and ports) in a design in this forum before, see http://forums.accellera.org/topic/138-why-sc-object-menber-function-trace-deprecated/ Short answer: sc_object::trace is not part of the IEEE 1666 SystemC standard and won't work the way you expect. Secondly, sc_simcontext is also not part of the standard. You should not use it within your designs. To traverse the SystemC object hierarchy, use the sc_get_top_level_objects() and [sc_object::get_child_objects()[/i] functions. An example can be found in the thread linked above. Greetings from Oldenburg, Philipp Quote
Roman Popov Posted May 8, 2017 Report Posted May 8, 2017 Hello, I've created a script for GDB that automatically calls sc_trace for all signals, ports and plain member variables. It requires a small patch for SystemC library: moving some sc_trace definitions from .h to .cpp so they are not in-lined or garbage collected. Here it is: https://github.com/ripopov/gdb_systemc_trace Since I've tested it only with my design, it may be buggy. Please report any issues on github. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.