Getting Started with Avrora
Trying out Avrora is quick and easy for any platform! See the steps below
for steps to get started with the basic capabilities of Avrora.
Step 0: Get Java!
Avrora is implemented in Java, and therefore it requires that you have a
functional Java Virtual Machine installed. Once the JVM is installed and you
are able to run java at the command line,
you're ready to continue to the next step.
Freely available Java Virtual Machine implementations are available from
both Sun Microsystems and IBM.
Avrora is not dependent on the particular Java implementation that you choose.
Step 1: Download the JAR Archive
The Java platform allows applications to be bundled into compressed
archives called JARs that require minimal effort to download and use.
Applications can be run directly from a JAR file, requiring no compilation,
installation, or configuration steps. The first step to trying out Avrora is
to download the latest JAR archive release. Simply
save the JAR file to your disk, and you are ready to run.
Step 2: Format Your Program Appropriately
Avrora supports three types of program formats:
- The Atmel assembler syntax. Files that end with the
.asm extension are assumed to be in this format.
Files in this format can be loaded directly by Avrora.
- The GNU assembler (GAS) syntax. Files that end with the
.s extension are assumed to be in this format.
- The output of the avr-objdump utility.
Files that end with the .od extension are assumed
to be in this format. Avrora cannot directly load ELF or SREC images, therefore
binary programs in those formats must be converted to a textual format with
avr-objdump. For more information, see the
page on objdump.
Here are a couple of example programs that can you download and try out:
- simple.c -- very simple C program source.
- simple.od -- C program converted to objdump format.
- blink.od -- a TinyOS program compiled to the ELF format and
disassembled with avr-objdump.
Step 3: Running Avrora
Avrora is based on a command-line interface. To invoke Avrora, you need only run
the java command and use the -jar
option to specify the location of the Avrora JAR file. Running avrora with no options
will print out the built-in help. You should make an alias to avrora
such as:
% alias avrora='java -jar avrora-beta-1.6.0.jar'
|
Now, let's use Avrora to execute one of the example programs. Download
simple.od and execute it on Avrora.
% avrora simple.od
Avrora [Beta 1.6.0] - (c) 2003-2005 UCLA Compilers Group
This simulator and analysis tool is provided with absolutely no warranty,
either expressed or implied. It is provided to you with the hope that it be
useful for evaluation of and experimentation with microcontroller and sensor
network programs. For more information about the license that this software is
provided to you under, specify the "license" option.
Loading simple.od...[OK: 0.928 seconds]
=={ Simulation events }=======================================================
Node Time Event
------------------------------------------------------------------------------
==============================================================================
Simulated time: 166 cycles
Time for simulation: 0.475 seconds
Total throughput: 3.4947367E-4 mhz
% _
|
- If Avrora's colored output causes problems with your terminal, you can
disable terminal colors by specifying the -colors=false option.
You can also specify the -foreground-color=black or
-light-background options.
- Avrora's banner is printed by default every time Avrora is invoked. To turn it
off, specify -banner=false.
Now, let's try running the blink.od file.
This is a dump of the Blink TinyOS
program which toggles the red LED once a second. Notice that we to specify
the mica2 platform so that the hardware devices,
including the LEDs are appropriately configured and connected.
% avrora -platform=mica2 -seconds=5.0 blink.od
Avrora [Beta 1.6.0] - (c) 2003-2005 UCLA Compilers Group
This simulator and analysis tool is provided with absolutely no warranty,
either expressed or implied. It is provided to you with the hope that it be
useful for evaluation of and experimentation with microcontroller and sensor
network programs. For more information about the license that this software is
provided to you under, specify the "license" option.
Loading blink.od...[OK: 1.082 seconds]
=={ Simulation events }=======================================================
Node Time Event
------------------------------------------------------------------------------
0 318 Red: on
0 320 Yellow: on
0 322 Green: on
0 364 Red: off
0 366 Yellow: off
0 368 Green: off
0 7208139 Red: on
0 14408142 Red: off
0 21608143 Red: on
0 28808142 Red: off
0 36008143 Red: on
==============================================================================
Simulated time: 36864000 cycles
Time for simulation: 0.812 seconds
Total throughput: 45.399014 mhz
% _
|
- The simulation output comes out must faster than real-time in the case of Blink,
since the simulator optimizes periods of sleep. To reduce the speed of the simulator
to no more than real-time speed, specify the -real-time option.
For more information about how to use the simulator effectively, go to
the page about simulation.
Learning More Tricks: Avrora Actions
Avrora is designed so that it is given a program as input and an option
to select what action should performed on the program. This option is
-action, and its default value is
simulate. Actions can do many things, from
analyzing the program, executing the program, diagramming the program, etc.
For more information on the available actions, you can view the
online help or learn how to
extend Avrora with your own actions.
You can access the help for a specific action by specifying the
-help option followed by the name of
the action. For example, to get the help for the simulate
action, you can see this page.
[
Home |
Download |
Get Started |
Online CVS |
JavaDoc API ]
Copyright (c) 2004-2005, UCLA Compilers Group
The Avrora logo background is Copyright (c) 1996 Jan Curtis, used with permission.
|