jsmith125x Posted January 9, 2014 Report Share 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. CliffordPersechino 1 Quote Link to comment Share on other sites More sharing options...
karthickg Posted January 10, 2014 Report Share 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. Quote Link to comment Share on other sites More sharing options...
dakupoto Posted January 10, 2014 Report Share 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. Quote Link to comment Share on other sites More sharing options...
saraswathi.m Posted January 10, 2014 Report Share 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. Quote Link to comment Share on other sites More sharing options...
jsmith125x Posted January 10, 2014 Author Report Share 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. Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted January 10, 2014 Report Share 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 maehne 1 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.