1
\$\begingroup\$

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?

\$\endgroup\$
5
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ I think this is exactly what I needed to know. Watching some Xilinx videos about it now. Thanks! \$\endgroup\$ – krb686 Feb 18 '15 at 4:42
  • \$\begingroup\$ Given that ChipScope is quite expensive for the hobbyist, I am still open to other comments, suggestions, or answers. \$\endgroup\$ – krb686 Feb 18 '15 at 6:08
3
\$\begingroup\$

I have an Atlys board and have a couple of different solutions that I use to validate data, depending on the application and datarate:

I use a UART for low-speed transfer and connect it to my pc using a USB cable. I think the nexys has an onboard FTDI chip converter so you just need to use the USB cable. There are a number of uart opencores, or it's relatively simple to write your own. It's an easy interface, protocol-wise. I suspect that this is what the Digilent USB debugging interface uses, however it has only got windows support. Since I mostly use linux I use my own implementation.

For high-speed interfaces, I use a modified version of the opencores UDP stack over Ethernet. UDP isn't too difficult to code/understand and a lot of the header data can be hard coded. I made my own custom packet header and used MAC addressing to route the packets the correct way.

On the PC side, I usually write a python utility to parse in UART/UDP packets and display the data in a meaningful way. It's also possible to use something like hyperterminal in windows. I also use wireshark to check that my UDP packets meet the ethernet spec.

Chipscope is useful for seeing what's going on inside the FPGA (for debugging purposes) but you can't capture data for long periods of time. As far as I remember, it uses JTAG so it isn't that fast either. For applications where you're only interested in the a specific data output, it's easier just to continually feed that data stream to a PC over some interface.

\$\endgroup\$
1
\$\begingroup\$

Most of Digilent's FPGA boards, including the Nexys3, implement a simple parallel interface which can be accessed over USB. The interface is documented at:

http://www.digilentinc.com/Data/Products/ADEPT/DpimRef%20programmers%20manual.pdf

See also: Implementing the Digilent EPP

You can interact with this interface using code libraries provided by Digilent, or using the I/O sections of Digilent Adept.

\$\endgroup\$
  • \$\begingroup\$ EPP interface is not available anymore on Nexys4ddr and new Diligent products. So I suggest to switch to Ethernet UDP for simplicity. \$\endgroup\$ – JCLL Sep 16 '17 at 20:37
  • \$\begingroup\$ I don't know as I'd call an IP stack "simple". If you can get that working, you probably don't need this kind of debugger. :) ChipScope over JTAG, or a UART implementation, are probably easier approaches… \$\endgroup\$ – duskwuff Sep 16 '17 at 21:24
  • \$\begingroup\$ UDP is not that difficult. If UART performance is OK, it remains my favorite vendor-independent solution. \$\endgroup\$ – JCLL Sep 18 '17 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.