Zahid, TOSSIM is a discrete event simulator, that is, tasks are assumed to execute instantaneously. Having a busy wait in your code will make no difference: you can spin as long as you wish in a loop, the simulated execution time of the task will still be zero. If you don't understand what the above means, make sure that you read the TOSSIM paper ( http://www.cs.berkeley.edu/~pal/pubs/nido.pdf ).
Because of this, there is no BusyWaitMicroC implementation for the sim target. What you try compiling in is for the avr target (with some avr assembly code inlined). Since this assembly code is not for the x86 target, the compiler complains. You have two options: - Use timers for waiting. This works well in TOSSIM, and not that hard to implement. - Use a cycle-accurate simulator (e.g. avrora). Be aware that this is much slower than TOSSIM. Janos On Mon, Apr 20, 2009 at 6:35 AM, zahid iqbal <[email protected]> wrote: > Hi, > > I am writing a simulation in TOSSIM under tinyos-2.1.0. > > In my application, I have to introduce some delays, in the order of > microseconds. I am using, > > BusyWait.nc > BusyWaitMicroC.nc > > Whenever I compile, I get the following error. > > /opt/tinyos-2.1.0/tos/platforms/micaz/BusyWaitMicroC.nc: In function > ‘BusyWaitMicroC$BusyWait$wait’: > /opt/tinyos-2.1.0/tos/platforms/micaz/BusyWaitMicroC.nc:40: error: > impossible constraint in ‘asm’ > > I don't understand this, since I am not much familiar with assembly coding. > Can this be because of using a wrong BusyWaitMicroC for my interface. Please > note: > > I use the following width and precision, > > uses interface BusyWait<TMicro, uint16_t>; > > I am simulating for micaz platform and hence I use "make micaz sim". It is > probably because of this reason, that my compiler picks BusyWaitMicroC from > /tos/platforms/micaz/BusyWaitMicroC.nc > > What can be the problem here, > > Any help will be much appreciated. > > Regards, > zahid iqbal > > > > > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
