On Oct 14, 2008, at 4:53 AM, Mustafa Hammad wrote:

> Good morning,
>
> I am studying tasks execution time in TinyOS 1.x with mica2 platform.
> I have implemented a command that read the HW counter (TCNT0) by  
> using clock interface. The default counter scale is 1024 ticks/ 
> second. I changed this scale to be 32768 ticks/second to get more  
> accurate measurements.
>
> Task code is instrumented to be something like this:
>
> task void processing()
> {
>     start_at = call ReadHWcounter();
>     …..
>     …..
>     end_at = call ReadHWcounter();
> }
>
> The different between these two variables present the task execution  
> time. Each cycle is equivalent to about 33 microseconds.
>
> I used the avrora simulator to verify my measurements which showed  
> that there are some differences. For example, a task which toggle  
> the three LEDs 30 times takes 10 counter cycles (i.e. about 0.00033  
> second). But in avrora simulator it takes about 0.000982 second.
>
> I don’t know what I am missing?
> Is there any other way to verify my measurements?
>
> Thanks in advance,
> Mustafa
>

The fifth paragraph of the TOSSIM manual:

Time: While TOSSIM precisely times interrupts (allowing things like  
bit-level radio simulation), it
does not model execution time. From TOSSIM’s perspective, a piece of  
code runs instantaneously.
Time is kept at a 4MHz granularity (the CPU clock rate of the rene and  
mica platforms). This also
means that spin locks or task spin locks will never exit: as the code  
runs instantaneously, the event
that would allow the spin to stop will not occur until the code  
completes (never).

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

Reply via email to