0

SystemC allows signals (or members etc.) to be traced via the sc_trace function, the result being a VCD file that can be used in other programs. The naming of these signals is rather arbitrary though, with the function accepting any string (that doesn't have to relate to the variable itself) as a name for the signal to be dumped.

The question is: Can I somehow get the mapping from the sc_interface objects to the string that is used as their name via the SystemC API? I'm logging a lot of data in other ways and it'd be nice to be able to connect the values I retrieve to the VCD data in some way and I can't think of a way to do that if I only have the dumped values and a random string identifier.

Jay
  • 237
  • 2
  • 14
  • Not exactly sure what you're asking for, but there's a name to string mapping at the start of the VCD file (which is ascii, not a binary format). – Marty Jun 20 '12 at 16:04
  • You mean like "$var wire 1 aaa clock $end"? That only maps the given string ("clock") to the VCD variable name ("aaa") so you know that further changes of "aaa" should be mapped to "clock". I'm talking about object instances though... I'd like to know which sc_interface is traced by the "clock" variable. As the name ("clock") is just specified in the sc_trace call and could be anything (and doesn't necessarily relate to the signal or port) I'm having difficulties mapping it to the actual object instance. – Jay Jun 21 '12 at 13:51

1 Answers1

1

Not sure if I understand your question accurately but ... SystemC makes a difference of eg. signal simulation names and c++ instance names. The simulation name is specified in the constructor parameter list of the object. Unless you omitt naming the object during construction the name appearing in the vcd-file should be all but arbitary. On the other hand you omitt the name a name will be generated for you by the alternative constructor. Maybe you could provide some sample code to rule out any confusion.

    sc_signal()
: sc_prim_channel( sc_gen_unique_name( "signal" ) ),
  m_change_event_p( 0 ), m_cur_val( T() ), 
  m_delta( ~sc_dt::UINT64_ONE ), m_new_val( T() ), m_output( 0 ), 
  m_writer( 0 ) 
{}

explicit sc_signal( const char* name_ )
: sc_prim_channel( name_ ),
  m_change_event_p( 0 ), m_cur_val( T() ), 
  m_delta( ~sc_dt::UINT64_ONE ), m_new_val( T() ), m_output( 0 ), 
  m_writer( 0 ) 
{}

You want to use the latter constructor

Daniel
  • 53
  • 7