1 |
2 |
dimamali |
------------------------------------------------------------------------------
|
2 |
|
|
-- This file is a part of the GRLIB VHDL IP LIBRARY
|
3 |
|
|
-- Copyright (C) 2003, Gaisler Research
|
4 |
|
|
--
|
5 |
|
|
-- This program is free software; you can redistribute it and/or modify
|
6 |
|
|
-- it under the terms of the GNU General Public License as published by
|
7 |
|
|
-- the Free Software Foundation; either version 2 of the License, or
|
8 |
|
|
-- (at your option) any later version.
|
9 |
|
|
--
|
10 |
|
|
-- This program is distributed in the hope that it will be useful,
|
11 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
|
|
-- GNU General Public License for more details.
|
14 |
|
|
--
|
15 |
|
|
-- You should have received a copy of the GNU General Public License
|
16 |
|
|
-- along with this program; if not, write to the Free Software
|
17 |
|
|
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
18 |
|
|
-----------------------------------------------------------------------------
|
19 |
|
|
-- Entity: syncram_2p
|
20 |
|
|
-- File: syncram_2p.vhd
|
21 |
|
|
-- Author: Jiri Gaisler - Gaisler Research
|
22 |
|
|
-- Description: syncronous 2-port ram with tech selection
|
23 |
|
|
------------------------------------------------------------------------------
|
24 |
|
|
|
25 |
|
|
library ieee;
|
26 |
|
|
library techmap;
|
27 |
|
|
use ieee.std_logic_1164.all;
|
28 |
|
|
use techmap.gencomp.all;
|
29 |
|
|
use work.allmem.all;
|
30 |
|
|
|
31 |
|
|
entity syncram_2p is
|
32 |
|
|
generic (tech : integer := 0; abits : integer := 6; dbits : integer := 8;
|
33 |
|
|
sepclk : integer := 0; wrfst : integer := 0);
|
34 |
|
|
port (
|
35 |
|
|
rclk : in std_ulogic;
|
36 |
|
|
renable : in std_ulogic;
|
37 |
|
|
raddress : in std_logic_vector((abits -1) downto 0);
|
38 |
|
|
dataout : out std_logic_vector((dbits -1) downto 0);
|
39 |
|
|
wclk : in std_ulogic;
|
40 |
|
|
write : in std_ulogic;
|
41 |
|
|
waddress : in std_logic_vector((abits -1) downto 0);
|
42 |
|
|
datain : in std_logic_vector((dbits -1) downto 0);
|
43 |
|
|
testin : in std_logic_vector(3 downto 0) := "0000");
|
44 |
|
|
end;
|
45 |
|
|
|
46 |
|
|
architecture rtl of syncram_2p is
|
47 |
|
|
|
48 |
|
|
signal vcc, gnd : std_ulogic;
|
49 |
|
|
signal vgnd : std_logic_vector(dbits-1 downto 0);
|
50 |
|
|
signal diagin : std_logic_vector(3 downto 0);
|
51 |
|
|
begin
|
52 |
|
|
|
53 |
|
|
vcc <= '1'; gnd <= '0'; vgnd <= (others => '0');
|
54 |
|
|
diagin <= (others => '0');
|
55 |
|
|
|
56 |
|
|
inf : if tech = inferred generate
|
57 |
|
|
x0 : generic_syncram_2p generic map (abits, dbits, sepclk)
|
58 |
|
|
port map (rclk, wclk, raddress, waddress, datain, write, dataout);
|
59 |
|
|
end generate;
|
60 |
|
|
|
61 |
|
|
xcv : if tech = virtex generate
|
62 |
|
|
x0 : virtex_syncram_dp generic map (abits, dbits)
|
63 |
|
|
port map (wclk, waddress, datain, open, write, write,
|
64 |
|
|
rclk, raddress, vgnd, dataout, renable, gnd);
|
65 |
|
|
end generate;
|
66 |
|
|
|
67 |
|
|
xc2v : if (tech = virtex2) or (tech = spartan3) or (tech =virtex4)
|
68 |
|
|
or (tech = spartan3e) or (tech = virtex5)
|
69 |
|
|
generate
|
70 |
|
|
x0 : virtex2_syncram_2p generic map (abits, dbits, sepclk, wrfst)
|
71 |
|
|
port map (rclk, renable, raddress, dataout, wclk,
|
72 |
|
|
write, waddress, datain);
|
73 |
|
|
end generate;
|
74 |
|
|
|
75 |
|
|
vir : if tech = memvirage generate
|
76 |
|
|
d39 : if dbits = 39 generate
|
77 |
|
|
x0 : virage_syncram_2p generic map (abits, dbits, sepclk)
|
78 |
|
|
port map (rclk, renable, raddress, dataout,
|
79 |
|
|
wclk, write, waddress, datain);
|
80 |
|
|
end generate;
|
81 |
|
|
d32 : if dbits <= 32 generate
|
82 |
|
|
x0 : virage_syncram_dp generic map (abits, dbits)
|
83 |
|
|
port map (wclk, waddress, datain, open, write, write,
|
84 |
|
|
rclk, raddress, vgnd, dataout, renable, gnd);
|
85 |
|
|
end generate;
|
86 |
|
|
end generate;
|
87 |
|
|
|
88 |
|
|
atrh : if tech = atc18rha generate
|
89 |
|
|
x0 : atc18rha_syncram_2p generic map (abits, dbits, sepclk)
|
90 |
|
|
port map (rclk, renable, raddress, dataout,
|
91 |
|
|
wclk, write, waddress, datain, testin);
|
92 |
|
|
end generate;
|
93 |
|
|
|
94 |
|
|
axc : if tech = axcel generate
|
95 |
|
|
x0 : axcel_syncram_2p generic map (abits, dbits)
|
96 |
|
|
port map (rclk, renable, raddress, dataout,
|
97 |
|
|
wclk, waddress, datain, write);
|
98 |
|
|
end generate;
|
99 |
|
|
|
100 |
|
|
proa : if tech = proasic generate
|
101 |
|
|
x0 : proasic_syncram_2p generic map (abits, dbits)
|
102 |
|
|
port map (rclk, renable, raddress, dataout,
|
103 |
|
|
wclk, waddress, datain, write);
|
104 |
|
|
end generate;
|
105 |
|
|
|
106 |
|
|
proa3 : if tech = apa3 generate
|
107 |
|
|
x0 : proasic3_syncram_2p generic map (abits, dbits)
|
108 |
|
|
port map (rclk, renable, raddress, dataout,
|
109 |
|
|
wclk, waddress, datain, write);
|
110 |
|
|
end generate;
|
111 |
|
|
|
112 |
|
|
ihp : if tech = ihp25 generate
|
113 |
|
|
x0 : generic_syncram_2p generic map (abits, dbits, sepclk)
|
114 |
|
|
port map (rclk, wclk, raddress, waddress, datain, write, dataout);
|
115 |
|
|
end generate;
|
116 |
|
|
|
117 |
|
|
-- NOTE: port 1 on altsyncram must be a read port due to Cyclone II M4K write issue
|
118 |
|
|
alt : if (tech = altera) or (tech = stratix1) or (tech = stratix2) or
|
119 |
|
|
(tech = stratix3) or (tech = cyclone3) generate
|
120 |
|
|
x0 : altera_syncram_dp generic map (abits, dbits)
|
121 |
|
|
port map (rclk, raddress, vgnd, dataout, renable, gnd,
|
122 |
|
|
wclk, waddress, datain, open, write, write);
|
123 |
|
|
end generate;
|
124 |
|
|
|
125 |
|
|
rh_lib18t0 : if tech = rhlib18t generate
|
126 |
|
|
x0 : rh_lib18t_syncram_2p generic map (abits, dbits)
|
127 |
|
|
port map (rclk, renable, raddress, dataout, write, waddress, datain, diagin);
|
128 |
|
|
end generate;
|
129 |
|
|
|
130 |
|
|
lat : if tech = lattice generate
|
131 |
|
|
x0 : ec_syncram_dp generic map (abits, dbits)
|
132 |
|
|
port map (wclk, waddress, datain, open, write, write,
|
133 |
|
|
rclk, raddress, vgnd, dataout, renable, gnd);
|
134 |
|
|
end generate;
|
135 |
|
|
|
136 |
|
|
ut025 : if tech = ut25 generate
|
137 |
|
|
x0 : ut025crh_syncram_2p generic map (abits, dbits)
|
138 |
|
|
port map (rclk, renable, raddress, dataout,
|
139 |
|
|
wclk, waddress, datain, write);
|
140 |
|
|
end generate;
|
141 |
|
|
|
142 |
|
|
arti : if tech = memartisan generate
|
143 |
|
|
x0 : artisan_syncram_2p generic map (abits, dbits)
|
144 |
|
|
port map (rclk, renable, raddress, dataout,
|
145 |
|
|
wclk, write, waddress, datain);
|
146 |
|
|
end generate;
|
147 |
|
|
|
148 |
|
|
cust1 : if tech = custom1 generate
|
149 |
|
|
x0 : custom1_syncram_2p generic map (abits, dbits)
|
150 |
|
|
port map (rclk, renable, raddress, dataout,
|
151 |
|
|
wclk, write, waddress, datain);
|
152 |
|
|
end generate;
|
153 |
|
|
|
154 |
|
|
ecl : if tech = eclipse generate
|
155 |
|
|
x0 : eclipse_syncram_2p generic map (abits, dbits)
|
156 |
|
|
port map (rclk, renable, raddress, dataout,
|
157 |
|
|
wclk, waddress, datain, write);
|
158 |
|
|
end generate;
|
159 |
|
|
|
160 |
|
|
vir90 : if tech = memvirage90 generate
|
161 |
|
|
x0 : virage90_syncram_dp generic map (abits, dbits)
|
162 |
|
|
port map (wclk, waddress, datain, open, write, write,
|
163 |
|
|
rclk, raddress, vgnd, dataout, renable, gnd);
|
164 |
|
|
end generate;
|
165 |
|
|
|
166 |
|
|
nex : if tech = easic90 generate
|
167 |
|
|
x0 : nextreme_syncram_2p generic map (abits, dbits)
|
168 |
|
|
port map (rclk, renable, raddress, dataout,
|
169 |
|
|
wclk, write, waddress, datain);
|
170 |
|
|
end generate;
|
171 |
|
|
|
172 |
|
|
-- pragma translate_off
|
173 |
|
|
noram : if has_2pram(tech) = 0 generate
|
174 |
|
|
x : process
|
175 |
|
|
begin
|
176 |
|
|
assert false report "synram_2p: technology " & tech_table(tech) &
|
177 |
|
|
" not supported"
|
178 |
|
|
severity failure;
|
179 |
|
|
wait;
|
180 |
|
|
end process;
|
181 |
|
|
end generate;
|
182 |
|
|
-- pragma translate_on
|
183 |
|
|
|
184 |
|
|
end;
|
185 |
|
|
|