^

AR# 30212 Spartan-3AN - Known Issues with In-System Programming (ISP) of the Spartan-3AN device via SVF files

There are three methods of programming the flash in the Spartan-3AN device which will be used at different points in a product's development cycle.

  • Prototype programming support is provided in iMPACT as the device can be targeted in Boundary Scan mode and fully operated on.
  • In-System Programming (ISP) support is provided with the ability of the iMPACT software to create an SVF file to program the flash. This Answer Record outlines the file generation method required for this flow, as well as system-level design considerations that will have to be taken into account.
  • Production-socketed programming support is currently provided from BP Micro which fully supports flash programming in the Spartan-3AN devices.

For more FPGA Device Specific Issues and other Configuration Related Articles, see (Xilinx Answer 34104).

In-System Programming (ISP) requires that SVF files be created from iMPACT to program the flash in the Spartan-3AN device. The SVF files are the source files for third-party programming tools.

Please review the following requirements and system-level considerations to ensure that the process completes successfully:

1. iMPACT Patch Files for 9.2.04

The 9.2.04 software must be used with the following patch files installed (this fixes an issue with the SMASK values in the read function). The patch also enables SVF files to be created for the flash portion of the device, which is used only for the ISC_PROGRAM flow described later.

The files required to resolve this issue are the ".dll" files, which update the algorithms used by iMPACT. A patch for the iMPACT 9.2.04 software can be found at:
http://www.xilinx.com/txpatches/pub/utilities/fpga/30212.zip

The 10.1 software contains the SMASK algorithm fix; the updated ".dll" files are not required. If 10.1 is being used with any of the Service Packs, the ".dll" files should not be installed. It is prudent to use the latest version of the software.

2. TCK Frequency Adjustments

The SVF files generated by iMPACT are currently generated for a 1 MHz TCK frequency. The wait times in the files have been calculated based on this assumption. Having a TCK frequency different from 1 MHz in the target system that interprets the SVF files requires that the RUNTEST statements be adjusted accordingly.

iMPACT SVF File Playing TCK requirements:

- Platform Cable USB = 1.5 MHz
- Parallel-IV Cable = 1.25 MHz

ISP File Playing:
If TCK is faster than 1 MHz, the RUNTEST statements must be modified by the factor of increase. Consequently, if the files are to be played at 6 MHz, all of the RUNTEST statements must be multiplied by a factor of 6.

If the files are playing too fast, the erase functionality typically fails. Slowing the file speed should resolve this issue.

3. TCK Toggling during RUNTEST

TCK must be toggled during the RUNTEST statements when the file is played.

Third-Party ISP File Playing:
If a third-party programming tool is used, contact the tool vendor to ensure the TCK line is toggling during the RUNTEST statements in the SVF file. The TCK line can also be scoped to test for long pauses when TCK might not be toggling.

XAPP058 ISP File Playing:
The source code must be compiled with the following changes made to the "ports.c" file. The waitTime function must have the pulseClk(); function added in the following manner:

void waitTime(long microsec)
{
long multiplier = 1;
long numClocks = multiplier * microsec;
for ( long i = 0; i < numClocks; ++i )
{
pulseClock();
}
}

The precompiled xsvf player utilities included with Xilinx Application Note XAPP058 will also not work on the Spartan-3AN devices.

4. Shift-DR File Limitations

The Shift-DR entries in the file must be completed without the use of the Pause-DR state.

Third-Party ISP File Playing:
The Shift-DR statements in the file must be completed without transition to the Pause-DR state by the target system.

Some third-party SVF interpreters (JTAG Technologies and Asset) will not process large data shifts without transitioning to the pause state. The generated SVF files contain one large data shift of 400 K bits (for the smallest device) that loads the reference design into the Spartan-3AN FPGA. This shift size increases for larger devices. The files also specify 8K data shifts to access on the flash. These 8K data shifts cannot be broken up or paused.

To avoid triggering transitions to the Pause-DR state by these third-party SVF interpreters, Xilinx describes a method for creating SVF files that utilizes the ISC_PROGRAM flow for loading the reference design into the FPGA. This will replace the large data shift with much smaller shifts that will obviate the need for the interpreter to transition to the Pause-DR state. It should be noted that this will not modify the 8K data shift, but that shift does not cause any complications.

To create an alternate programming style SVF file, follow these steps:

  1. 1. Create an SVF file to Erase, Program, Verify the Spartan-3AN in iMPACT and label "SVF_FILE_ 1".
  2. 2. Select the appropriate file corresponding to the device being targeted from the ISC_PROGRAM_svf_files folder as SVF_FILE_2.
  3. 3. Open both files and copy the following lines from the iMPACT-created file to the top of the provided file. If there is only one device in the chain, the values for these variables will be all 0s. If there are other devices in the chain, these variables will have numbers associated. iMPACT initializes these to 0 and then sets them, so when the code is used, please use the code segments with non-zero values, if they exist.

    TIR xxx ;

    HIR xxx ;

    HDR xxx ;

    TDR xxx ;

  4. 4. Copy the iMPACT-generated file SVF_FILE_1 from below the following lines down, and paste it at the end of the provided file SVF_FILE_2. The key to this operation is that the IDCODE instruction after the first large data loading is used. There will be 3-4 idcode checks in the front of the file, and then, the bit file loading which is what the new ".svf" file contains. The iMPACT-generated SVF file will be used for the flash operations which are contained after the following code segment.

    Loading device with 'idcode' instruction.
    SIR 6 TDI (09) ;
    SDR 32 TDI (00000000) SMASK (ffffffff) TDO (f2618093) MASK (0fffffff) ;
    //Loading device with 'bypass' instruction.
    SIR 6 TDI (3f) ;
    // Loading device with a `user1` instruction.
    SIR 6 TDI (02) ;
    RUNTEST 10 TCK;
    //Loading device with 'read status' instruction.
    // Loading device with a `user1` instruction.
    SIR 6 TDI (02) ;
    RUNTEST 10 TCK;
    SDR 80 TDI (000000eb10006a956a95) ;
    RUNTEST 144 TCK; SDR 80 TDI (00000000000000eb1000) SMASK (ffffffffffffffffffff) TDO (0000000000000000) MASK (0000000000000000) ;
    //Loading device with 'read status' instruction.
    // Loading device with a `user1` instruction.
    SIR 6 TDI (02) ;
    RUNTEST 10 TCK;
    SDR 80 TDI (0000ffeb08006a956a95) ;
    RUNTEST 144 TCK;
    .....
    ....
    .... ....

The new file SVF_FILE_2 should include the header and trailer information provided by iMPACT, the algorithms in the file to program the FPGA with the ISC_PROGRAM flow using 16 bit data shifts, and then the SPI code from iMPACT to run Erase, Program, and Verify.

XAPP058 ISP File Playing:
The -rlen command can be used when compiling SVF files into the XSVF file format. This command cannot be less than 8560. If this is required, a safe factor of 10,000 can be used. The files should be tested without the use of the "-rlen" command to see if this command is required.

AR# 30212
Date Created 02/06/2008
Last Updated 03/16/2010
Status Active
Type
Feed Back