1 |
2 |
unicore |
/////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// FFT/IFFT 128 points transform ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// Authors: Anatoliy Sergienko, Volodya Lepeha ////
|
6 |
|
|
//// Company: Unicore Systems http://unicore.co.ua ////
|
7 |
|
|
//// ////
|
8 |
|
|
//// Downloaded from: http://www.opencores.org ////
|
9 |
|
|
//// ////
|
10 |
|
|
/////////////////////////////////////////////////////////////////////
|
11 |
|
|
//// ////
|
12 |
|
|
//// Copyright (C) 2006-2010 Unicore Systems LTD ////
|
13 |
|
|
//// www.unicore.co.ua ////
|
14 |
|
|
//// o.uzenkov@unicore.co.ua ////
|
15 |
|
|
//// ////
|
16 |
|
|
//// This source file may be used and distributed without ////
|
17 |
|
|
//// restriction provided that this copyright statement is not ////
|
18 |
|
|
//// removed from the file and that any derivative work contains ////
|
19 |
|
|
//// the original copyright notice and the associated disclaimer.////
|
20 |
|
|
//// ////
|
21 |
|
|
//// THIS SOFTWARE IS PROVIDED "AS IS" ////
|
22 |
|
|
//// AND ANY EXPRESSED OR IMPLIED WARRANTIES, ////
|
23 |
|
|
//// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ////
|
24 |
|
|
//// WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT ////
|
25 |
|
|
//// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ////
|
26 |
|
|
//// IN NO EVENT SHALL THE UNICORE SYSTEMS OR ITS ////
|
27 |
|
|
//// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, ////
|
28 |
|
|
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ////
|
29 |
|
|
//// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT ////
|
30 |
|
|
//// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ////
|
31 |
|
|
//// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ////
|
32 |
|
|
//// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ////
|
33 |
|
|
//// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ////
|
34 |
|
|
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING ////
|
35 |
|
|
//// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ////
|
36 |
|
|
//// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ////
|
37 |
|
|
//// ////
|
38 |
|
|
/////////////////////////////////////////////////////////////////////
|
39 |
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
40 |
|
|
// DESCRIPTION : 1-port synchronous RAM
|
41 |
|
|
// FUNCTION: 1-port synchronous RAM
|
42 |
|
|
// FILES: RAM256.v -single ported synchronous RAM
|
43 |
|
|
// PROPERTIES: 1) Has the volume of 256 data
|
44 |
|
|
// 2) RAM is synchronous one, the read datum is outputted in 2 cycles after the address setting
|
45 |
|
|
// 3) Can be substituted to any 2-port synchronous RAM
|
46 |
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
47 |
|
|
`timescale 1 ns / 1 ps
|
48 |
|
|
`include "FFT128_CONFIG.inc"
|
49 |
|
|
|
50 |
|
|
module RAM128 ( CLK, ED,WE ,ADDR ,DI ,DO );
|
51 |
|
|
`FFT128paramnb
|
52 |
|
|
|
53 |
|
|
output [nb-1:0] DO ;
|
54 |
|
|
reg [nb-1:0] DO ;
|
55 |
|
|
input CLK ;
|
56 |
|
|
wire CLK ;
|
57 |
|
|
input ED;
|
58 |
|
|
input WE ;
|
59 |
|
|
wire WE ;
|
60 |
|
|
input [6:0] ADDR ;
|
61 |
|
|
wire [6:0] ADDR ;
|
62 |
|
|
input [nb-1:0] DI ;
|
63 |
|
|
wire [nb-1:0] DI ;
|
64 |
|
|
reg [nb-1:0] mem [127:0];
|
65 |
|
|
reg [6:0] addrrd;
|
66 |
|
|
|
67 |
|
|
always @(posedge CLK) begin
|
68 |
|
|
if (ED) begin
|
69 |
|
|
if (WE) mem[ADDR] <= DI;
|
70 |
|
|
addrrd <= ADDR; //storing the address
|
71 |
|
|
DO <= mem[addrrd]; // registering the read datum
|
72 |
|
|
end
|
73 |
|
|
end
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
endmodule
|