Fork me on GitHub
Go directly to main content

WSim / Worldsens simulator

A software-driven simulator for full platform estimations and debug

FAQ

About WSim

  1. What is WSim ?
  2. WSim is a full system emulator for micro-controller based platforms. WSim uses a emulation loop that is byte precise and cycle precise on instruction boundaries. This behaviour allows to debug and analyse application using the same firmware as the target platform. WSim currently support many Ti MSP430 micro-controller models as well Chipcon radio chips and several other devices.

  3. How much does it cost ?
  4. Nothing. WSim is under the Cecill and GNU GPL free software license agreement.

  5. Who/Why to contact ?
  6. If you have any remark, question or contribution to this simulator, do not hesitate to contact one of the developers. Inputs and feedback are more than welcome. In particular, do not hesitate to ask for additions in this FAQ or in the tutorials.

[ Back to Top ]

Using WSim

  1. How many nodes can I use in a WSim+WSNet simulation ?
  2. You can easily use 10 to 15 WSim nodes in a simulation on a reasonable machine. The CPU load will mainly depend on the wireless network activity you are simulating.

    Larger simulations can also be easily built using simulation distribution across several machines on a local network. The distributed parallel simulation technique used between WSim nodes and WSNet relies on multicast IP in order to be able to distribute the simulation on a set of machines. If you want to simulate a large number of nodes then you should dedicate a processor to the WSNet program as it will be the central synchronisation point for all nodes and thus be on the critical path concerning performance issues.

  3. Can I use WSim for TinyOS applications ?
  4. WSim is independant of any operating system. You can use TinyOS, MantisOS, FreeRTOS, Contiki or any embedded OS with WSim. Please see the TinyOS/Wsim tutorial.

  5. How can I debug my application using WSim ?
  6. One of the main use of WSim is made during the debugging phase of an application. If you need to get more detailed information on the hardware events generated by your software you should switch on debugging information in the source code and recompile WSim.

    The main entry point for logs and debug information can be found in liblogger/logger.h This file is the main entry for debugging. Each model in WSim has then its internal debug message filtering system. For the MSP430 the file to look for is arch/msp430/msp430_debug.h If you have any specific needs or are looking for special information on hardware events that could help you debug your application the best is to post on wsim-user

  7. What is the meaning of the message "block not implemented" ?
  8. This message means that a hardware part of the simulation platform is not yet done or finished. Most of the work on emulation is done on request and user needs, please fill a feature request on the tracker or contact the mailing-list. We are of course also welcome to submit a patch if you have time to implement the missing parts.

  9. I get a behaviour mismatch between simulation and real target. What should I do ?
  10. Well, simulation is not perfect all the time. If you find such behaviour mismatch then please provide us with a small example on how to reproduce the error on the user mailing-list mailing list. Simulation mismatch can often be dealt with in a few days.

[ Back to Top ]

Tools

  1. How can I compare easily two or more traces coming from different nodes ?
  2. You have to use the --merge option in wtracer. This option synchronises all the different traces so that events can be compared in time. The --merge option can be seen here on TinyOS traces.

[ Back to Top ]

Troubles

  1. I get a multicast error when trying to use WSim + WSNet. What goes wrong ?
  2. If you are not connected to internet you may need to add a route as following :

    $route add -net 224.0.0.0 netmask 255.0.0.0 lo

  3. Why does WConsole display several times the same data ?
  4. It is a normal behaviour due to backtrack mechanism : nodes synchronisation is performed by rendez-vous. If an event happen before next rendez-vous, a new appointment will be set and nodes will backtrack to last synchronisation point. The program after the synchronisation point is going to be executed, resulting in a double (or more) display on WConsole.

    Nevertheless an option has been added to fix this trouble. The serial output is buffered and sent only when reaching a synchronisation point. This patch introduces a small lag in serial output, but same data is sent only once.

    You can change the behaviour by using a command line argument --serial1_io=bk:[arg] instead of --serial1_io=[arg]

  5. Netcat does not work and WSim displays the error message "wsim:libselect:update: error on descriptor (id=0:6) type UDP"
  6. You probably used the netcat-openbsd package which is the default one on Ubuntu and some other distributions. In order to use the examples and demo.sh scripts please change nc (NetCat) to the netcat-traditional package.

    You can keep both netcat-openbsd and netcat-traditional installed on your system if you need to. The two binaries are called "nc" (openbsd version) and "nc.traditional". Most demo.sh script are testing for the presence of nc.traditional before falling back to "nc".

[ Back to Top ]