Quantcast
Channel: SystemC Language Forum RSS Feed
Viewing all articles
Browse latest Browse all 595

Undefined process control interaction: attempt to disable a thread with timeout wait:

$
0
0

Hi Experts

 

With the below programe, I have following error

 

Error: (E559) Undefined process control interaction: attempt to disable a thread with timeout wait: t.func2
In file: ../../../../systemc-2.3.0/src/sysc/kernel/sc_process.cpp:345
In process: t.func1 @ 5 ns
I am not able to figure out why ?

Can you please help

 

#include "systemc.h"

class test : public sc_module {
    public :
    SC_HAS_PROCESS(test);
    test(sc_module_name name){
        SC_THREAD(func1);
         func1_p = sc_get_current_process_handle();
        SC_THREAD(func2);
         func2_p = sc_get_current_process_handle();
    }
    sc_process_handle func1_p,func2_p;

    void func1(){
        for(;;){
            wait(5,SC_NS);
            func2_p.disable();
            wait(5,SC_NS);
            func2_p.enable();
        }
    }

    void func2(){
        for(;;){
            wait(10,SC_NS);
            cout<<sc_time_stamp().value()<<endl;
        }
    }
};

int sc_main(int, char*[]){
    test t("t");
    sc_start(SC_ZERO_TIME);
    sc_start();
    /*cout<<sc_time_stamp().value()<<endl;
    if(sc_get_status() == SC_PAUSED){sc_start(10,SC_NS);}
    cout<<sc_time_stamp().value()<<endl;*/
    return 0;
}


Viewing all articles
Browse latest Browse all 595

Trending Articles