
I am mystified by the relationship between Atom's `__global_clock' and the `scheduling_clock'. For example, here is some generated code: /* Includes omitted. */ static uint64_t __global_clock = 0; /* Subroutine declarations omitted. */ void main(void) { { static uint8_t __scheduling_clock = 0; if (__scheduling_clock == 0) { __r0(); /* main.set_up_pins */ __r1(); /* main.set_up_timer */ __scheduling_clock = 0; } else { __scheduling_clock = __scheduling_clock - 1; } } __global_clock = __global_clock + 1; } Looking at code generated by an older version of Atom, it seems like there used not be separate "global" and "scheduling" clocks: /* From http://code.sw17ch.com/blog/atom/blink_atom.c */ void blink_atom(void) { if (__clock % 1 == 0) { r0(); /* blink_atom.decrement */ } if (__clock % 2 == 0) { r1(); /* blink_atom.reset */ } if (__clock % 2 == 1) { r2(); /* blink_atom.flip */ } __clock = __clock + 1; } I would like to know how the `__global_clock' influences execution in the present system. -- Jason Dusek

On Sun, Jan 3, 2010 at 9:15 AM, Jason Dusek
I would like to know how the `__global_clock' influences execution in the present system.
As you observed, __global_clock is no longer used for rule scheduling. It is only there to provide a time reference. BTW, __global_clock is accessed via 'clock'.
participants (2)
-
Jason Dusek
-
Tom Hawkins