Using ML410 with JTAG
From RCSWiki
Contents |
About
- Author: Andy Schmidt
- Last Modified: 06/19/2009
- Notes: This tutorial covers how to use JTAG on the Cluster and how to fix the JTAGs if there are any problems.
Lab Setup
Currently there are 5 ML410 setup to use the XILINX JTAG, they are all installed on Marge. To find out which Nodes have Xilinx JTAGs consult the file: /opt/xilinx/xilinx_jtag_setup.sh
The rest of the Cluster is setup to use the AIREN board JTAG.
To use either the Xilinx JTAGs or the AIREN JTAGs run the following command:
- . /opt/xilinx/jtag.sh n00
This will setup the Terminal to use n00 with a Xilinx JTAG. You still have to source the 10.1 tools.
Example
- N00:
- JTAG Connected to Marge
- Minicom Connected to Marge: minicom n00
- Setup to run at 115200 baud
- N01:
- JTAG Connected to Marge
- Minicom Connected to Marge: minicom n01
- Setup to run at 115200 baud
Directions
- Open two terminals (one for Minicom and one for the JTAG):
- Check Status of board (requires terminal to Marge)
- fsc status n23
- Request Board if not currently in Use
- fsc request n23
- Turn on Board
- fsc up n23
- In one terminal change to your project directory
- Load the JTAG Library into the LD_PRELOAD Environment Variable
- You must specify as a parameter to jtag.sh which node you want to connect to:
- source /opt/xilinx/jtag.sh n23
- (If you haven't already done so, build netlist / bitstream)
- make -f <project name>.make netlist
- make -f <project name>.make bits
- Initialize BRAMs:
- make -f <project name>.make init_bram
- Download bitstream (implementation/download.bit) to FPGA
- Method 1: impact -batch etc/download.cmd
- This is the Recommended way to download the bitstream to the board
- Method 2: make -f <project name>.make download
- If modification has been made to .mhs or .ucf file this method will re-synthesize your design
- Method 1: impact -batch etc/download.cmd
- In the second terminal open minicom:
- minicom n23
Xilinx Microprocessor Debugger (XMD)
To use XMD first follow the Directions to connect to an ML410 board.
- In the first terminal open XMD: xmd
- Connect to the running processor: ppc
- (Note if you are using Microblaze type: mb)
- Download your Executable and Likable File (.elf)
- This depends on where you stored the .elf file and what you named it
- Example: dow my_program/executable.elf
- This depends on where you stored the .elf file and what you named it
- Run the Prorgram: con
- Check Minicom Output
- Stop Processor: stop
- Reset Processor (if necessary): rst
- Exit XMD: exit
Fixing JTAGs
As with everything there is a good chance a problem will arise with the Xilinx JTAGs. This section will cover how to fix those problems.
On Marge there are 2 Files under the /opt/xilinx directory:
- xilinx_jtag_setup.sh
- Contains USB Bus/Device Information for each Xilinx JTAG (this is called by jtag.sh)
- jtag.sh
- Source this file when trying to setup a JTAG (either Xilinx or AIREN)
- This file should not require modification in the event a JTAG problem arises
Common Problems / Common Solutions:
- Marge Restarts - No JTAGs are setup Properly
- Unplug all Xilinx JTAGs
- Beginning with JTAG 1:
- Plug in JTAG
- Wait 10 seconds for USB to enumerate device
- on marge run: /sbin/lsusb | grep Xilinx
- Enter the BUS:DEVICE number into the xilinx_jtag_setup.sh file
- Note: For RED JTAGs this number will change after you connect to the device, see below for how to fix it
- Repeat for each JTAG - I do one at a time so it is easier to identify JTAGs with their BUS:DEVICE ID
- One (or more) JTAGs are not working properly
- Unplug ONLY the non-functional JTAGs (No Reason to interfere with other people)
- Following the above steps, plug 1 JTAG in, enter the BUS:DEVICE number and repeat
- JTAG Locked
- Make sure no other XMD or ChipScope sessions are running using that JTAG
- Close current terminal and re-open and try again
- Try re-sourcing the JTAG (source /opt/xilinx/jtag.sh n40)
- If the Cable is still Locked:
- As Root Login to Marge
- Change to Root's Home Directory
- Source the Xilinx Tools
- source /opt/xilinx/10.1/settings.sh
- Source the Locked JTAG
- source /opt/xilinx/jtag.sh n40
- Run Impact with the Fix Impact Batch File (found on Marge's Root home directory)
- impact -batch fiximpact
- This should release the lock for the Locked Cable
- Change back to Local User and try connecting to JTAG again
- JTAG Enumeration Issue
- The Red JTAGs (jtag 1-3) re-enumerate during their second use (it is weird)
- When setting up a Red JTAG I have found it is best to do the following:
- Plug in Red JTAG
- Wait 10 seconds for USB to enumerate device
- on marge run: /sbin/lsusb | grep Xilinx
- Enter the BUS:DEVICE number into the xilinx_jtag_setup.sh file
- Source the JTAG
- source /opt/xilinx/jtag.sh n40
- Run fiximpact batch script from impact (as if you were fixing a Locked JTAG)
- This connects to the JTAG a first time
- Run fiximpact batch script from impact (as if you were fixing a Locked JTAG) a Second Time
- This is intentional, it will fail to connect to the JTAG the second time due to the re-enumeration of the device
- on marge run: /sbin/lsusb | grep Xilinx
- The DEVICE ID typically only changes by 1 digit, but it changes
- Enter the BUS:DEVICE number into the xilinx_jtag_setup.sh file
- Resource the jtag.sh script for the JTAG
- Now the JTAG is setup and ready for use
