完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
`通过控制 variable streaming型FFT核进行FFT变换,首先前16周期进行1024点变换,然后跳转进行16点FFT,现在情况是,从FIFO 输出的采样数据正常输入到FFT核,控制部分sink_valid,sink_sop,sink_eop 正常输入,但就是没有输出,sink_ready,source_valid,source_imag和source_real都没有输出 ` |
|
相关推荐
4个回答
|
|
你的代码呢?这个可以看看生成FFT时生成的例子或者是生成的波形图。
|
|
|
|
FFT控制代码 module fft_control(clk,rst,rst_fifo,w_cycle,fftpts_in,sink_eop,sink_sop,sink_valid,start_16,fft16_over,switch,re_im,out_reim,count_in,recycle,re1,re2,enable)/*synthesis noprune*/; input clk,rst; input start_16,fft16_over; input re1,re2; input [47:0] re_im; output reg [4:0] recycle; output [10:0] fftpts_in; output sink_eop,sink_sop,sink_valid; output rst_fifo; output w_cycle,switch; output [10:0] count_in; output [47:0] out_reim; output enable; wire [47:0] out_reim; reg enable; reg w_cycle; reg rst_fifo; reg [3:0] state1; reg [10:0] fftpts_in; reg [10:0] count_in; reg sink_eop,sink_sop; reg sink_valid; reg flag; reg switch; assign out_reim=flag? re_im:48'd0; always @(posedge clk) if(!rst) begin state1<=4'b0000; rst_fifo<=1'b1; w_cycle<=1'b0; fftpts_in<=11'd1024; sink_eop<=1'b0; sink_sop<=1'b0; sink_valid<=1'b0; count_in<=11'd0; flag<=1'b1; fftpts_in<=11'd0; enable<=1'b0; end else begin case(state1) 4'b0000: begin rst_fifo<=1'b0; flag<=1'b1; count_in<=11'd0; fftpts_in<=11'd1024; w_cycle<=1'b0; recycle<=5'd0; sink_eop<=1'b0; sink_sop<=1'b0; sink_valid<=1'b0; fftpts_in<=11'd1024;//一次FFT变换长度 state1<=4'b0001; enable<=1'b0; end 4'b0001:begin sink_eop<=1'b0; if(re1||re2) begin sink_valid<=1'b1; //fifo读取使能拉高,数据开始输出,此时sink_valid拉高,数据开始输入 sink_sop<=1'b1;//数据开始标志 sink_eop<=1'b0;//数据结束标志 state1<=4'b0011; end else begin state1<=4'b0001; end end 4'b0010: begin sink_valid<=1'b1; sink_sop<=1'b1; sink_eop<=1'b0; state1<=4'b0011; w_cycle<=1'b0; enable<=1'b0; count_in<=count_in+11'd1; end 4'b0011: begin if(count_in==11'd2045) begin enable<=1'b1;//周期计数使能 sink_eop<=1'b1; count_in<=11'd0; w_cycle<=1'b1; state1<=4'b1001; end else if(count_in==11'd1022) begin sink_eop<=1'b1;//计满1024后拉高 state1<=4'b0010;//开始下一个1024变换 end else begin count_in<=count_in+11'd1; sink_sop<=1'b0; end end 4'b1001:begin //fftpts_in<=11'd0; sink_valid<=1'b0; sink_eop<=1'b0; sink_sop<=1'b0; enable<=1'b0; if(enable==1'b1) begin if(recycle==5'd16) begin //计满16周期后转入下一状态开始16点FFT state1<=4'b0100; end else begin enable<=1'b0; recycle<=recycle+1'b1; //enable为1时拉高,计满16周期,及进行16次1024变换 state1<=4'b0001; end end end 4'b0100: begin recycle=5'd0; enable<=1'b0; fftpts_in<=11'd16;// sink_eop<=1'b0; w_cycle<=1'b0; count_in<=11'd0; if(start_16==1'b1) begin//16点FFT开始 state1<=4'b0101; end else begin state1<=4'b0100; end end 4'b0101: begin sink_valid<=1'b1; sink_sop<=1'b1; sink_eop<=1'b0; state1<=4'b0110; end 4'b0110: begin if(fft16_over==1'b1) begin//16点变换结束标志,开始转入1024点FFT; sink_valid<=1'b0; sink_sop<=1'b0; sink_eop<=1'b0; state1<=4'b0000; end else if(count_in==11'd14) begin sink_eop<=1'b1; count_in<=11'd0; state1<=4'b0111; end else begin count_in<=count_in+11'd1; flag<=1'b1; sink_sop<=1'b0; end end 4'b0111: begin sink_eop<=1'b0; sink_sop<=1'b1; state1<=4'b0110; flag<=1'b1; end default: state1<=4'b0000; endcase end always @(posedge clk) if(!rst) switch<=1'b1; else case(fftpts_in) 11'b10000000000: switch<=1'b1; 11'b00000010000: switch<=1'b0; default: switch<=switch; endcase endmodule FFT核例化 core_fft b2v_inst5( .clk(clk), .reset_n(rst), .fftpts_in(fftpts_in), .inverse(SYNTHESIZED_WIRE_1), .sink_valid(sink_valid), .sink_sop(sink_sop), .sink_eop(sink_eop), .sink_real(SYNTHESIZED_WIRE_5), .sink_imag(SYNTHESIZED_WIRE_4), .sink_error(SYNTHESIZED_WIRE_3), .source_ready(SYNTHESIZED_WIRE_2), .source_valid(source_valid), .fftpts_out(), .source_error(), .sink_ready(), .source_sop(), .source_eop(), .source_imag(source_imag[36:0]), .source_real(source_real[36:0])); |
|
|
|
szldsj 发表于 2017-12-13 10:12 问题解决了,是复位的问题,复位要循环,就是当一次FFT结束后要再次复位然后开始下一次变换 |
|
|
|
您好 我是个菜鸟 能问下使用IP核时 为什么设置完 那个芯片图没有生成
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1673 浏览 1 评论
1428 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
1644 浏览 0 评论
941 浏览 0 评论
2433 浏览 0 评论
1499 浏览 38 评论
5698 浏览 113 评论
浏览过的版块 |
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-29 04:25 , Processed in 0.644244 second(s), Total 77, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号