Tracing Modes

By default, the simulator does not produce any output when it is running a program. However, command line options are provided that allow status information about the progress of the simulation to be printed out while it is executing.


Trace Monitor

The first and most primitive option is to specify -monitors=trace which will print out each instruction as it is executed, as well as the total number of instructions executed when the simulation terminates. For more information on the trace monitor, see the online help.

% avrora -monitors=trace 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.905 seconds]
=={ Simulation events }=======================================================
Node          Time   Event
------------------------------------------------------------------------------
   0             0  0000: jmp 70
   0             3  008C: eor r1, r1
   0             4  008E: out 63, r1
   0             5  0090: ldi r28, 255
   0             6  0092: ldi r29, 16
   0             7  0094: out 62, r29
   0             8  0096: out 61, r28
   0             9  0098: ldi r17, 1
   0            10  009A: ldi r26, 0
   0            11  009C: ldi r27, 1
   0            12  009E: ldi r30, 0
   0            13  00A0: ldi r31, 1
   0            14  00A2: ldi r16, 0
   0            15  00A4: out 59, r16
   0            16  00A6: rjmp 2
   0            18  00AC: cpi r26, 2
   0            19  00AE: cpc r27, r17
   0            20  00B0: brne -5
   0            22  00A8: elpmpi r0, Z
   0            25  00AA: stpi X, r0
   0            27  00AC: cpi r26, 2
   0            28  00AE: cpc r27, r17
   0            29  00B0: brne -5
   0            31  00A8: elpmpi r0, Z
   0            34  00AA: stpi X, r0
   0            36  00AC: cpi r26, 2
   0            37  00AE: cpc r27, r17
   0            38  00B0: brne -5
   0            39  00B2: ldi r17, 1
   0            40  00B4: ldi r26, 2
   0            41  00B6: ldi r27, 1
   0            42  00B8: rjmp 1
   0            44  00BC: cpi r26, 2
   0            45  00BE: cpc r27, r17
   0            46  00C0: brne -4
   0            47  00C2: jmp 101
   0            50  00CA: ldi r28, 255
   0            51  00CC: ldi r29, 16
   0            52  00CE: out 62, r29
   0            53  00D0: out 61, r28
   0            54  00D2: ldi r28, 4
   0            55  00D4: ldi r29, 0
   0            56  00D6: call 120
   0            60  00F0: lds r25, 257
   0            62  00F4: ldi r24, 13
   0            63  00F6: muls r25, r24
   0            65  00F8: movw r24, r0
   0            66  00FA: eor r1, r1
   0            67  00FC: ret 
   0            71  00DA: sts 257, r24
   0            73  00DE: sbiw r28, 1
   0            75  00E0: sbrs r29, 7
   0            76  00E2: rjmp -7
   0            78  00D6: call 120
   0            82  00F0: lds r25, 257
   0            84  00F4: ldi r24, 13
   0            85  00F6: muls r25, r24
   0            87  00F8: movw r24, r0
   0            88  00FA: eor r1, r1
   0            89  00FC: ret 
   0            93  00DA: sts 257, r24
   0            95  00DE: sbiw r28, 1
   0            97  00E0: sbrs r29, 7
   0            98  00E2: rjmp -7
   0           100  00D6: call 120
   0           104  00F0: lds r25, 257
   0           106  00F4: ldi r24, 13
   0           107  00F6: muls r25, r24
   0           109  00F8: movw r24, r0
   0           110  00FA: eor r1, r1
   0           111  00FC: ret 
   0           115  00DA: sts 257, r24
   0           117  00DE: sbiw r28, 1
   0           119  00E0: sbrs r29, 7
   0           120  00E2: rjmp -7
   0           122  00D6: call 120
   0           126  00F0: lds r25, 257
   0           128  00F4: ldi r24, 13
   0           129  00F6: muls r25, r24
   0           131  00F8: movw r24, r0
   0           132  00FA: eor r1, r1
   0           133  00FC: ret 
   0           137  00DA: sts 257, r24
   0           139  00DE: sbiw r28, 1
   0           141  00E0: sbrs r29, 7
   0           142  00E2: rjmp -7
   0           144  00D6: call 120
   0           148  00F0: lds r25, 257
   0           150  00F4: ldi r24, 13
   0           151  00F6: muls r25, r24
   0           153  00F8: movw r24, r0
   0           154  00FA: eor r1, r1
   0           155  00FC: ret 
   0           159  00DA: sts 257, r24
   0           161  00DE: sbiw r28, 1
   0           163  00E0: sbrs r29, 7
   0           165  00E4: break 
