为什么我的fft输出波形不对?
时间:10-02
整理:3721RD
点击:
`timescale 1ns/100ps
module test1111(
);
reg reset_n;
reg sink_valid;
reg ensink_sop;
reg ensink_eop;
wire [23:0]source_real;
wire [23:0]source_imag;
wire source_valid;
wire source_eop;
wire source_sop;
reg clk;
reg [31:0]count8192;
reg [23:0] sink_real;
always #10 clk=~clk;
always@(posedge clk)
if(sink_valid==1)
if(count8192>4096)
sink_real=0;
else
sink_real=1;
else
sink_real=0;
initial
begin
clk=0;
sink_valid=0;
ensink_sop=0;
ensink_eop=0;
count8192=1;
reset_n=0;
#10 reset_n=1;
#40 sink_valid=1;
end
always@(posedge clk)
begin
if(sink_valid==1)
if(count8192==8192)
count8192<=0;
else
count8192=count8192+1;
else
count8192=0;
end
always@(posedge clk)
begin
if(count8192==1)
ensink_sop=1;
else
ensink_sop=0;
if(count8192==8192)
ensink_eop<=1;
else
ensink_eop<=0;
end
fft8192 test_fft8192(
.clk(clk),
.reset_n(reset_n),
.inverse(1'b0),
.sink_valid(sink_valid),
.sink_sop(ensink_sop),
.sink_eop(ensink_eop),
.sink_real( sink_real ),
.sink_imag(24'b0),
.sink_error(2'b0),
.source_ready( 1'b1 ),
.sink_ready(sink_ready),
.source_error( source_error ),
.source_sop( source_sop ),
.source_eop(source_eop),
.source_valid( source_valid ),
.source_exp(source_exp ),
.source_real( source_real ),
.source_imag( source_imag )
);
endmodule
这是我写的test文件,fft使用quartus的ip核。
输出波形总是不对,求大神解答一下
module test1111(
);
reg reset_n;
reg sink_valid;
reg ensink_sop;
reg ensink_eop;
wire [23:0]source_real;
wire [23:0]source_imag;
wire source_valid;
wire source_eop;
wire source_sop;
reg clk;
reg [31:0]count8192;
reg [23:0] sink_real;
always #10 clk=~clk;
always@(posedge clk)
if(sink_valid==1)
if(count8192>4096)
sink_real=0;
else
sink_real=1;
else
sink_real=0;
initial
begin
clk=0;
sink_valid=0;
ensink_sop=0;
ensink_eop=0;
count8192=1;
reset_n=0;
#10 reset_n=1;
#40 sink_valid=1;
end
always@(posedge clk)
begin
if(sink_valid==1)
if(count8192==8192)
count8192<=0;
else
count8192=count8192+1;
else
count8192=0;
end
always@(posedge clk)
begin
if(count8192==1)
ensink_sop=1;
else
ensink_sop=0;
if(count8192==8192)
ensink_eop<=1;
else
ensink_eop<=0;
end
fft8192 test_fft8192(
.clk(clk),
.reset_n(reset_n),
.inverse(1'b0),
.sink_valid(sink_valid),
.sink_sop(ensink_sop),
.sink_eop(ensink_eop),
.sink_real( sink_real ),
.sink_imag(24'b0),
.sink_error(2'b0),
.source_ready( 1'b1 ),
.sink_ready(sink_ready),
.source_error( source_error ),
.source_sop( source_sop ),
.source_eop(source_eop),
.source_valid( source_valid ),
.source_exp(source_exp ),
.source_real( source_real ),
.source_imag( source_imag )
);
endmodule
这是我写的test文件,fft使用quartus的ip核。
输出波形总是不对,求大神解答一下
这是我的波形,source_real和source_imag一直不对