1 |
2 |
unicore |
---------------------------------------------------------------------
|
2 |
|
|
---- ----
|
3 |
|
|
---- FFT Filter IP core ----
|
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 |
|
|
-- File: RAMB4_S36_S36.vhd
|
40 |
|
|
-- created by Design Wizard: 08/13/05 08:52:59
|
41 |
|
|
--
|
42 |
|
|
library IEEE;
|
43 |
|
|
use IEEE.std_logic_1164.all;
|
44 |
|
|
use IEEE.std_logic_unsigned.all;
|
45 |
|
|
|
46 |
|
|
entity RAMB16_S36_S36 is
|
47 |
|
|
port (DIA : in STD_LOGIC_VECTOR (31 downto 0);
|
48 |
|
|
DIB : in STD_LOGIC_VECTOR (31 downto 0);
|
49 |
|
|
DIPA : in STD_LOGIC_VECTOR (3 downto 0);
|
50 |
|
|
DIPB : in STD_LOGIC_VECTOR (3 downto 0);
|
51 |
|
|
ENA : in STD_ULOGIC;
|
52 |
|
|
ENB : in STD_ULOGIC;
|
53 |
|
|
WEA : in STD_ULOGIC;
|
54 |
|
|
WEB : in STD_ULOGIC;
|
55 |
|
|
SSRA : in STD_ULOGIC;
|
56 |
|
|
SSRB : in STD_ULOGIC;
|
57 |
|
|
CLKA : in STD_ULOGIC;
|
58 |
|
|
CLKB : in STD_ULOGIC;
|
59 |
|
|
ADDRA : in STD_LOGIC_VECTOR (8 downto 0);
|
60 |
|
|
ADDRB : in STD_LOGIC_VECTOR (8 downto 0);
|
61 |
|
|
DOA : out STD_LOGIC_VECTOR (31 downto 0);
|
62 |
|
|
DOB : out STD_LOGIC_VECTOR (31 downto 0);
|
63 |
|
|
DOPA : out STD_LOGIC_VECTOR (3 downto 0);
|
64 |
|
|
DOPB : out STD_LOGIC_VECTOR (3 downto 0)
|
65 |
|
|
);
|
66 |
|
|
end RAMB16_S36_S36;
|
67 |
|
|
|
68 |
|
|
architecture BEH of RAMB16_S36_S36 is
|
69 |
|
|
|
70 |
|
|
type mem is array (0 to 511) of std_logic_vector (35 downto 0);
|
71 |
|
|
signal adra,adrb:std_logic_vector (8 downto 0):=(others=>'0');
|
72 |
|
|
signal data_a,data_b:std_logic_vector (35 downto 0);
|
73 |
|
|
signal wea_1,web_1: STD_LOGIC;
|
74 |
|
|
begin
|
75 |
|
|
process(clka,ssra,clkb,ssrb,adra,adrb,wea,web,dia,dib)
|
76 |
|
|
variable ram: mem:=(others=>X"000000000") ;
|
77 |
|
|
variable ia,ib: integer;
|
78 |
|
|
variable a,b:std_logic_vector (35 downto 0);
|
79 |
|
|
begin
|
80 |
|
|
|
81 |
|
|
if ssra = '1' then
|
82 |
|
|
dopa<="0000";
|
83 |
|
|
doa <= X"00000000";
|
84 |
|
|
adra <= "000000000";
|
85 |
|
|
wea_1 <= '0';
|
86 |
|
|
elsif clka = '1' and clka'event then
|
87 |
|
|
data_a <= dipa&dia;
|
88 |
|
|
adra(8 downto 0) <= addra;
|
89 |
|
|
wea_1 <= wea;
|
90 |
|
|
end if;
|
91 |
|
|
|
92 |
|
|
if ssrb = '1' then
|
93 |
|
|
dopb<="0000";
|
94 |
|
|
dob <= X"00000000";
|
95 |
|
|
adrb <= "000000000";
|
96 |
|
|
web_1 <= '0';
|
97 |
|
|
elsif clkb = '1' and clkb'event then
|
98 |
|
|
data_b <= dipb&dib;
|
99 |
|
|
adrb(8 downto 0) <= addrb;
|
100 |
|
|
web_1 <= web;
|
101 |
|
|
end if;
|
102 |
|
|
|
103 |
|
|
ia:= conv_integer(To_X01(adra));
|
104 |
|
|
a:= ram(ia);
|
105 |
|
|
dopa<=a(35 downto 32);
|
106 |
|
|
doa <= a(31 downto 0);
|
107 |
|
|
if wea_1 = '1' then
|
108 |
|
|
ram(ia) :=data_a;
|
109 |
|
|
end if;
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
ib:= conv_integer(To_X01(adrb));
|
113 |
|
|
b:= ram(ib);
|
114 |
|
|
dopb<=b(35 downto 32);
|
115 |
|
|
dob <= b(31 downto 0);
|
116 |
|
|
if web_1 = '1' then
|
117 |
|
|
ram(ib) := data_b;
|
118 |
|
|
end if;
|
119 |
|
|
|
120 |
|
|
end process;
|
121 |
|
|
|
122 |
|
|
end BEH;
|