5.8.3. Trace comparison script

The EtmCompare Perl script compares the decompressed trace with the converted EIS output, using the ETM programming information in the JTAGbsi and log.dsm_bst files, to verify that the trace is correct. It uses no modules. The command for invoking the trace comparison script is:

EtmCompare [options]

The EtmCompare script can take a large number of options. The options used in the validation process are:


Specifies data address tracing is enabled.


Specifies coprocessor register transfer tracing is enabled.


Specifies coprocessor register transfer tracing is enabled.

-PORT_SIZE <size>

Specifies the selected port width. This option is always required. <size> must be either 4, 8, or 16.

-trace <trace_file>

The name of the compressed trace file (default is log.etm).

-image <image_file>

The name of the memory image file (default is rom.hex).

-bstlog <log_file>

The name of the command log file produced by the BST (default is log.dsm_bst).

-eis <FileName>

The name of the EIS file (default is log.eis).

-c <coproc_map>

The name of the coprocessor map to pass to Decomp.pl. This file is necessary for the decompressor to successfully decompress traces involving coprocessor memory transfers (ARM instructions LDC, LDCL, STC, and STCL). It is not necessary if no external coprocessors are installed in the system (CP15 does not use these instructions).

-base <address>

Base address for image in rom.hex (default is 0). A common alternative is 0xFFFF0000, if HIVECS is in use.

-eistype <EisFormat>

The EIS format, which must be ARM7TDMI, ARM9TDMI, or ARM9x. ARM9x is the default and must be used for all ARM9 cores other than ARM9TDMI.

-arch <arch>

The architecture version (ARMV4T or ARMV5T).


This option is required if the test was run with the processor in big-endian mode and tracing is controlled using data comparators.

-tbtube <address>

Alternate tube address (default 0x03000000). EtmCompare looks for a write of control-D (0x04) to this location to signify the end of the test and terminate the comparison. This option is not necessary if you turn tracing off before the end of the test.

The following options are also available, but are not normally used:


Only run Decomp.pl and Convert.pl. Do not compare their outputs.


Do not run Decomp.pl.


Do not run Convert.pl.

The EtmCompare program invokes the Decomp and Convert programs automatically. This can be suppressed using -noDecomp and/or -noConvert. Example 5.4 shows a typical EtmCompare command line.

Example 5.4. Typical EtmCompare script usage

	-PORT_SIZE 16 -trace log.etm -image rom.hex -eis log.eis \
	-eistype ARM7TDMI -arch ARMV4T

Example 5.5 shows a typical output, obtained after running the command in Example 5.4.

Example 5.5. Typical EtmCompare output

EtmCompare: Revision $Revision: 2.15 $EtmCompare: Running Decomp.pl -PortSize 16 -arch ARMV4T -a -d -m log.etm rom.hexEtmCompare: Decomp return code = 0EtmCompare: Running Convert.pl -eis log.eis -unc log.eis_unc -eistype ARM7TDMIEtmCompare: Convert return code = 0EtmCompare: Comparing log.trc_unc and log.eis_unc ...EtmCompare: 0 error(s) found

As the number of options to be passed to EtmCompare can be quite large, EtmCompare looks for a plain text file named EtmCompare.cfg on startup. You can specify one command-line option per line. They are added to the beginning of the options passed on the command line. If you specify an option twice, in EtmCompare.cfg and on the command line, the command-line value is used. This allows you to save your default command line in EtmCompare.cfg and to override any selected nonstandard options on the command line.

Problems with EtmCompare

When you access areas of uninitialized memory, unknown values can be traced by the ETM. These unknown values are propagated through the ETM, but are converted to known values in the EtmMonitor module. This is because the Perl libraries used by the scripts cannot understand X values.The side effect of this is that EtmCompare can generate errors when comparing the decompressed trace with the converted EIS file. You can avoid these errors by ensuring that memory addresses are initialized before they are read.

Copyright © 2000, 2001 ARM Limited. All rights reserved.ARM DDI 0158D