Jump to content

Recommended Posts

Posted

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,

 

Posted

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.

 

 

Posted

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.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...