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.
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:
TIR xxx ;
HIR xxx ;
HDR xxx ;
TDR xxx ;
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.