Elvis Shera Posted January 29, 2018 Report Share Posted January 29, 2018 Hi, I am calling SC model from a program with its own unit... While calling a function which advances the simulation time I noticed the following behaviour: --- the function which is called from outside is: void advance_sim(double simtime) { cout<<"@"<<sc_time_stamp()<<". Advancing Simulation time by "<<simtime<<" ns"<<endl; sc_core::sc_start(simtime, sc_core::SC_NS); } When I use SC_FS/PS/NS as time unit all is ok. When I use SC_US/MS/SEC I get a segmentation fault (core dump). Has anybody seen this before? It looks wired to me. If my code was not correct, why would this work for unit <= NS ? Thanks, Elvis Quote Link to comment Share on other sites More sharing options...
maehne Posted January 29, 2018 Report Share Posted January 29, 2018 It is hard to guess a reason for the segmentation fault from the information that you provide. Have you tested that your simulation works properly if you convert the time range, which you passed in us/ms/sec to ns? You should also check out the core dump in the debugger. It contains a stack trace so that you can check at which point in the execution the segfault was provoked. Of course, the segfault might have occurred in some internal/standard library function, but in many cases the cause for it happened in user code. Therefore, you will have to step up stack frame per stack frame until you reached the code you have written. While doing this, examine the arguments and local variables of the current function. They might give you a hint what is going on. 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.