David,

What is the structure/implementation of Y such that not wiring
A.StdControl is not an error?  I figure you have some code in module Y
like

   command result_t StdControl.start() {
       call LowerControl.start();
   }

and some code in configuration Y like

   // Y.LowerControl -> A.StdControl;
   Y.LowerControl -> B.StdControl;

where you are testing uncommenting the commented line.  (As an
alternative, you may just have default implementations of LowerControl
in Y module.)

If it's something like that, then wiring in A.StdControl to Y actually
*does* add functionality -- invoking Y.StdControl now also invoked
A.StdControl.  Without that, and leaving component X out of your
application, A.StdControl may never be called -- a bug.  This is
exactly the "system library initialization problem" we occasionally
try to sort through in TinyOS.

The bloat probably comes in from the aggressive inlining, that the
body of A.StdControl probably appears twice instead of encapsulated as
a function.  That's most likely "misconfiguration" of command line
parameters in gcc (or outright bug).  Try compiling with CFLAGS=-Os,
though I seem to recall mspgcc creating questionable code for certain
optimization flags, and I don't recall if -Os is such a culprit.

Cory

On 5/8/06, David Moss <[EMAIL PROTECTED]> wrote:

I have an app that has three components.  Component A provides a set of
commands and no events, and is used by the other two.  The second component,
X, connects to A and wires up StdControl to it, etc.  A third component,
component Y does not wire up to A.  Compiling these three components
together into an app, the ROM size is 10598 bytes.

Then I do the same as before, but also wire up Y to A in Y's configuration,
so Y also connects StdControl to A.  No extra code is written, no
functionality was added.  Just the wiring.  Keep in mind that StdControl was
already wired up to A from X, and the only change now is StdControl is also
be wired up to A from Y.  Compiling these three components again, the ROM
size becomes 11022 bytes.  A 424 byte ROM difference, which is significant
because no functionality was changed or added.

Is it possible to make the compiler recognize that A is the same component
referred to by X and Y, and StdControl is the same interface?

Say I had 10 components like this that could all be compiled separately or
together to form a system or application - then the ROM size would increase
by a minimum of 4kB just from repetitive wiring, which I believe should have
been optimized out.


-David
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help




_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to