سؤال

In SystemC, there is a kind of notification called delta notification, which can be called in the following two methods.

event.notify(SC_ZERO_TIME);

or

event.notify(0, SC_NS);

It defines that in a delta notification call, processes sensitive to the event will run during the evaluation phase of the next delta cycle.

So, what's the so called "delta cycle"? Is it defined just like the clock cycle or a certain period of time?

هل كانت مفيدة؟

المحلول

The delta cycle is not clock cycle and no time having advanced. Delta cycle is used to simulate new updates and event triggered processes to be simulated from current execution phase of current time.

A brief simulation steps are as follows,

  1. evaluation phase: execute all schedule processes in current run queue
  2. update phase: update value and add new triggered runnable processes to waiting queue or queue of t + N.
  3. if the queue (t+0) is not empty, move queue (t+0) to run queue and go to step 1
  4. if waiting queue (t+0) is empty, advance time to closest time step, and move queue (t+X) to run queue and go to step 1
  5. if queue is empty, it means no event needs to be simulated, then simulation ends.

So if you are using delta notification, the event and its triggered processes are schedule to be run immediately after current execution & update phase. So when this time of execution phase has done, but it still has other schedule processes to be run at current time, it goes to evaluation phase again to run those processes, and no time has advanced due to the simulation is still in the same timestamp.

There is another terminology called immediate notification, which is calling notify() without any argument. Then the process will be immediately schedule to current queue of execution, not awaiting to next delta cycle.

نصائح أخرى

event.notify(SC_ZERO_TIME); or event.notify(0, SC_NS);

is called delayed notification. Processes waiting for a delayed notification(i.e. waiting on event) will execute only after all waiting processes have executed or in other words executes on the next delta-cycle (after an update phase).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top