jsmith125x 2 Report post Posted January 9, 2014 Hi, int main(int argc, char* argv[]) { int a; a = sc_run(argc, argv); a = sc_run(argc, argv); return a; } I'd like to run sc_run more than one times. Is that possible? After the second run the a is 1, this is possible an error code. 1 CliffordPersechino reacted to this Share this post Link to post Share on other sites
karthickg 5 Report post Posted January 10, 2014 Are you on the reference simulator? Did you mean to say sc_start instead of sc_run ? There is no such thing as sc_run in the reference OSCI simulator. Share this post Link to post Share on other sites
dakupoto 33 Report post Posted January 10, 2014 Hi, int main(int argc, char* argv[]) { int a; a = sc_run(argc, argv); a = sc_run(argc, argv); return a; } I'd like to run sc_run more than one times. Is that possible? After the second run the a is 1, this is possible an error code. Hello Sir, One could use the sc_start(<args>); method to achieve one's goal even more easily. For example, the simulator is started with a set of inputs and sc_start is invoked for 10 nanoseconds. Then the input is changed, and sc_start is invoked for another 10 nanoseconds and so on. Hope that helps. Share this post Link to post Share on other sites
saraswathi.m 1 Report post Posted January 10, 2014 Hello, There is no sc_run in systemc instead we have sc_start with aruments and return type is void . 1. yes it is possible to call sc_start many times. Share this post Link to post Share on other sites
jsmith125x 2 Report post Posted January 10, 2014 Sorry I have this for sc_run int sc_run( int argc, char* argv[] ) { return main( argc, argv ); } So I'd like to run the whole simulation more times, but for the second time it returns with 1, it means probably an error code. Share this post Link to post Share on other sites
Philipp A Hartmann 220 Report post Posted January 10, 2014 Sorry I have this for sc_run int sc_run( int argc, char* argv[] ) { return main( argc, argv ); } So I'd like to run the whole simulation more times, but for the second time it returns with 1, it means probably an error code. You probably call 'sc_main' within your 'sc_run' function, otherwise you have just built an infinite recursion. Secondly, you should try to avoid the 'sc_' prefix in your own code. That said, did you look at section 4 of the IEEE 1666-2011 standard, as I suggested in my previous answer? Your 'sc_run' function is provided by SystemC already under the name sc_elab_and_sim (see 4.3.2). From the standard's perspective, your question is partly answered already there. Quoting (emphasis mine): Function sc_elab_and_sim shall initiate the mechanisms for running elaboration and simulation. The application should pass the values of the parameters from function main as arguments to function sc_elab_and_sim. Whether the application may call function sc_elab_and_sim more than once is implementation-defined. The Accellera proof-of-concept implementation does not support multiple calls to 'sc_elab_and_sim'. /Philipp 1 maehne reacted to this Share this post Link to post Share on other sites