Electronic – How to view, debug, or analyze data being input to the FPGA

debuggingfpgavhdl

I'm working with a Xilinx Spartan6 on Digilent's Nexys3 board.

enter image description here


I've also purchased their PmodMIC so I can try to get some audio data onto my board to perform some signal processing.

enter image description here


The PmodMIC has a simple SPI connection, and is supposed to serially output 12 samples per "run" that get shifted into a 12-bit vector inside the PmodMIC VHDL module.

I have created some top-level code and supporting code that I think might be working, but I find myself completely lost when I ask myself – "How do I verify I'm getting correct data, or any good data at all for that matter?"

I decided to map 8 of the 12 bits in the output vector to the LEDs on the board so I could see something at all. When I press my button mapped to start the conversion process, I can even see which LEDs are lit occasionally change and move around, but I know this is essentially useless for anything meaningful.

At this point, I'm entirely clueless. If only there was a way to serially output data back over USB to the PC, or freeze the FPGA's state and examine the contents of its memory after storing some samples there. If methods like this do exist, I certainly don't know about any of them.

Logic Analyzer

I bought the Analog Discovery (another Digilent product) and tried to view the serial data coming from the PmodMIC to the FPGA. I simply routed the serial data to another unused output on the JA bank and hooked up the analyzer, but my results have been pretty poor.

I am sure much of this has to do with my inexperience with the device (I can't even figure out how to control its sample rate).

In any case though, my ultimate question is a bit more broad, which is:

What tools, methods, or processes exist to view, debug, or analyze data on an FPGA?

Best Answer

Xilinx has an in-system debug tool called "ChipScope". It uses spare FPGA resources (mainly block RAM and counters) to create a logic analyzer that can connect to any node in your design, capture waveforms and display them on your host PC, using the same JTAG interface through which you program the chip.