Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Haskell-cafe] Atom's `__global_clock' and `__scheduling_clock'.

0 views
Skip to first unread message

Jason Dusek

unread,
Jan 3, 2010, 3:23:38 AM1/3/10
to haskell
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
_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Tom Hawkins

unread,
Jan 3, 2010, 11:13:44 AM1/3/10
to haskell
On Sun, Jan 3, 2010 at 9:15 AM, Jason Dusek <jason...@gmail.com> wrote:
>
> �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'.

0 new messages