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 comment
Share on other sites

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...