cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
6,759 Views
Registered: ‎07-05-2011

Unable to use output from FFT IP Core

Hello,

 

I've been trying to understand an issue that I've been having with the FFT IP Core (v7.1).

 

I have a small test code that uses the FFT core followed by a multiplication operation using the CORDIC core. The main part of the code is as follows:

 

<Snip>

 

I've chopped out some minor details from this code to make it more easy to understand, without obscuring the problem that I am having.

 

The result of the simulation is that the matrix om gets a correct, nonzero result (all matrices in this case are 2D -- I have tinkered to make this work since the FFT core only works for 1D matrices). The matrix m2 is initialized to the floating-point value of one (X"3F800000"). So in other words, the output of om2, which is the result of the multiplication of om and m2, should simply be the value of om. However, the value of om2 comes out as zero. I have tested this and initialized om2 to some non-zero value and I can see it get overwritten with the zero values in the simulation.

 

So to put it simply... the value given by the FFT core is CORRECT, but the resulting multiplication of the FFT core's output by some other matrix is INCORRECT. I have a larger code in which I have the same type of code and it also behaves the same way.

 

Similarly, I have other sections of my larger code where I use the same style of coding as above for division, mulitiplication, subtraction, addition, etc... all of them work without a problem.

 

I have tried delaying the operations of the muliplication operations by a huge amount to see if it was some kind of obscure timing error, and that yielded nothing. In the simulation, it could be seen that the multiplication was delayed by a large amount (far beyond the completion of the FFT core's output to om), but it still output all zeros.

 

I've read through the documentation and noticed nothing that would help me with this. Does anyone know what is going on? I am quite stumped at this point.

 

Thanks!

0 Kudos
12 Replies
Highlighted
Scholar
Scholar
6,753 Views
Registered: ‎02-27-2008

Re: Unable to use output from FFT IP Core

f,

 

Are you programming in c?  Or are you writing RTL (verilog or VHDL)?


The are two radically different things.  If you think that writing in c style works for logic, you need to go back and learn how to code in hardware description languages.  It does not work!

 

If this is a c code problem, then just about anyone can help you there (it isn't a Xilinx implementation problem, it is a c code problem).



Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Highlighted
Visitor
Visitor
6,750 Views
Registered: ‎07-05-2011

Re: Unable to use output from FFT IP Core

I'm not really sure I follow what you mean; this coding style has worked quite well for me up until the point where I try to use the FFT IP Core.

 

I've used the floating-point core many times for add/sub/mul/div/etc and it works great -- no issues. The problem arises when I try to use the FFT core followed by the floating-point core.

 

If I do something like take the FFT output into a simple embedded loop to copy or shift a matrix it works fine, but if I try to take the output [of the FFT core] to do any kind of floating-point core operation, I get zeros as my output. For instance, if I take the FFT operation that I gave earlier, then copy the value from one matrix to another using embedded loops, it works:

 

<Snip>

 

The value of temp1 is whatever the output of om was, so obviously the problem lies elsewhere. When I try to take the output from the FFT and put it into a floating-point core (which is what I showed earlier), whether it's multiplication, division, etc, it always returns zeros. So I guess I'm confused by what you said earlier about trying to code this as if it were C since prior to my encounter with the FFT core I didn't have any issues coding this way.

 

Regards

0 Kudos
Highlighted
Teacher
Teacher
6,747 Views
Registered: ‎09-09-2010

Re: Unable to use output from FFT IP Core

There doesn't appear to be a clock in the code that you have posted. What clock have you assigned to the FFT core when you instantiated it?

------------------------------------------
"If it don't work in simulation, it won't work on the board."
0 Kudos
Highlighted
Visitor
Visitor
6,743 Views
Registered: ‎07-05-2011

Re: Unable to use output from FFT IP Core

There is a clock, I just chopped out a bunch of the code to keep things simple. I have setup everything per the usual way in the main body of the code:

 

<Snip>

 

And the testbench has the clock and reset defined for everything:

 

     clk <= not clk after 10 ns;

     rst <= '0','1' after 20 ns, '0' after 40 ns;

 

And again, this code works great so long as I do not have to use another core after the FFT core. I can do any kind of matrix manipulation that I want, including copying (like I demonstrated earlier), shifting, etc. It's just that the use of the core after the FFT core operations (which DOES produce correct results) simply ignores the values that are output.

 

Regards

0 Kudos
Highlighted
Teacher
Teacher
6,725 Views
Registered: ‎09-09-2010

Re: Unable to use output from FFT IP Core

Well, assuming that 'fft_dv' is indeed high during the data output phase, 'om' should get assigned. The code you have posted doesn't use it, so can't really tell why it falls over later.

Waveforms might help...

------------------------------------------
"If it don't work in simulation, it won't work on the board."
0 Kudos
Highlighted
Visitor
Visitor
6,720 Views
Registered: ‎07-05-2011

Re: Unable to use output from FFT IP Core

om does get assigned, it just doesnt take that data into the next core.

 

Here are the waveforms (I've posted two to show everything):

 

http://img705.imageshack.us/img705/8083/unled2og.jpg

http://img607.imageshack.us/img607/3739/unled1umb.jpg

 

The variable testmatrix is just a set of embedded loops that has the data from om copied into it element by element to show that the data that is produced by the FFT core does in fact get output and can be used... the problem only arises when I use a core.

0 Kudos
Highlighted
Teacher
Teacher
6,705 Views
Registered: ‎09-09-2010

Re: Unable to use output from FFT IP Core

The links to your images don't work for me.

------------------------------------------
"If it don't work in simulation, it won't work on the board."
0 Kudos
Highlighted
Visitor
Visitor
6,703 Views
Registered: ‎07-05-2011

Re: Unable to use output from FFT IP Core

Hmmm... I went ahead and attached them to this post.

unled2og.jpg
0 Kudos
Highlighted
Visitor
Visitor
6,702 Views
Registered: ‎07-05-2011

Re: Unable to use output from FFT IP Core

And...

unled1umb.jpg
0 Kudos
Highlighted
Visitor
Visitor
3,706 Views
Registered: ‎07-05-2011

Re: Unable to use output from FFT IP Core

Well, it looks like the attachments got resized, so I'm going to post shortened URLs with a new image. Let me know if it still doesn't work on your end and I will try something else.

 

http://bit.ly/oWQdVK

 

I've been able to make output come out correctly by setting an if-statement in the multiplication's loops that only allows the core to be used if the values match what is expected -- so in this case, it would be:

 

if (om(R2,C2) = X"40C00000") then

     (...)

end if;

 

Which properly outputs the values for any non-zero input in this case. But this is obviously useless for the actual implementation. I've tried using a counter but this does not appear to work in conjunction with the FFT core. I've also tested a couple of other rudimentary verification techniques which have worked for me when using other cores, but similarly they are unsuccessful here.

0 Kudos
Highlighted
Teacher
Teacher
3,677 Views
Registered: ‎09-09-2010

Re: Unable to use output from FFT IP Core

The problem with the images may be due due to some issue with ImageShack. I just get a 2x1 GIF...

The other images don't seem to show a clock.

------------------------------------------
"If it don't work in simulation, it won't work on the board."
0 Kudos
Highlighted
Visitor
Visitor
3,675 Views
Registered: ‎07-05-2011

Re: Unable to use output from FFT IP Core

Well the clock is there, and the core is working like it should -- I just chopped it off in those images to save space (I left them on in this screencap).  I'm not sure why the link doesn't work for you, here is a different link:

 

http://i.imgur.com/1JtRA.jpg

 

**Update: I've found a way to solve this problem by checking the variable that is passed the output of the FFT core for the presence of something other than initialized data. If it does not find what it is looking for, it assigns zero values (this is done to clean out garbage) - I did this using an if-statement.

 

This works, but I question how robust such a solution is. If you have a good idea that I could pursue I'd be open to hear it so that I can see if it works for my design.

 

Regards

0 Kudos