Jump to content

sensitive list for customized sc_channel


labrota

Recommended Posts

I implemented the customized sc_channel 

struct T {

sc_uint<2> a;

sc_uint<2> b;

};


class write_me : virtual public sc_interface {
   public:
     virtual void write(T &d) = 0;
};
class read_me : virtual public sc_interface {
   public:
     virtual T read() = 0;
};


class channel_me : public sc_channel, public write_me, public read_me {
   public:
     channel_me (sc_module_name name) : sc_channel(name) {}

     void write(T &d) {data = d;}

     T read(){ return T(data);}

   private:
     T data;
};
 

in my module, I have one SC_METHOD(comb) as below

sc_port<read_me> rd;

sc_signal< sc_uint<2> > s_a;

sc_signal< sc_uint<2> > s_b;

void comb() {

s_a.write( rd.read().a);

s_b.write(rd.read().b);

}

 

But then there is one such warning. I understand it is complaining "sensitive << rd;" but there is no sensitive list for rd. 

Is there any one who has better suggestions?

Warning: (W116) channel doesn't have a default event 

 

In addition, I think my aim is to implement the same thing in the thread https://forums.accellera.org/topic/5956-why-there-is-no-standard-interface-class-in-systemc/

Please do suggest what can be a better coding style. 

 

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