kjhyland Posted June 12, 2018 Report Posted June 12, 2018 Hi - I am tracing variables from a system C model but the hierarchy of the class structure is not mirrored in the vcd file. All variables are collected flat under a SystemC module. Am I doing something wrong? I've tried enabling the tracing of the vars from the top level and from within the class hierarchy itself, but it doesn't seem to make a difference. thanks, K Quote
AmeyaVS Posted June 13, 2018 Report Posted June 13, 2018 Hello @kjhyland, While adding signals using sc_trace did you provide the hierarchical names of the signals? Best Regards, Ameya Vikram Singh Quote
kjhyland Posted June 13, 2018 Author Report Posted June 13, 2018 Hi Ameya - I did to access the signal, but not in the name string. I copied the hierarchy of the probe to the name string and, to my surpirse, the hierarchy was dumped. originally I had sc_trace(_trace_, top.dpu.idu.weight_reader.m_traffic_gen._STATE_, "traffic_reader_state"); which provided no hierarchy. I changed it to this, and it worked! sc_trace(_trace_, top.dpu.idu.weight_reader.m_traffic_gen._STATE_, "top.dpu.idu.weight_reader.m_traffic_gen._STATE_"); thanks for the prompt - very much appreciated. thanks, Kevin Quote
Eyck Posted June 13, 2018 Report Posted June 13, 2018 Hi Kevin, if you check here https://github.com/Minres/SystemC-Components/blob/master/incl/scc/utilities.h there are three macros which make live easier: #define TRACE_VAR(F, X) sc_core::sc_trace(F, X, std::string(this->name()) + "." #X) #define TRACE_ARR(F, X, I) sc_core::sc_trace(F, X[I], (std::string(this->name()) + "." #X "(" + std::to_string(I) + ")").c_str()); #define TRACE_SIG(F, X) sc_core::sc_trace(F, X, X.name()) They can be used with local variables and arrays as well with SystemC objects providing the name() funtion. This way tracing a signal becomes as easy as (assuming _STATE_ being a signal or port): TRACE_VAR(_trace_, top.dpu.idu.weight_reader.m_traffic_gen._STATE_); Pls. note: the first 2 macros are assumed to be used within a sc_module. HTH -Eyck maehne and Roman Popov 2 Quote
kjhyland Posted June 13, 2018 Author Report Posted June 13, 2018 Thanks Eyck - you've saved me my next step. Much appreciated. Kevin Quote
kjhyland Posted June 13, 2018 Author Report Posted June 13, 2018 Just to confirm for other readers - the macros work as described. sc_trace(tracef, dpu.idu.weight_reader.m_traffic_gen._STATE_, "dpu.idu.weight_reader.m_traffic_gen._STATE_"); equivalent to TRACE_VAR(tracef,dpu.idu.weight_reader.m_traffic_gen._STATE_); thanks again Eyck and Ameya, K 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.