1.2.2.3.3 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-2.

Table 1-2. 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. (The same as reaching the end of the 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 a repeat loop

$log IO-register mask

Set up register logging. 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 register logging. If mask is specified, only the bits in the mask will stop being logged.

$startlog filename writemode

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

Table 1-3. Log Writemodes
TypeDescription
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.
$reset type
Reset device. Possible reset types are listed below.
Table 1-4. Reset Types
TypeDescription
p Power on reset (POR)
e External reset (EXT)
b Brown-out detection (BOD)
s Spike (AVR XMEGA only, similar to external reset)
$memload file segment nocheck
Load the contents of file into the 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 1-5. Memory Segments
SegmentDescription
s Data memory (default)
f Flash
e EEPROM
i I/O
$memdump file adr size segment

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

Table 1-6. Memory Segments
SegmentDescription
s Data memory (default)
f Flash
e EEPROM
i I/O

A log entry is generated whenever a logged I/O register changes the 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 are relative to the directory of the initial stimuli file.

1

Multiple arguments are separated by space.

2

After the 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.