After Signal/Port binding, when signal changed, the sensitive list will cause SC_METHOD registered method to run.
When I'm implementing the SystemC version, I met this warning W571. To be honest, I think this warning is correct because there is no activity. But Why there is no activity where I thought there should be is the question.
The problem happens when call sc_start() the second time;
I suspect that the binding between signal/port is not handing well.
SC_MODULE ( MyClass )
{
SC_CTOR(MyClass)
{
SC_METHOD(eventListener);
dont_initialize();
sensitive << m_event;
}
void eventListener()
{
Event* event = m_event.read();
...
delete event;
}
}
int sc_main (int argc, char* argv[])
{
sc_signal<Event*> eventSubject;
MyClass context("CONTEXT");
context.m_event(eventSubject); //bind signal to port, m_event is the port
while(true)
{
getline(cin, in);
...
eventSubject = new Event();
sc_start();
}
}