Jump to content

Why call end_of_elaboration in sc_port_base::elaboration_done()

Recommended Posts

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

    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 );

// called by elaboration_done (does nothing)


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.

Share this post

Link to post
Share on other sites

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.


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