在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
楼主: helimpopo

[资料] 128点基8的FFT verilog代码(一起来学习一下!)

[复制链接]
发表于 2018-3-30 09:30:30 | 显示全部楼层
thanks
 楼主| 发表于 2018-4-2 14:04:48 | 显示全部楼层
回复 1# helimpopo
BUFRAM128C模块有点问题,用下面这个:

/////////////////////////////////////////////////////////////////////
////                                                             ////
////  FFT/IFFT 128 points transform                              ////
////                                                             ////
////  Authors: Anatoliy Sergienko, Volodya Lepeha                ////
////  Company: Unicore Systems http://unicore.co.ua              ////
////                                                             ////
////  Downloaded from: http://www.opencores.org                  ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
////                                                             ////
//// Copyright (C) 2006-2010 Unicore Systems LTD                 ////
//// www.unicore.co.ua                                           ////
//// o.uzenkov@unicore.co.ua                                     ////
////                                                             ////
//// This source file may be used and distributed without        ////
//// restriction provided that this copyright statement is not   ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer.////
////                                                             ////
//// THIS SOFTWARE IS PROVIDED "AS IS"                           ////
//// AND ANY EXPRESSED OR IMPLIED WARRANTIES,                    ////
//// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED                  ////
//// WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT              ////
//// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.        ////
//// IN NO EVENT SHALL THE UNICORE SYSTEMS OR ITS                ////
//// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,            ////
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL            ////
//// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT         ////
//// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,               ////
//// DATA, OR PROFITS; OR BUSINESS INTERRUPTION)                 ////
//// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,              ////
//// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT              ////
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING                 ////
//// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,                 ////
//// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.          ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// DESCRIPTION
:
Store buffer
// FUNCTION:

FIFO - buffer with direct input order and 8-th inverse output order
//
FILES:
BUFRAM128C_2.v
- 1-st,2-nd,3-d data buffer, contains:
//               

RAM2x128C.v - dual ported synchronous RAM, contains:

//
   
RAM128.v -single ported synchronous RAM
//  PROPERTIES: 1) Has the volume of 2x128 complex data
//
2) Contains 2- port RAM and address counter
//
3)Has 128-clock cycle period starting with the START impulse
//                          and continuing forever   
//
  4) Signal RDY precedes the 1-st correct datum outputted from the buffer
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`timescale 1 ns / 1 ps
`include "FFT128_CONFIG.inc"


module BUFRAM128C ( CLK ,RST ,ED ,START ,DR ,DI ,RDY ,DOR ,DOI );

`FFT128paramnb

output RDY ;

reg RDY ;

output [nb-1:0] DOR ;

wire [nb-1:0] DOR ;

output [nb-1:0] DOI ;

wire [nb-1:0] DOI ;



input CLK ;

wire CLK ;

input RST ;

wire RST ;

input ED ;

wire ED ;

input START ;

wire START ;

input [nb-1:0] DR ;

wire [nb-1:0] DR ;

input [nb-1:0] DI ;

wire [nb-1:0] DI ;



wire odd, we;

wire [6:0] addrw,addrr;

reg [7:0] addr;

reg [8:0] ct2;
//counter for the RDY signal

  



always @(posedge CLK)
//   CTADDR

begin

if (RST) begin

addr<=7'b000_0000;

ct2<= 8'b1000_0001;  

RDY<=1'b0; end

else if (START) begin

addr<=7'b000_0000;

ct2<= 8'b0000_0000;  

RDY<=1'b0;end

else if (ED)
begin

RDY<=1'b0;

addr<=addr+1;

if (ct2!=129)

ct2<=ct2+1;

if (ct2==128)

RDY<=1'b1;

end

end




assign
addrw=
addr[6:0];
assign
odd=addr[7];
   
// signal which switches the 2 parts of the buffer
assign
addrr={addr[2 : 0], addr[6 : 3]};
  // 8-th inverse output address
assign
we = ED;
  



RAM2x128C #(nb)
URAM(.CLK(CLK),.ED(ED),.WE(we),.ODD(odd),

.ADDRW(addrw),
.ADDRR(addrr),

.DR(DR),.DI(DI),

.DOR(DOR),
.DOI(DOI));
   


endmodule





有个RAM交换位置需要改一下。
    捕获.PNG
 楼主| 发表于 2018-4-2 14:07:31 | 显示全部楼层
本帖最后由 helimpopo 于 2018-4-2 14:08 编辑

回复 1# helimpopo 换一个模块,之前那个module有问题,且输出信号不准确 BUFRAM128C.zip (1.84 KB, 下载次数: 16 )
发表于 2018-4-9 09:36:36 | 显示全部楼层
thanks for sharing
发表于 2018-4-9 10:50:05 | 显示全部楼层
感谢!!!!!!!!!!!!!
发表于 2018-4-9 14:08:20 | 显示全部楼层
感谢分享
发表于 2018-4-11 18:05:15 | 显示全部楼层
回复 1# helimpopo
Thank you for sharing
发表于 2018-9-7 14:47:42 | 显示全部楼层
谢谢分享
发表于 2018-9-13 21:29:06 | 显示全部楼层
回复 1# helimpopo


   感谢
发表于 2018-9-13 23:48:46 | 显示全部楼层
学习了,谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /3 下一条

×

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-4-24 05:02 , Processed in 0.029462 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表