• 0
Sign in to follow this  
Weevil

Streaming FFT data

Question

Hi all,

i am working on my first larger project and try to stream data from my FPGA logic over usb to my computer.

I generate a 16bit sine wave with a dds-compiler, doing an FFT and now i want to send the result of the FFT to my computer. Attached i build up a microblaze system with an DMA IP and DDR connection using the arty board. How i can now stream the new generated result of the FFT over the uart port to my computer using the Xilinx SDK, btw. is there a similar example available? (uartlite IP is connected to the microblaze processor) Additional, is the connection between the dds-compiler over the Stream-Data-FIFO to the FFT right?

 

figure1.thumb.PNG.ba302b6c68eab9e0e3b9f7654e61cd56.PNG

Edited by Weevil

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

@Weevil,

Ouch!  That's a lot of logic to have working before you can get to your first test.  It almost sounds like the last person who struggled to get an FFT up and running.

Let me just say that this would not be my approach.  I would build my first approach in a simulator, such as Verilator.  I'd use this project to create an NCO (i.e. the DDS), this project for the FFT.  You can capture the samples directly from the FFT into an Octave file (or MATLAB) you can examine using these techniques.

When you are ready to actually place the design onto your FPGA, I'd use a debugging bus such as this one and then only step the FFT and the NCO by one sample at a time at first.  Even at that, I'd run the debugging bus in Verilator as a first step and interact with it using a network interface--so you can know that the interface works before placing it onto the FPGA.

You could even use this DMA controller, and then prove that the DMA works--still before going to the FPGA.  Of course, if you want to continue with the debugging interface, there is a block reading to the interface as is so that no CPU or DMA would be required.

If you needed memory, this code will simulate a block RAM.  This article will discuss how you could instead place the FFT outputs into a FIFO.

Then, when you finally move to the FPGA, you'll know that everything works--all the way from your NCO to the software on your how PC.

Just my own two cents,

Dan

P.S.  If you are using Windows, the same applies but you might need to install cygwin first.

Share this post


Link to post
Share on other sites
  • 0

@[email protected],

thank you very much for your feedback!

You are right, i wanted too much in one step. I will start to write exact one sine wave of the dds to the ram. The dds is running well, i connected it with a DAC to control the output. When this is done i will try to do the fft of exact one sine wave every cycle (after following your descriptions for the fft). Something similar i did before with a python script (actual i am not so familiar with matlab or octave) and it worked pretty well.

Weevil

Edited by Weevil

Share this post


Link to post
Share on other sites
  • 0

@Weevil,

Don't forget, you will need the ability to break any design you build down into pieces to be able to answer the question of which pieces are working.  If you want to go from the DDS to the RAM, you will need to also therefore be able to 1) run the DDS without the RAM and verify its operation (sounds like you are doing this), 2) run the RAM without the DDS but with the same connectivity you would have if you were using the DDS, 3) connect the DDS to the RAM.  For each of these test cases, you'll want to instrument them well enough so that if they do not work then you will know exactly why not.

Murphy's law says that if you cannot instrument an interface or component, then your design will break at that component and you not only won't know why, but you also won't know how to fix it.

A good simulator will also give you traces for every wire in your design, as well as the answer of whether or not your code works, in less time than it takes Vivado to synthesize your design.  In my case, I can often get results from Verilator before Vivado starts synthesizing--Xilinx's code just has a lot of unnecessary bloat slowing it down.

Dan

Share this post


Link to post
Share on other sites
  • 0

I actual split the topic and now i am working to simulate the FFT and the DDS. This works pretty good, but now i dont know, how to calculate the sample number the dds generates in exact one sine cycle (adjusting the output frequency with streaming phase increment). Later i want to do the FFT with exact one sine wave.

Another way would be to trigger the FFT with the start and stop of the DDS. Is there a possibility to trigger the start and stop of an FFT with a clock?

Edited by Weevil

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this