==============================================================================
Simulated time: 166 cycles
Time for simulation: 0.543 seconds
Total throughput: 3.0570902E-4 mhz
=={ Monitors for node 0 }=====================================================
Instructions executed: 97 
Program throughput: 0.58433735 instrs/cycle
Program throughput: 4.674699 mips
% _


Call Monitor

Tracing the program's execution instruction by instruction is likely to generate a lot of output that is not very useful. A better approach is to use the -monitors=calls option that will print out the call and return behavior (including interrupts) of the program as it executes. For more information on the calls monitor, see the online help.

% avrora -monitors=calls 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.883 seconds]
=={ Simulation events }=======================================================
Node          Time   Event
------------------------------------------------------------------------------
   0            60   @ 0x00D6 --(CALL)-> foo
   0            71   @ 0x00DA <-(RET)-- 
   0            82   @ 0x00D6 --(CALL)-> foo
   0            93   @ 0x00DA <-(RET)-- 
   0           104   @ 0x00D6 --(CALL)-> foo
   0           115   @ 0x00DA <-(RET)-- 
   0           126   @ 0x00D6 --(CALL)-> foo
   0           137   @ 0x00DA <-(RET)-- 
   0           148   @ 0x00D6 --(CALL)-> foo
   0           159   @ 0x00DA <-(RET)-- 
==============================================================================
Simulated time: 166 cycles
Time for simulation: 0.492 seconds
Total throughput: 3.3739838E-4 mhz
=={ Monitors for node 0 }=====================================================
Maximum stack depth: 1 frames
% _


Verbose Modes

For more detailed information, relating to various parts of simulation, such as devices, interrupts, or events, the -verbose option enables the printing of diagnostic messages from the simulator and attached devices, as well as other parts of Avrora. To enable a list of verbose "channels", simply specify them as a comma-separated list to the -verbose option.

Some examples of verbose channels are:

  • loader -- parsing and loading of programs.
  • sim.event -- event queue of simulator.
  • sim.global -- global clock for multi-node simulation.
  • atmel.adc -- ADC (analog to digital) converter unit on Atmel models.
  • atmel.spi -- SPI (serial peripheral interface) on Atmel models.
  • atmel.eeprom -- EEPROM on Atmel models.
  • atmel.flash -- Reprogrammable flash on Atmel models.
  • atmel.timer0 -- Timer0 on Atmel models.
  • atmel.timer1 -- Timer1 on Atmel models.
  • atmel.timer2 -- Timer2 on Atmel models.
  • atmel.timer3 -- Timer3 on Atmel models.
  • atmel.usart0 -- USART0 on Atmel models.
  • atmel.usart1 -- USART1 on Atmel models.
  • atmel.usart.printer -- data sent and received over serial line.
  • mcu.pin -- external pin configurations and activity on Atmel models.
  • radio.cc1000 -- CC1000 radio on mica2 platform.
  • radio.cc1000.data -- CC1000 radio data transmitted.
  • radio.cc1000.pinconfig -- CC1000 configuration.

Verbose channels are created dynamically in Avrora, so unfortunately there is no one command to list all possible verbose channels. However, in order to get a list of the various verbose channels that can be enabled for the run that you are interested in, specify -verbose=verbose, and the verbose system will report every verbose channel registered. To enable all verbose printing, specify -verbose=all. Multiple channels can be specified with one command line argument. For example, -verbose=sim.event,sim.interrupt.

Beginning with Avrora Beta 1.4.0, printers associated with simulation now print the node ID (a unique integer) and the time in clock cycles when the event being reported happens. This helps in debugging time issues, and keeping track of what node performs what event in sensor network simulations.

Note: Verbose modes are being phased out of Avrora in favor of more powerful and extensible monitoring techniques and as the codebase matures.


Monitors

For more complicated forms of monitoring, see the page on monitoring.





[ 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.