amitk3553 Posted April 30, 2013 Report Posted April 30, 2013 Hello All, Following is the rule in LRM of systemC: An earlier notification will always override one scheduled to occur later, and an immediate notification is always earlier than any delta-cycle delayed or timed notification. There is an example: Process_A {my_event.notify();} Process_B {my_event.notify(SC_ZERO_TIME);} Process_C {wait(my_event);} Now two cases of execution are shown below: If process A executes first, then the event is triggered immediately, causing process C to be executed in the same delta-cycle. Then, process B is executed, and since the event was triggered immediately, there is no conflict and the second notification is accepted, causing process C to be executed again in the next delta-cycle. If, however, process B executes first, then the delta-cycle delayed notification is scheduled first. Then, process A executes and the immediate notification overrides the delta-cycle delayed notification, causing process C to be executed only once, in the current delta-cycle. So which is right one and how??? Regards Amit Kumar Quote
Philipp A Hartmann Posted April 30, 2013 Report Posted April 30, 2013 Amit, both cases are valid simulation runs, as the internal scheduling (i.e. the order, in which processes are evaluated) is implementation-defined. You need to ensure within your models, that there is no (implicit) dependency on any particluar ordering of processes within a single evaluation phase. Otherwise, you may see unexpected behaviour due to things like the event cancellation example, you quoted from the standard. Greetings from Oldenburg, Philipp Quote
dakupoto Posted May 3, 2013 Report Posted May 3, 2013 Dear Sir, As a general rule, it is not advisable to use 'wait() - notify()' pairs in complicated design examples. It is difficult for both the programmer and the runtime system to track all the events correctly. One would be far better off using implicit events via method sensitivity lists. Quote
Recommended Posts
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.