Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - Re: [help_forum] exception from systemc sensitivity list Message Thread: Previous | Next
  • To: Sundeep Singh <singh.sundeep@xxxxxxxxx>
  • From: Sureshkumar Vemuri <suresh@xxxxxxxxxx>
  • Date: Thu, 30 Jun 2011 10:19:10 +0530
  • Cc: systemc-forum@xxxxxxxxxxxxxxxxx, community_forum@xxxxxxxxxxxxxxxxx, help_forum@xxxxxxxxxxxxxxxxx
Send Email to systemc-forum@lists.systemc.org:
Send new message
Reply to this message
Hi Sundeep,

The exception may be due to some other reason like the event or the A module instance pointed by A_ptr being deleted or pointing to garbage or something like that. Otherwise, what you have done is not wrong. I tried similar small program and it worked which is attached.

This may not be the recommended way to synchronize between modules A and B if that is the intent. Better way may be to have a signal connected between the two i.e. A sc_out port and B sc_in port, and A writing to out port generating event, and B's method sensitive to its in port. Suggestion may not be correct or too trivial as I do not know the context in which event is generated and who generates it. 

Definitely, in your case, you need to have the A_ptr, pointer to A module, being maintained in B module,  which can be done away with if you use signals and ports for inter-process communication.

Regards,
Suresh

On Thu, Jun 30, 2011 at 6:20 AM, Sundeep Singh <singh.sundeep@xxxxxxxxx> wrote:
Hi,

I am getting a construction time error because I have made a module's method sensitive to an event from other module. Why is this incorrect?
E.g.

SC_MODULE(A)
{
   public:
   ....
   sc_event a_event;
   ....
};

SC_MODULE(B)
{
   public:
   void method_b();
   SC_METHOD(method_b);
   sensitive << A_ptr->a_event;  ///I get an exception here
   ...
};

I just don't understand why is the above incorrect. Any help is appreciated!

Thanks,
Sundeep.





--
----------------------------------------------------------------
V. Sureshkumar
Director,
Kasura Technologies Pvt Ltd
Mobile: +91-9901175757

Attachment: main.cpp
Description: Text Data


By Date: Previous | Next Current Thread By Thread: Previous | Next