Jump to content

Error: (E519) wait() is only allowed in SC_THREADs and SC_CTHREADs

Recommended Posts

Hello everyone,


I have a runtime error when trying to simulate the top level of a system containing 2 sc_threads.

An example of my code architecture is presented hereunder, do you see any problem?

Here is my error :

Error: (E519) wait() is only allowed in SC_THREADs and SC_CTHREADs:
        in SC_METHODs use next_trigger() instead
In file: ../../../../src/sysc/kernel/sc_wait.cpp:166
In process: Test_top.th1.Thread_test @ 0 s


#include "Test_top.h"

int sc_main(int argc, char* argv[]) {
    Test_top topLevel("topLevel");
    sc_start(70, SC_NS);


#include <systemc>
#include "Thread.h"
class Test_top {


#include "Test_top.h"
    Thread th1("th1");
    Thread th2("th2");


#include <systemc>
SC_MODULE (Thread){
    void Thread_test();
    Thread(sc_module_name instanceName) :


#include "Thread.h"
void Thread::Thread_test(){

Thank you for your comments!


Share this post

Link to post
Share on other sites



I had no problems running your code (with SystemC 2.3.0). 

Only compiler errors: 

Test_top topLevel("topLevel");

This constructor doesn't exist. 

After fixing this, the example ran without errors.


But there is a big problem in your code: You declare the two 'Thread' instances as local variables in the Test_top constructor. Since they are local variables, they will be created in the constructor and destroyed when the constructor exits. Hence, when you start the simulation, no SC_MODULE is available anymore. In older SystemC releases, this may lead to the observed error because of some internal clean up issues. 




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