SystemC events communication between modules

Status
Not open for further replies.

kennyruffles

Newbie level 2
Joined
May 17, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,304
My doubt is about the communication between modules using events on systemc language.
In the book SystemC: from the Ground up there is a chapter named The interrupt, a custom Primitive Channel, with the sample code below that do that:

------------------------------------------------------------------------

class eslx_interrupt_gen_if: public sc_interface {
public:
virtual void notify() = 0;
virtual void notify(sc_time t) = 0;
};

------------------------------------------------------------------------


class eslx_interrupt_evt_if: public sc_interface {
public:
virtual const sc_event& default_event() const = 0;
};


------------------------------------------------------------------------
#include "eslx_interrupt_evt_if.h"
#include "eslx_interrupt_gen_if.h"
class eslx_interrupt
: public sc_prim_channel
, public eslx_interrupt_evt_if
, public eslx_interrupt_gen_if
{
public:
// Constructors
explicit eslx_interrupt()
:sc_prim_channel(
sc_gen_unique_name("eslx_interrupt"))
{}//end constructor
explicit eslx_interrupt(sc_module_name nm)
:sc_prim_channel(nm)
{} //end constructor
// Methods
void notify() { m_interrupt.notify(); }
void notify(sc_time t) { m_interrupt.notify(t); }
const sc_event& default_event() const
{ return m_interrupt; }
private:
sc_event m_interrupt;
// Copy constructor so compiler won't create one
eslx_interrupt( const eslx_interrupt& rhs)
{} //end copy constructor
};




My question is: how can i use this code? I tried a declaration like sc_in<eslx_interrupt> port_event;
So i'll be very thankful for your help.

ps: I'm sorry for my bad english.
 
Last edited:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…