carter Posted April 21, 2014 Report Share Posted April 21, 2014 Hi As i know, sc_initialize() is just work for systemc scheduler initialize. But i 'm not sure about what for use exactly? Would you please let me know what (why/when) i have to use this? Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted April 21, 2014 Report Share Posted April 21, 2014 You should not use sc_initialize(). It's deprecated and not part of the IEEE 1666 SystemC standard. If you want to prepare the simulation without running it yet, your can complete the elaboration and run the initialization via sc_start( SC_ZERO_TIME ); from within your sc_main() function. Afterwards, you can call sc_start multiple times again, e.g. with non-zero duration arguments, to perform the simulation itself./Philipp Quote Link to comment Share on other sites More sharing options...
carter Posted April 21, 2014 Author Report Share Posted April 21, 2014 You should not use sc_initialize(). It's deprecated and not part of the IEEE 1666 SystemC standard. If you want to prepare the simulation without running it yet, your can complete the elaboration and run the initialization via sc_start( SC_ZERO_TIME ); from within your sc_main() function. Afterwards, you can call sc_start multiple times again, e.g. with non-zero duration arguments, to perform the simulation itself./Philipp Thanks philipp Quote Link to comment Share on other sites More sharing options...
carter Posted April 22, 2014 Author Report Share Posted April 22, 2014 You should not use sc_initialize(). It's deprecated and not part of the IEEE 1666 SystemC standard. If you want to prepare the simulation without running it yet, your can complete the elaboration and run the initialization via sc_start( SC_ZERO_TIME );from within your sc_main() function. Afterwards, you can call sc_start multiple times again, e.g. with non-zero duration arguments, to perform the simulation itself./Philipp Hi philipp.I'm not sure about "If you want to prepare the simulation without running it yet". Would you please let me know above case? I don't know the case about" to prepare the simulation without running" for what? Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted April 22, 2014 Report Share Posted April 22, 2014 See the IEEE 1666-2011 standard, chapter 4 for details about the SystemC elaboration and simulation semantics. If you don't "need" to run the initialization phase separately, you don't need to worry about this detail. The first invocation of sc_start will take care of completing the elaboration and initialization automatically.There is an example in the SystemC standard (in section 4.5.7), which shows a simulation running in individual steps: The function sc_pending_activity may return false at the end of elaboration. Therefore, care should be taken when calling sc_start in a loop conditional on any of the functions that detect pending activity.Example: int sc_main( int argc, char* argv[] ) { // Instantiate top-level module ... sc_start( SC_ZERO_TIME ); // Run the initialization phase to create pending activity while( sc_pending_activity() ) { sc_start( sc_time_to_pending_activity() ); // Run up to the next activity } return 0; } In this example, you need the explicit initialization call. /Philipp Quote Link to comment Share on other sites More sharing options...
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.