worm&chicken Posted October 24, 2018 Report Share Posted October 24, 2018 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 Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted October 24, 2018 Report Share Posted October 24, 2018 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". Quote Link to comment Share on other sites More sharing options...
David Black Posted October 24, 2018 Report Share Posted October 24, 2018 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. Quote Link to comment Share on other sites More sharing options...
worm&chicken Posted October 29, 2018 Author Report Share Posted October 29, 2018 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. Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted October 29, 2018 Report Share Posted October 29, 2018 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.