you can use this one:
--- Quote Start ---
module fft_avalon_wraper
(
input clk,
input reset_n,
input mm_writedate,
input mm_write,
input sink_valid,
input sink_sop,
input sink_eop,
input [31 : 0] sink_data,
input sink_error,
input source_ready,
output sink_ready,
output source_error,
output source_sop,
output source_eop,
output source_valid,
output [39 : 0] source_data
);
reg inverse;
always@(posedge clk)
begin
if(mm_write)
inverse = mm_writedate;
end
assign source_data[39 : 38] = 2'b0;
your_fft_from_megawizard fft_inst
(
clk,
reset_n,
inverse,
sink_valid,
sink_sop,
sink_eop,
sink_data[31 : 16],
sink_data[15 : 0],
sink_error,
source_ready,
sink_ready,
source_error,
source_sop,
source_eop,
source_valid,
source_data[37 : 32],
source_data[31 : 16],
source_data[15 : 0]
);
endmodule
--- Quote End ---
your_fft_from_megawizard is your fft module, configure it's interface as streaming.
this wraper contains 3 avalon interface:
streaming sink and streaming source: data input and output, read latency = 0, 8 bits per symbol, use 2 sgdma-s for connecting them to you memory, data adapters may needed.
memory map: control the inverse signal of you fft, set it's addressing as NATIVE.
take attention to the width of sink_data and source_data, you may modify them and their connection to sink_real, sink_imag, source_exp, source_real, source_imag due to your own fft module.
you can refer to
fft megacore function user guide.pdf, which contains detailed information about the interface.