We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 20103

Spartan-3 Configuration - How do I read the ID register via SelectMAP?


Spartan-3 devices have a configuration register called IDCODE. What is it, and how do I access it?


The IDCODE register is a configuration register that is separate from the JTAG register of the same name. The beginning of the bitstream contains a command that writes a value, which represents the IDCODE of the target device, to this IDCODE register. This value is compared to an internal constant that represents the true IDCODE of the device. If these values are the same, configuration can continue. If they are different, the bitstream is incorrectly targeted, configuration stops, and the INIT pin goes Low. Consequently, it is impossible to configure a Spartan-3 device with a bitstream intended for a different device size or architecture.

To read the IDCODE register through the SelectMAP port (readback cannot be done via serial modes), the SelectMAP port must persist after configuration (set the BitGen option "-g Persist:Yes"). This forces the configuration pins to retain their function after configuration is complete.

In (Xilinx XAPP452): "Spartan-3 Advanced Configuration Architecture," you can locate the address of the IDCODE register ("01110"), and the details of a Type 1 packet. Here is the flow:

1. Send the synchronization word (0xAA995566).

2. Send the command to read the IDCODE register. The packet contains the type ("001"), read operation ("01), the address ("00000000001110"), RSVD bits ("00"), and the word count ("00000000001"). This produces a 32-bit packet header: 0x2801C001.

3. Send a 32-bit word of all 0's to flush the command pipe of the target device. This ensures the read command is properly handled by the configuration logic.

4. De-assert /CS and /RDWR for one CCLK cycle, and place the data bus into a 3-state condition.

5. Assert /CS.

6. Read the IDCODE from the SelectMAP data bus -- one byte per cycle for four cycles.

AR# 20103
Date Created 09/03/2007
Last Updated 12/15/2012
Status Active
Type General Article