Jump to content

Method sensitive with sc_inout port


worm&chicken

Recommended Posts

Dear all,

 

I have a problem when using sc_inout port as described in source file below.

When I using inout port in a module, a method to sensitive with this port also a thread to write to this port.

when the thread writes to inout port it also calls the method which is sensitive with this port.

Is it OK for my modeling mindset: this port is output when I do write, and i expected that the method will did not call?

Or did I get a mistake in somewhere?

//Sorry for my english if it difficult to understand.

main.cpp

Link to comment
Share on other sites

Your SC_THREAD has  no static sensitivity, but you call the signature `wait( void )`, which requires static sensitivity. Did you mean `wait(in1_InOut->changed_event())`?

You call SC_SIGNAL_MANY_WRITERS, which strongly suggests to mean that you don't understand sc_signal channel. Probably, you should be using sc_signal_resolved.

Link to comment
Share on other sites

On 10/24/2018 at 12:06 PM, Roman Popov said:

I don't quite understood what is your problem. I suggest you to run simulation and check if works as you expected. If it is not, try to reformulate a problem as "I expected (something), but I got (something else) in simulation".

 

5

I have any class Initiator and target. In initiator, I have a thread, a method  and a inout port,  method sensitive with that port and thread is used to write to this port.

In class Target, I have a method, that sensitive with inout port. In the top class. I instanced 2 class above and connected the inout port.

 

I expected that in initiator, when thread writes to inout port, i expected only method of target is call but both method of Initiator and Target was called.

 

 

Link to comment
Share on other sites

1 hour ago, worm&chicken said:

I expected that in initiator, when thread writes to inout port, i expected only method of target is call but both method of Initiator and Target was called.

In your code sample both Initiator and Target SC_METHODs are sensitive to value change event of signal. So when signal value changes, both of them are triggered. 

Why did you expect different outcome?

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