taog Posted January 17, 2019 Report Posted January 17, 2019 Hi all, I'm not familiar with SystemC source code. I'm debugging a segment fault issue inside SystemC. The call stack is like below: #0 0x000000000048124e in sc_core::sc_inout<bool>::end_of_elaboration() () #1 0x0000000000473d8e in sc_core::sc_port_base::elaboration_done() () #2 0x0000000000474ab3 in sc_core::sc_port_registry::elaboration_done() () #3 0x00000000004e1e0c in sc_core::sc_simcontext::elaborate() () #4 0x00000000004e3d1d in sc_core::sc_simcontext::initialize(bool, bool) () #5 0x00000000004e3e04 in sc_core::sc_simcontext::initialize(bool) () #6 0x00000000004e3e26 in sc_core::sc_simcontext::simulate(sc_core::sc_time const&) () #7 0x00000000004e4022 in sc_core::sc_start(sc_core::sc_time const&, sc_core::sc_starvation_policy) () In src/sysc/communication/sc_port.cpp, I found void sc_port_base::elaboration_done() { assert( m_bind_info != 0 && m_bind_info->complete ); delete m_bind_info; m_bind_info = 0; sc_module* parent = static_cast<sc_module*>( get_parent_object() ); sc_object::hierarchy_scope scope( parent ); end_of_elaboration(); } // called by elaboration_done (does nothing) void sc_port_base::end_of_elaboration() {} Why we call end_of_elaboration() here and why we come to sc_core::sc_inout<bool>::end_of_elaboration()? Maybe the call stack is not correct. Quote
David Black Posted January 17, 2019 Report Posted January 17, 2019 SystemC's implementation code is not generally an area we discuss except in the extremely rare instance we find a bug. Please read IEEE-1666 standards document (freely available via accellera.org). The behavior is correct. Quote
Roman Popov Posted January 18, 2019 Report Posted January 18, 2019 Quote Why we call end_of_elaboration() here and why we come to sc_core::sc_inout<bool>::end_of_elaboration()? Maybe the call stack is not correct. Because of dynamic dispatch. https://en.cppreference.com/w/cpp/language/virtual 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.