kaiserhaz Posted January 6, 2016 Report Share Posted January 6, 2016 Hello, I was doing a simulation and I keep getting a runtime error exception (MSVC). I traced the error to a wait() statement. What could be the cause? Thank you, Quote Link to comment Share on other sites More sharing options...
kartikkg Posted January 6, 2016 Report Share Posted January 6, 2016 Are you calling wait from an SC_METHOD? That can cause an runtime error. Quote Link to comment Share on other sites More sharing options...
kaiserhaz Posted January 6, 2016 Author Report Share Posted January 6, 2016 Hello, No, I am sure that it was from an SC_THREAD. SC_THREAD( mem_constr_module_thread ); ... void mem_constr_module_thread() { ... if(mem_c0->m_t0->r_nw.read() == SC_LOGIC_1) { write(); wait(_mem_write_access_time, MEM_TIME_UNIT); // This one is ok } else { wait(_mem_read_access_time, MEM_TIME_UNIT); // This one triggers the error } ... } _mem_[read|write]_access_time and MEM_TIME_UNIT are constants defined elsewhere. I keep thinking that might be a bad pointer from elsewhere. But I can't think of anything. Quote Link to comment Share on other sites More sharing options...
kaiserhaz Posted January 6, 2016 Author Report Share Posted January 6, 2016 Kartik, you are right in fact. I had used a wait() in an SC_METHOD, but it wasn't in that module that I showed. It was due to the use of a mutex lock() statement in an SC_METHOD. Thanks. 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.