Return to Support Page
 homesearchagentssupportask xilinxmap

Answers Database


Configuration: Dynamic Re-ordering of Daisy-Chain configurations.


Record #3017

Product Family:  Documentation

Product Line:  FPGA Apps.

Problem Title:
Configuration: Dynamic Re-ordering of Daisy-Chain configurations.


Problem Description:
Keywords:  config, daisy, chain, prom

Urgency: Standard

General Description:

For applications that need to choose the order of a daisy-chain
configuration `on-the-fly' or reduce the amount of memory space
needed to hold mutiple daisy-chain configuration streams, some
manual intervention may be applied so that each FPGA copnfiguration
need only be stored once.

For example:

A daisy-chain of 6 devices and multiple designs per device is
demonstrated below:

Lead	 / Slaves...
Device1 -> Device2 -> Device3 -> Device4 -> Device5 -> Device6
Design1    Design2    Design4	 Design7    Design10   Design12
	   Design3    Design5	 Design8    Design11
		      Design6	 Design9

To store all combinations of the above daisy-chains would result in
the same designs being stored in mutliple memory locations.


Solution 1:

This solution record assumes basic knowledge of FPGA configuration
and file generation.  Please consult the Developement System
Reference Guide for information on using the BITGEN and PROMGEN
utilities.

A daisy chain configuration stream can be realized as multiple
seperate files on a per device basis.  However, some limitations
apply.	The configuration file for a lead device in the chain may
not be used to program a slave device, and vice-versa.

Procedure:

1.  Create a bitstream (.bit) file for each design/device
combination.  The same bitstream may not be used for different
device architectures.

2.  Create an ASCII-HEX (.hex) file for each bitstream.

3.  For all .hex files, except those intended for Lead Devices,
remove the first 10 hex characters.  These represent the 40-bit
header of the configuration data.

4.  Calculate the number of configuration bits remaining in each
file.  One way to accomplish this is:

bits = (Bytes_per_file - number_of_lines) x 4 bits_per_character

5.  Adjust file size to match the standard "Program Data" value in
the Databook plus 8.  Every file will have some padding at the end
of the file in the form of `F's hex.  Adding an `F' to the end of
the file will increase it's size by 4 configuration bits.  Removing
an `F' will decrease the number of configuration bits by 4.  All
designs intended for the same device must be equal in length.

Lead device files should be 40 bits larger than slave device files
because of the configuration data header.

6.  Calculate the LengthCount for the Daisy-Chain.

The LengthCount number is the total number of configuration bits for
the chain of devices chosen minus seven:

LengthCount = Total Configuration bits - 7

The total number of Configuration bits is the sum of configuration
bits per device; where bits per device is Program Data + 8.

7.  Replace original LengthCount value in all Lead configuration
files with new value.

The hex files will most likely be `byte-swapped'.  The first 5 bytes
must be unswapped to extract the old LengthCount number, replace it
with the new one, and re-swap the bytes before inserting them into
the file. For example:

The original header may look like: FF043C89F9
Unswapping this would yield:	   FF203C919F
The LengthCount is the 24-bit word succeeding the preamble `FF2',
which in this case would be: 03C919.  If our calculated lengthcount,
from step 6, was: 0F4099, then replacing the lengthcount and
re-swapping would yield:

FF20F4099F (Unswapped)
FF042F90F9 (Swapped)

This would replace the first five bytes in each of the Lead device
configuration files.

8.  Convert the hex files to the desired format for memory storage.

The Xilinx web site contains a utility for converting hex files to
prom files:  ftp://ftp.xilinx.com/pub/utilities/prom/pconfig.zip



End of Record #3017

For the latest news, design tips, and patch information on the Xilinx design environment, check out the Xilinx Expert Journals!

© 1998 Xilinx, Inc. All rights reserved
Trademarks and Patents