Directives

A directive is initiated by a $ character, followed by a command. Directives are used to control various aspects of stimuli execution and logging.

The currently supported directives are listed in Table 1.

Table 1. Stimuli Directives

Directive

Arguments1

Description

$stimulate filename

Start reading of stimuli from a new file. The new file will be read in parallel with the current file. This is currently the only way of opening multiple stimuli files within a stimuli session.

$quit  

Close the current stimuli file. The remainder of the file will be discarded and the file is closed. (same as end of file)

$break  

Break program execution. Stimuli file(s) remain open and stimuli will be resumed when program execution is resumed.

$repeat number

Start a repeat loop, repeat number times until $endrep directive.

$endrep  

End of repeat loop.

$log IO-register mask

Set up for logging of a register. If mask is specified the log will only update when the bits in the mask change. The mask will be OR'ed with any previous mask for the same address. Logging will not start until $startlog directive is executed.

$unlog IO-register mask

Stop logging a register. If mask is specified only the bits in the mask will stop being logged.

$startlog filename writemode

Start logging to named file. writemode is optional, default mode is append.

Table 1. Log Writemodes
Type Description
a Append to file (default)
o Overwrite any existing file
$stoplog  

Stop logging.

$fuse address value
Set fuse byte at address to value. 2 Fuse addresses generally start at 0.
Table 2. AVR fuse adresses
Address Fuse byte
0 Fuse Low Byte
1 Fuse High Byte
2 Fuse Extended Byte
7 Lock Bit Byte
$reset type
Reset device. Possible reset types are listed below.
Table 3. Reset Types
Type Description
p Power on reset (POR)
e External reset (EXT)
b Brown out detection (BOD)
s Spike
$memload file segment nocheck
Load contents of file into memory. On AVR designs you can specify segment to select where to load the data. If you add nocheck to the end of the command any checksum errors in the file will be ignored.
Table 4. Memory Segments
Segment Description
s Data memory (default)
f Flash
e EEPROM
i IO
$memdump file adr size segment

Dump contents of memory to file, starting at adr and dumping size number of bytes. Optionally specify segment to select which memory to dump.

Table 5. Memory Segments
Segment Description
s Data memory (default)
f Flash
e EEPROM
i IO

A log entry is generated whenever a logged I/O register changes value for whatever reason. The log format is compatible with the stimuli format which means that log output can be used as stimuli input. The log file will consist of delay statements and assignments.

Note:

Relative paths is relative to the directory of the initial stimuli file

1

Multiple arguments are separated by space.

2

After fuse is changed, a power-on reset must be applied to make the change effective.

3

This command was introduced in Atmel Studio 6.1 SP2.

4

This command was introduced in Atmel Studio 6.2 SP1.