I guess you meant that TOSSIM does handle the variables properly. The reason I was asking this question is that I have an existing piece of code that defines C type variables to maintain data structures in the implementation scope, and for slightly larger networks (~30 nodes), I was observing during simulation that some variables were getting overwritten by their default values. This could be a quirk in the code that I am trying to test out, but wanted to understand the dynamics of TOSSIM to be sure.
Thanks and regards,
Avinash
On 3/8/06, Philip Levis <[EMAIL PROTECTED]> wrote:
On Mar 7, 2006, at 7:49 PM, Avinash Sridharan wrote:
> Hi All,
> I have variables defined in an implementation section of the
> module (that is these variables are present for the whole scope of
> the implementation. How does TOSSIM handle these variables ? I do
> not have any timers in my code and it seems TOSSIM resets these
> variables. This code works well in a real scenario since I have
> tested them on micaz, but wanted to simulated a larger network on
> TOSSIM hence trying to simulate it on TOSSIM.
>
I don't understand what you're asking. If you define variables
outside of a component (e.g., in C), then TOSSIM does not handle them
properly. It basically works by making a module variable:
module X {...}
implementation {
uint8_t x;
...
}
into an array:
X$x[TOSSIM_MAX_NODES]
then when you're node 43 you access element 43 of the array.
TOSSIM also has an "init" call for returning all variables to the
boot state. This is so you can reboot motes in simulation. Normally
the boot sequence does this for you.
Phil
--
Phd Dept. of Electrical Engineering
University of Southern California
http://www-scf.usc.edu/~asridhar
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
