User guide
Nios II IDE Help System
Viewing Execution Trace
The Nios II IDE provides methods to trace code execution for Nios II hardware and Nios II
instruction set simulator (ISS) targets during debug sessions. Trace methods display a
sequential list of the instructions executed prior to the processor suspending.
When debugging a program on a Nios II hardware target, the Trace view in the Debug
perspective displays the exact execution trace of the program running in hardware. The Nios II
trace preferences affect how the Trace view collects and displays data.
When debugging a program on a ISS target, the ISS can display execution trace in the
Console view, or you can optionally redirect the output to a file. The ISS trace preferences
affect how the ISS collects and displays data.
To view trace data for Nios II hardware targets:
1. Start a debug session with a Nios II hardware target. Code displays in the Debug
perspective and processor execution suspends.
2. On the Window menu, point to Show View, and then click Trace. The Trace view
appears.
3. Continue your debug session. The Trace view automatically displays trace data for
the most recently executed instructions whenever processor execution suspends.
To copy trace data onto the clipboard for Nios II hardware targets:
1. Select the desired trace data output in the Trace view. You can either highlight a
portion of the text, or right-click in the Trace view and click Select All.
2. Right-click in the Trace view, and then click Copy.
To view trace data for Nios II instruction set simulator targets:
The following steps require that you first create an ISS run/debug configuration
for your
project.
1. On the Run menu, click Debug.... The Run/Debug dialog box appears.
2. Expand Nios II Instruction Set Simulator in the configurationslist. The list of
your ISS run/debug configurations appears.
3. Select your ISS project's run/debug configuration from the configurations list.
4. Click the ISS Settings tab. The ISS Settings tab appears. The Trace Options
control what trace information to display.
5. Turn on Enable Tracing.
6. Turn on the trace options you want to use.
7. Click Debug in the lower-right corner of the Run/Debug dialog box. Trace data
will display in the Console view.
The following is example output:
[19] 0x010002c8: 0xd839883a mov fp, sp [dstData=0x1fffff0 dstReg=fp]
68