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
|
20 |
|
|
-- File: syncram.vhd
|
21 |
|
|
-- Author: Jiri Gaisler - Gaisler Research
|
22 |
|
|
-- Description: syncronous 1-port ram with tech selection
|
23 |
|
|
------------------------------------------------------------------------------
|
24 |
|
|
|
25 |
|
|
library ieee;
|
26 |
|
|
use ieee.std_logic_1164.all;
|
27 |
|
|
use work.gencomp.all;
|
28 |
|
|
use work.allmem.all;
|
29 |
|
|
|
30 |
|
|
entity syncram is
|
31 |
|
|
generic (tech : integer := 0; abits : integer := 6; dbits : integer := 8 );
|
32 |
|
|
port (
|
33 |
|
|
clk : in std_ulogic;
|
34 |
|
|
address : in std_logic_vector((abits -1) downto 0);
|
35 |
|
|
datain : in std_logic_vector((dbits -1) downto 0);
|
36 |
|
|
dataout : out std_logic_vector((dbits -1) downto 0);
|
37 |
|
|
enable : in std_ulogic;
|
38 |
|
|
write : in std_ulogic;
|
39 |
|
|
testin : in std_logic_vector(3 downto 0) := "0000");
|
40 |
|
|
end;
|
41 |
|
|
|
42 |
|
|
architecture rtl of syncram is
|
43 |
|
|
signal gnd4 : std_logic_vector(3 downto 0);
|
44 |
|
|
signal rena, wena : std_logic;
|
45 |
|
|
|
46 |
|
|
begin
|
47 |
|
|
|
48 |
|
|
inf : if tech = inferred generate
|
49 |
|
|
x0 : generic_syncram generic map (abits, dbits)
|
50 |
|
|
port map (clk, address, datain, dataout, write);
|
51 |
|
|
end generate;
|
52 |
|
|
|
53 |
|
|
xcv : if tech = virtex generate
|
54 |
|
|
x0 : virtex_syncram generic map (abits, dbits)
|
55 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
56 |
|
|
end generate;
|
57 |
|
|
|
58 |
|
|
xc2v : if (tech = virtex2) or (tech = spartan3) or (tech = virtex4)
|
59 |
|
|
or (tech = spartan3e) or (tech = virtex5)
|
60 |
|
|
generate
|
61 |
|
|
x0 : virtex2_syncram generic map (abits, dbits)
|
62 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
63 |
|
|
end generate;
|
64 |
|
|
|
65 |
|
|
vir : if tech = memvirage generate
|
66 |
|
|
x0 : virage_syncram generic map (abits, dbits)
|
67 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
68 |
|
|
end generate;
|
69 |
|
|
|
70 |
|
|
atrh : if tech = atc18rha generate
|
71 |
|
|
x0 : atc18rha_syncram generic map (abits, dbits)
|
72 |
|
|
port map (clk, address, datain, dataout, enable, write, testin);
|
73 |
|
|
end generate;
|
74 |
|
|
|
75 |
|
|
axc : if tech = axcel generate
|
76 |
|
|
x0 : axcel_syncram generic map (abits, dbits)
|
77 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
78 |
|
|
end generate;
|
79 |
|
|
|
80 |
|
|
proa : if tech = proasic generate
|
81 |
|
|
x0 : proasic_syncram generic map (abits, dbits)
|
82 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
83 |
|
|
end generate;
|
84 |
|
|
|
85 |
|
|
umc18 : if tech = umc generate
|
86 |
|
|
x0 : umc_syncram generic map (abits, dbits)
|
87 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
88 |
|
|
end generate;
|
89 |
|
|
|
90 |
|
|
rhu : if tech = rhumc generate
|
91 |
|
|
x0 : rhumc_syncram generic map (abits, dbits)
|
92 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
93 |
|
|
end generate;
|
94 |
|
|
|
95 |
|
|
proa3 : if tech = apa3 generate
|
96 |
|
|
x0 : proasic3_syncram generic map (abits, dbits)
|
97 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
98 |
|
|
end generate;
|
99 |
|
|
|
100 |
|
|
ihp : if tech = ihp25 generate
|
101 |
|
|
x0 : ihp25_syncram generic map(abits, dbits)
|
102 |
|
|
port map(clk, address, datain, dataout, enable, write);
|
103 |
|
|
end generate;
|
104 |
|
|
|
105 |
|
|
ihprh : if tech = ihp25rh generate
|
106 |
|
|
x0 : ihp25rh_syncram generic map(abits, dbits)
|
107 |
|
|
port map(clk, address, datain, dataout, enable, write);
|
108 |
|
|
end generate;
|
109 |
|
|
|
110 |
|
|
alt : if (tech = altera) or (tech = stratix1) or (tech = stratix2) or
|
111 |
|
|
(tech = stratix3) or (tech = cyclone3) generate
|
112 |
|
|
x0 : altera_syncram generic map(abits, dbits)
|
113 |
|
|
port map(clk, address, datain, dataout, enable, write);
|
114 |
|
|
end generate;
|
115 |
|
|
|
116 |
|
|
rht : if tech = rhlib18t generate
|
117 |
|
|
x0 : rh_lib18t_syncram generic map(abits, dbits)
|
118 |
|
|
port map(clk, address, datain, dataout, enable, write, gnd4(1 downto 0));
|
119 |
|
|
end generate;
|
120 |
|
|
|
121 |
|
|
lat : if tech = lattice generate
|
122 |
|
|
x0 : ec_syncram generic map(abits, dbits)
|
123 |
|
|
port map(clk, address, datain, dataout, enable, write);
|
124 |
|
|
end generate;
|
125 |
|
|
|
126 |
|
|
ut025 : if tech = ut25 generate
|
127 |
|
|
x0 : ut025crh_syncram generic map (abits, dbits)
|
128 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
129 |
|
|
end generate;
|
130 |
|
|
|
131 |
|
|
pere : if tech = peregrine generate
|
132 |
|
|
x0 : peregrine_syncram generic map (abits, dbits)
|
133 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
134 |
|
|
end generate;
|
135 |
|
|
|
136 |
|
|
arti : if tech = memartisan generate
|
137 |
|
|
x0 : artisan_syncram generic map (abits, dbits)
|
138 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
139 |
|
|
end generate;
|
140 |
|
|
|
141 |
|
|
cust1 : if tech = custom1 generate
|
142 |
|
|
x0 : custom1_syncram generic map (abits, dbits)
|
143 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
144 |
|
|
end generate;
|
145 |
|
|
|
146 |
|
|
ecl : if tech = eclipse generate
|
147 |
|
|
rena <= enable and not write;
|
148 |
|
|
wena <= enable and write;
|
149 |
|
|
x0 : eclipse_syncram_2p generic map(abits, dbits)
|
150 |
|
|
port map(clk, rena, address, dataout, clk, address,
|
151 |
|
|
datain, wena);
|
152 |
|
|
end generate;
|
153 |
|
|
|
154 |
|
|
virage90 : if tech = memvirage90 generate
|
155 |
|
|
x0 : virage90_syncram generic map(abits, dbits)
|
156 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
157 |
|
|
end generate;
|
158 |
|
|
|
159 |
|
|
nex : if tech = easic90 generate
|
160 |
|
|
x0 : nextreme_syncram generic map (abits, dbits)
|
161 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
162 |
|
|
end generate;
|
163 |
|
|
|
164 |
|
|
gnd4 <= "0000";
|
165 |
|
|
|
166 |
|
|
-- pragma translate_off
|
167 |
|
|
noram : if has_sram(tech) = 0 generate
|
168 |
|
|
x : process
|
169 |
|
|
begin
|
170 |
|
|
assert false report "synram: technology " & tech_table(tech) &
|
171 |
|
|
" not supported"
|
172 |
|
|
severity failure;
|
173 |
|
|
wait;
|
174 |
|
|
end process;
|
175 |
|
|
end generate;
|
176 |
|
|
-- pragma translate_on
|
177 |
|
|
end;
|
178 |
|
|
|