In SystemC, what is the syntax to use events as module input/outputs.
I have a worker module and I want to send it an event to preempt what it's currently doing from a scheduler module.
sc_port<preempt_event_if> preempt_event;
I'm declaring an interface within the worker module shown above.
The interface is defined as the following:
class preempt_event_if : virtual public sc_interface
{
public:
virtual const sc_event& preempt_event() const = 0;
};
The channel which uses the event defines it as the following:
const sc_event& preempt_event() const { return preempt_interrupt; }
Which where preempt_interrupt
is a SystemC event that gets notified from within the channel's functions.