Jump to content
Sign in to follow this  
kaiserhaz

What could cause wait(sc_time, sc_time_unit) to generate runtime error?

Recommended Posts

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.

 

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×