Jump to content
samyakjaroli

sc_trace for all sc_signal,sc_in, sc_out

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×