2

I'm trying to read a Xilinx Spartan 3AN FPGA's 57-bit device DNA using Impact's batch command shell (ISE v14.6) and using the following command line call:

impact -batch file.txt

The contents of file.txt are:

setMode -bscan
setCable -p auto
addDevice -p 1 -file program.bit
readDna -p 1
quit

The response I'm getting from Impact is wrong and changes with each call I make. I know it's wrong because I've instantiated the DNA_PORT primitive in my HDL and am reading out the correct DNA. Here's the last few lines of one of the response from Impact:

Boundary-scan chain validated successfully.
DNA = '111111111111111100000000000000000000000000000000000000000'
Elapsed time = 0 sec.

Has anyone had any success with this command? If so, what am I doing wrong?

Ryan
  • 46
  • 4
  • It *should* work, are you sure your JTAG chain is correct? Can you read the DNA using the GUI? There is also the `ReadIdcode -p 1`, just to make sure you are targeting a spartan. Is it the only device on the JTAG chain? – Jonathan Drolet Mar 30 '15 at 15:00
  • I appreciate the response, and yes, the ReadIdcode is returning the correct ID and matches the FPGA I'm using (0x02620093 = XC3AN400ANFTG256). The JTAG chain works because I'm able to get this ID, erase, program, verify, etc. The GUI I'm using (iMPACT P.68d, v14.6) doesn't provide a method to get the DNA for this part - at least not a way that I'm aware of. It does allow me to get the ID. – Ryan Apr 01 '15 at 18:41
  • Also, yes, there's just one device in this chain - the Spartan 3AN FPGA with internal NV memory. – Ryan Apr 01 '15 at 18:46
  • I pulled out my dusty spartan-3AN board for you, it seems the option to read DNA from GUI is not available for spartan-3AN (it is for spartan-6). I never used the DNA feature before spartan-6, it seems it was more buggy back then, is your part blank? Did you see this answer case http://www.xilinx.com/support/answers/29977.html? – Jonathan Drolet Apr 01 '15 at 20:40
  • Buggy is right. Fortunately the DNA_PORT primitive that I have instantiated in the fabric isn't buggy and returns consistent results. – Ryan Apr 01 '15 at 21:33

1 Answers1

0

With help from Jonathan, I got to the bottom of this.

For the Spartan 3AN FPGA, you can only use iMPACT's batch commands to read the DNA from a blank part that hasn't had any other operations performed on it. Originally I was reading the DNA immediately after erasing the part and performing a successful blank check. These two steps were preventing iMPACT from being able to read the DNA properly on the Spartan 3AN even though it was blank. A power cycle of the FPGA after the blank check results in a valid DNA read.

I imagine this has to do with the behavior of the DONE pin. On this device, the blank check command causes the DONE pin to be asserted and also causes the FPGA to go into an inactive state whether it is blank or not.

Thanks again Jonathan for getting me on the right path.

Ryan
  • 46
  • 4