Professional Documents
Culture Documents
Introduction
This lab guides you through the process of debugging the processor system. XPS and ChipScope
will be used to have visibility into both the Hardware and Software of the system.
Objectives
After completing this lab, you will be able to perform:
Add ChipScope Analyzers into a system
System Debugging
Procedure
This lab comprises several steps involving simulation. Below each general instruction for a given
procedure, you will find accompanying step-by-step directions and illustrated figures providing
more detail for performing the general instruction. If you feel confident about a specific
instruction, feel free to skip the step-by-step directions and move on to the next general instruction
in the procedure.
Note: If you are unable to complete the lab at this time, you can download the lab files
for this module from the Xilinx University Program site at http://university.xilinx.com
n Create a lab6mb folder in the c:\xup\embedded\labs directory. If you wish to continue with
your completed design from lab5 then copy the contents of the lab5mb folder into the
lab6mb folder, otherwise, if you wish to start with a known good design, then copy the
contents of c:\xup\embedded\mb_completed\lab5mb into the lab6mb directory.
o Open XPS by clicking Start Programs Xilinx Platform Studio 6.2i Xilinx
Platform Studio
p Click File Open Project and browse to the project which in the directory:
c:\xup\embedded\labs\lab6mb
n Using Project Software Platform Settings open the Software Platform Settings GUI
p Delete the timer_int_handler in the Current Value field so the field is blank.
r Remove system_timer.c from the MyProj project and add the new file system_delay.c
s Set the compiler optimization level to No Optimization by double clicking on the MyProj
title and selecting the Optimization Tab as shown in figure 14c.1, and select the option to
Create symbols for debugging as shown.
t Select Download so the sources are recompiled and loaded to the board. The LEDs should
display the counter still running at 0.1 seconds.
w Set the compiler optimization level to Level 2 and download the project again.
OPB/IBA Core
CS_ICON_Conrol
SYS_RST
mb_halt dbg_stop
iba_trig_in iba_trig_out
(MicroBlaze) (MicroBlaze)
sys_clk_s OPB_CLK
ICON Core
control
p In the Bus connection tab, connect the chipscope_opb_iba as a BA (bus analyzer) device to
the OPB bus.
t Some control signals to the MicroBlaze processor are required to enable control and
triggering between the ChipScope Analyzer and the GDB Debugger. In the system.mhs
file add the following two ports under the Microblaze core parameter listing:
PORT MB_Halted = mb_halted
w Select Download to generate the new HW system and link in the SW. Operation should still
be the same.
n In XPS select Tools XMD or using the XMD icon, launch the Xilinx Microprocessor
Debugger (XMD) tool.
o In the XMD dos-type window that opens type mbconnect mdm at the prompt in order to
connect between the processor and host computer using the JTAG port.
r Select
Target: Remote/TCP : XMD
Hostname: localhost
Port: 1234 (or the port value noted above)
And click OK
The software code will be downloaded to the evaluation board. Code operation will be halted
at the first line following the main( ) routine. Proper connection between GDB and the
evaluation board can be verified by noting that the colored highlight is green not purple. If
you see purple close the XMD and all GDB windows and return to Starting the Gnu
debugger.
n Launch the ChipScope Pro Analyzer tool from the program group or desktop icon.
o Click on the Open Cable/Search JTAG chain icon. This will identify the devices on the
JTAG chain. Select OK. The ChipScope Pro Analyzer will open along with default Trigger
Setup and Waveform signal windows.
p Select File Import. In the Signal Import dialogue click on the Select New File button.
q Browse to the XPS design directory and the select the following file
c:\xup\embedded\labs\lab6mb\implementation\chipscope_opb_iba_0_wrapper\
chipscope_opb_iba_0.cdc and click OK as shown in figure 14c.8
The signals associated with the OPB core should be listed in the Trigger Setup and Waveform
signal windows.
n Change the Radix of M0:M4 from binary (Bin) to Hexadecimal (Hex) by clicking on the
respective boxes and selecting Hex
q Adjust the Trigger Condition Equation by selecting the box in the TriggerCondition0
dialogue box that appears. Select M0 and Select M1. The Trigger Condition Equation should
now display M1 && M0. Click OK.
t Change new bus name from BUS_0 to OPB_Abus[31:0] by right clicking on BUS_0
Rename.
v Set up the Output Enable of the Trigger to Pulse (High). This will cross trigger the GDB
debugger.
w Setup the trigger by selecting Trigger Setup -> Run as shown below
The hardware should trigger and then this will cross trigger the SW asynchronous stop in GDB.
Basic ChipScope Pro Trigger settings along with simple waveforms are established.
Conclusion
Chipscope HW debug modules can be added as IP modules in EDK, and the ChipScope analyzer
can be used in conjunction with GDB, the GNU debugger in EDK, to provide a debug
environment that allows cross triggering and debug between hardware and software using a shared
JTAG connection.