07-19-2011 03:28 PM - edited 07-28-2011 11:30 AM
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:
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.
07-20-2011 08:08 AM
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).
07-20-2011 02:02 PM - edited 07-28-2011 11:30 AM
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:
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.
07-21-2011 07:23 AM
07-21-2011 09:20 AM - edited 07-28-2011 11:30 AM
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:
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.
07-25-2011 04:13 AM
07-25-2011 10:26 AM - edited 07-25-2011 10:27 AM
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):
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.
07-26-2011 07:28 AM
07-26-2011 10:00 AM - edited 07-26-2011 10:04 PM
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.
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
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.
07-27-2011 04:04 AM
07-27-2011 07:58 AM - edited 07-27-2011 01:54 PM
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:
**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.