29#ifndef SC_STAGE_CALLBACK_REGISTRY_H_INCLUDED_
30#define SC_STAGE_CALLBACK_REGISTRY_H_INCLUDED_
70 void construction_done()
const;
71 void elaboration_done()
const;
72 void start_simulation()
const;
74 void update_done()
const;
75 void before_timestep()
const;
77 void pre_suspend()
const;
78 void post_suspend()
const;
80 void simulation_paused()
const;
81 void simulation_stopped()
const;
82 void simulation_done()
const;
94 typedef std::vector<entry> storage_type;
95 typedef std::vector<cb_type*> single_storage_type;
101 : ref_(ref), prev_(ref)
118 storage_type m_cb_vec;
119 single_storage_type m_cb_update_vec;
120 single_storage_type m_cb_timestep_vec;
124 sc_stage_callback_registry(
const this_type& );
134sc_stage_callback_registry::construction_done()
const
136 scoped_stage scope( m_simc->m_stage
142sc_stage_callback_registry::elaboration_done()
const
144 scoped_stage scope( m_simc->m_stage
150sc_stage_callback_registry::start_simulation()
const
152 scoped_stage scope( m_simc->m_stage
158sc_stage_callback_registry::pre_suspend()
const
160 scoped_stage scope( m_simc->m_stage
166sc_stage_callback_registry::post_suspend()
const
168 scoped_stage scope( m_simc->m_stage
174sc_stage_callback_registry::simulation_paused()
const
176 scoped_stage scope( m_simc->m_stage
182sc_stage_callback_registry::simulation_stopped()
const
184 scoped_stage scope( m_simc->m_stage
190sc_stage_callback_registry::simulation_done()
const
192 scoped_stage scope( m_simc->m_stage
200sc_stage_callback_registry::update_done()
const
203 if(
SC_LIKELY_(!m_cb_update_vec.size()) )
return;
204 scoped_stage scope( m_simc->m_stage
207 typedef single_storage_type::const_iterator it_type;
208 single_storage_type
const & vec = m_cb_update_vec;
210 for(it_type it = vec.begin(), end = vec.end(); it != end; ++it)
215sc_stage_callback_registry::before_timestep()
const
217 if(
SC_LIKELY_(!m_cb_timestep_vec.size()) )
return;
219 scoped_stage scope( m_simc->m_stage
221 typedef single_storage_type::const_iterator it_type;
222 single_storage_type
const & vec = m_cb_timestep_vec;
224 for(it_type it = vec.begin(), end = vec.end(); it != end; ++it)
@ SC_POST_END_OF_ELABORATION
@ SC_POST_BEFORE_END_OF_ELABORATION
@ SC_POST_START_OF_SIMULATION
@ SC_POST_END_OF_SIMULATION
sc_simcontext * sc_get_curr_simcontext()
unsigned int stage_cb_mask
sc_stage_callback_if cb_type
sc_stage_callback_registry this_type
friend class sc_simcontext
cb_type::stage_cb_mask mask_type
friend SC_API void sc_register_stage_callback(sc_stage_callback_if &cb, sc_stage_callback_if::stage_cb_mask mask)
friend SC_API void sc_unregister_stage_callback(sc_stage_callback_if &cb, sc_stage_callback_if::stage_cb_mask mask)