Nexus realtime Program Trace data can be produced while running an executable on a processor supporting the needed combination of Nexus capabilites. Such data can be processed by |gcp| in two steps:
Currently, the freescale MPC5634M SOC is supported as a source of Nexus data, using iSystem tools to interface with the processor and to produce a file containing Nexus data.
The iSystem winIDEA software can be used to control program loading and execution on target 5634 hardware, and, through the Analyzer tool, to configure and execute Program Trace data collection and output. winIDEA is a GUI, and the information in this section describes the user interaction with the GUI. winIDEA APIs are provided for several languages (including Python and C++), and these are useful when not working in interactive mode.
winIDEA runs on a host computer that is connected via USB to iSystem hardware (the "Blue Box"), which in turn is connected to a Mictor connector on the target 5634 processor through a Nexus cable.
While the program and analyzer are running, Program Trace data and other Nexus data are sent over the processor's Nexus interface to the Blue Box, where it is annotated and buffered. (The buffering is shared between memory on the Blue Box and resources on the host computer; this affects how to configure the Analyzer).
The Analyzer can stop as a result of any of several conditions; e.g. when the program halts upon encountering a breakpoint, or when some condition set in the Analyzer configuration is met.
Once the Analyzer has stopped, it should not be used to collect additional data in the
same buffer (the trace data will be inaccurate if there are gaps in its collection).
The Nexus data collected can be written to a file suitable for |gcvcnv| using the Analyzer's
export
function.
The 5634 hardware supplies two options for controlling when Nexus Program Trace Data is output while the CPU is running:
A bit in a control register in the Nexus Module
When this bit is set, Nexus data will be produced whenever the CPU is running.
Watchpoint triggers
If the control register bit is not set, Watchpoint Triggers may be used to generate trace data. Not all of the functionality of Watchpoint Triggers is supported by |gcp|, but what is used is built around the four Instruction Address Compare registers on the 5634 (IAC1 - IAC4). These registers can be used to cause watchpoint events when the PC attains specified values. In the basic usage, an address is set in one of the IAC registers and a watchpoint occurs when the PC matches the value set in the IAC. In the Nexus module, an IAC watchpoint event can be set to
start
or tostop
the production of Nexus Program Trace messages.
The Watchpoint Triggers functionality of the 5634 is the (only) option supported by |gcp|. The Analyzer must be configured accordingly, and options to the |gcvcnv| command reflect the trigger settings that were set by the Analyzer when the trace data was collected:
- the IAC that was used for the
start
trigger,- the address that was in the
start
trigger IAC,- the IAC used for the
stop
trigger.
The address in the stop
trigger is not needed, and the stop
trigger can be omitted completely.
Here are two examples:
- A program continually runs a loop where it receives a command and dispatches based on that command. The command input is implemented as a busy loop. To prevent a very large output of useless data from the busy loop, IAC1 is used as the
start
trigger, with the address set to the end of the busy loop, and IAC2 is set as thestop
trigger, with its contents set to the beginning of the busy loop.- For coverage from unit testing, small programs are run to completion. In this scenario,
start
can be set at the entry point formain
. Nostop
trigger is needed, since a breakpoint is set upon exit frommain
.
In the GUI, the hammer with a sheet of paper icon brings up the Analyzer Configuration List
dialog,
and the hammer plus Trace icon brings up the Analyzer Configuration
dialog. The following steps will
create a configuration that will be applicable across a wide range of test execution scenarios:
Open the
Analyzer Configuration List
dialog, choose New->Trace and choose a name for your configuration. This will bring up a trigger configuration window.The first,
Recorder
tab is used to set values for four properites (click on the initial values for the first three to see that they are drop down lists). ForStart
,Buffer Size
andTrigger Position
chooseImmediately
,1 GB
(+/-) andBegin
. Do not checkBreak On Trigger
.Select the
MP5634M
tab, and checkEnabled
. IAC1 and IAC2 will be used for thestart
andstop
triggers; check them and enter addresses. In theRecord
box, onlyProgram
should be selected, and forStart
andStop
, IAC1 and IAC2 should be chosen.Type
needs to beIndividual Branch Messages
, and Watchpoints should beAll
. ClickOK
.Note: The address set for the Start Trigger should not contain a branch instruction, since such a trigger may cause the Analyzer to lose the context for interpreting some Nexus messages. |gcvcnv| will generate an error message when it is passed a start trigger address for a branch instruction.
Back at the
Analyzer Configuration
window, the new configurataion will be shown to be the active one with a red arrow on the left. Check bothStart Analyzer when CPU starts
andStop Analyzer when CPU stops
. The first is a minor convenience, making it unnecessary to explicitly start the Analyzer before performing thestart
from winIDEA.
To set the relevant arguments for the export
command (whose icon looks like a diskette with a
green arrow):
- In the window that pops up for
export
, specify the file desired and chooseBinary
from the dropdown list forFormat
;- Select
Options...
, and in the resulting window, choose onlyOn Chip Data
;- In the
export
window chooseEntire Session
for theTime Scope
;- Clicking
OK
will write the file; this may take a long time for large trace collections.