[Tinyos-host-mote-wg] [Tinyos-2.0wg] TOS2 tasks code size
Cory Sharp
cory at moteiv.com
Wed Oct 5 13:00:59 PDT 2005
One small thing that been bothering me is that TinyOS 2.x tasks
compile to slightly larger code than TinyOS 1.x tasks, but my
expectation is TOS2 tasks should take the same or less space. I can't
quite figure out where the space is going, and I wonder if anyone else
has any ideas as to what's causing the minor bloat.
I have a tos2sched library that lets me compile TinyOS 2.x tasks in an
otherwise TinyOS 1.x system. The TinyOS 1.x sched.c is masked out.
1) I observe that the TOS2 task scheduler appears to be nearly the
same about of C code as the TOS1 scheduler.
2) Using TOS1 post semantics, the TOS2 post always resturns true, so
there should be some amount of "if(post mytask() == FALSE)" branches
that are elided when compiled in a TinyOS 1.x application.
3) TOS2 functions are called directly in Scheduler.runNextTask(), not
by function pointer as in TOS1 tasks. This seems like it should be an
optimization opportunity for TOS2 tasks, not a penalty.
But, I compile exactly the same TinyOS 1.x application, one with TOS1
tasks, another with TOS2 tasks for a ~400 byte penalty:
With tos1 tasks and sched:
20334 bytes in ROM
724 bytes in RAM
With tos2 tasks and sched:
20740 bytes in ROM
746 bytes in RAM
Any thoughts?
Cory
_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg
More information about the Tinyos-host-mote-wg
mailing list