Xilinx FFT v8.0核心示例测试平台

时间:2015-05-14 12:45:43

标签: fft xilinx

我正在尝试使用Virtex 7上的Xilinx FFTv8.0内核计算一系列16位输入值的DFT变换,但我对数据表有一些麻烦。

更具体地说,我使用的是标准的自动生成的测试平台(见下文),但输出始终为零。即使在通过数据表和Jim Wu的FPGA博客" (http://myfpgablog.blogspot.de/2010/07/fft-results-from-matlab-fft-bit.html)很多次,我仍然不明白如何使用它。我觉得我对核心的多输入/输出感到困惑。

`timescale 1ns / 1ps

////////////////////////////////////////////////////////////////////////////////
// Company: 
// Engineer:
//
// Create Date:   14:25:20 05/14/2015
// Design Name:   fft_core
// Module Name:   C:/Users/Alberto/Documents/MEGA/Master II/Master Thesis/test_fft/fft_tb.v
// Project Name:  test_fft
// Target Device:  
// Tool versions:  
// Description: 
//
// Verilog Test Fixture created by ISE for module: fft_core
//
// Dependencies:
// 
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
// 
////////////////////////////////////////////////////////////////////////////////

module fft_tb;

    // Inputs
    reg aclk;
    reg s_axis_config_tvalid;
    reg s_axis_data_tvalid;
    reg s_axis_data_tlast;
    reg m_axis_data_tready;
    reg [7:0] s_axis_config_tdata;
    reg [31:0] s_axis_data_tdata;

    // Outputs
    wire s_axis_config_tready;
    wire s_axis_data_tready;
    wire m_axis_data_tvalid;
    wire m_axis_data_tlast;
    wire event_frame_started;
    wire event_tlast_unexpected;
    wire event_tlast_missing;
    wire event_status_channel_halt;
    wire event_data_in_channel_halt;
    wire event_data_out_channel_halt;
    wire [31:0] m_axis_data_tdata;

    // generate clk
    always #5 aclk =! aclk;

    // Instantiate the Unit Under Test (UUT)
    fft_core uut (
        .aclk(aclk), 
        .s_axis_config_tvalid(s_axis_config_tvalid), 
        .s_axis_data_tvalid(s_axis_data_tvalid), 
        .s_axis_data_tlast(s_axis_data_tlast), 
        .m_axis_data_tready(m_axis_data_tready), 
        .s_axis_config_tready(s_axis_config_tready), 
        .s_axis_data_tready(s_axis_data_tready), 
        .m_axis_data_tvalid(m_axis_data_tvalid), 
        .m_axis_data_tlast(m_axis_data_tlast), 
        .event_frame_started(event_frame_started), 
        .event_tlast_unexpected(event_tlast_unexpected), 
        .event_tlast_missing(event_tlast_missing), 
        .event_status_channel_halt(event_status_channel_halt), 
        .event_data_in_channel_halt(event_data_in_channel_halt), 
        .event_data_out_channel_halt(event_data_out_channel_halt), 
        .s_axis_config_tdata(s_axis_config_tdata), 
        .s_axis_data_tdata(s_axis_data_tdata), 
        .m_axis_data_tdata(m_axis_data_tdata)
    );

    initial begin
        // Initialize Inputs
        aclk = 0;
        s_axis_config_tvalid = 0;
        s_axis_data_tvalid = 0;
        s_axis_data_tlast = 0;
        m_axis_data_tready = 0;
        s_axis_config_tdata = 0;
        s_axis_data_tdata = 0;

        // Wait 100 ns for global reset to finish
        #150;

        s_axis_config_tvalid = 1;
        s_axis_data_tvalid = 1;
        //s_axis_data_tlast = 1;
        m_axis_data_tready = 1;
        s_axis_config_tdata = 1;
        s_axis_data_tdata = 1;

        // Add stimulus here

        // Some random inputs (just to understand how it works):
        s_axis_config_tdata = 8'b00000001; // FFT desired (and not IFFT)
        s_axis_data_tdata = 32'h00005678; // I have a real input signal, so the upper half (corresponding to the immaginary part) is zero
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001121;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001516;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001920;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001121;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001516;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001920;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001121;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001516;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001920;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001121;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001516;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001920;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001121;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001516;
        #10;
        s_axis_config_tdata = 8'b00000001;
        s_axis_data_tdata = 32'h00001920;
        #10;


    end

endmodule

以下是我使用的波形和核心配置的截图(我还没有直接发布的权限): https://www.dropbox.com/s/0ejccc4dm6zdw7h/FFT.zip?dl=0

是否有人使用此ip核心处理数据的解释或工作测试平台(可能用Verilog编写)?

我提前感谢你

编辑:

对于后验性,完整代码可用here;详细信息和说明可在paper

中找到

1 个答案:

答案 0 :(得分:1)

最后我解决了我的问题。在提供数据之前,核心具有巨大的延迟(几个我们)。 因此,如果其他人遇到同样的问题,请不要犹豫大幅增加模拟时间,这可能会解决您的问题。