Using ML410 with JTAG

From RCSWiki

Jump to: navigation, search

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

  1. N00:
    • JTAG Connected to Marge
    • Minicom Connected to Marge: minicom n00
    • Setup to run at 115200 baud
  2. N01:
    • JTAG Connected to Marge
    • Minicom Connected to Marge: minicom n01
    • Setup to run at 115200 baud

Directions

  1. Open two terminals (one for Minicom and one for the JTAG):
  2. Check Status of board (requires terminal to Marge)
    • fsc status n23
  3. Request Board if not currently in Use
    • fsc request n23
  4. Turn on Board
    • fsc up n23
  5. In one terminal change to your project directory
  6. 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
  7. (If you haven't already done so, build netlist / bitstream)
    • make -f <project name>.make netlist
    • make -f <project name>.make bits
  8. Initialize BRAMs:
    • make -f <project name>.make init_bram
  9. 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
  10. 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.

  1. In the first terminal open XMD: xmd
  2. Connect to the running processor: ppc
    • (Note if you are using Microblaze type: mb)
  3. 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
  4. Run the Prorgram: con
  5. Check Minicom Output
  6. Stop Processor: stop
  7. Reset Processor (if necessary): rst
  8. 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:

  1. xilinx_jtag_setup.sh
    • Contains USB Bus/Device Information for each Xilinx JTAG (this is called by jtag.sh)
  2. 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:

  1. Marge Restarts - No JTAGs are setup Properly
    • Unplug all Xilinx JTAGs
    • Beginning with JTAG 1:
      1. Plug in JTAG
      2. Wait 10 seconds for USB to enumerate device
      3. on marge run: /sbin/lsusb | grep Xilinx
      4. 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
      5. Repeat for each JTAG - I do one at a time so it is easier to identify JTAGs with their BUS:DEVICE ID
  2. One (or more) JTAGs are not working properly
      1. Unplug ONLY the non-functional JTAGs (No Reason to interfere with other people)
      2. Following the above steps, plug 1 JTAG in, enter the BUS:DEVICE number and repeat
  3. 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:
      1. As Root Login to Marge
      2. Change to Root's Home Directory
      3. Source the Xilinx Tools
        • source /opt/xilinx/10.1/settings.sh
      4. Source the Locked JTAG
        • source /opt/xilinx/jtag.sh n40
      5. 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
  4. 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:
      1. Plug in Red JTAG
      2. Wait 10 seconds for USB to enumerate device
      3. on marge run: /sbin/lsusb | grep Xilinx
      4. Enter the BUS:DEVICE number into the xilinx_jtag_setup.sh file
      5. Source the JTAG
        • source /opt/xilinx/jtag.sh n40
      6. Run fiximpact batch script from impact (as if you were fixing a Locked JTAG)
        • This connects to the JTAG a first time
      7. 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
      8. on marge run: /sbin/lsusb | grep Xilinx
        • The DEVICE ID typically only changes by 1 digit, but it changes
      9. Enter the BUS:DEVICE number into the xilinx_jtag_setup.sh file
      10. Resource the jtag.sh script for the JTAG
      11. Now the JTAG is setup and ready for use
Personal tools