Jump to content

Methods and Threads in same module


ashwathgan

Recommended Posts

Hi all I was trying something like:

 

 

SC_MODULE(A)

{

 

sc_out<bool> outP;

bool var = false;

 

 void procc1()

{

outP.write(true);

var = true;

}

 

void procc2()

{

while(some_condition)

{

if(var) { print something}

wait(SC_ZER_TIME);

}

}

constructor

};

 

and I have another module which recives the output like:

SC_MODULE(B )

{

sc_in<>bool> inP;

 

void procs3()

{

if(inP.read())

{

print something

}}

constructor

};

 

 

 

I elaborated in the order with A being instantated first and B being instantiated second. Hence, I could see the procc1() starting first. but what I then saw was that the thread procc2() was not executed, rather the procc3() from the module B was executed and then after that only procc2() got executyed. Is there any reason why the thread was ignored to be executed in the first place?

 

 

 

 

 

Thanks

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...