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: syncram64
|
20 |
|
|
-- File: syncram64.vhd
|
21 |
|
|
-- Author: Jiri Gaisler - Gaisler Research
|
22 |
|
|
-- Description: 64-bit syncronous 1-port ram with 32-bit write strobes
|
23 |
|
|
-- and tech selection
|
24 |
|
|
------------------------------------------------------------------------------
|
25 |
|
|
|
26 |
|
|
library ieee;
|
27 |
|
|
library techmap;
|
28 |
|
|
use ieee.std_logic_1164.all;
|
29 |
|
|
use techmap.gencomp.all;
|
30 |
|
|
|
31 |
|
|
entity syncram64 is
|
32 |
|
|
generic (tech : integer := 0; abits : integer := 6);
|
33 |
|
|
port (
|
34 |
|
|
clk : in std_ulogic;
|
35 |
|
|
address : in std_logic_vector (abits -1 downto 0);
|
36 |
|
|
datain : in std_logic_vector (63 downto 0);
|
37 |
|
|
dataout : out std_logic_vector (63 downto 0);
|
38 |
|
|
enable : in std_logic_vector (1 downto 0);
|
39 |
|
|
write : in std_logic_vector (1 downto 0);
|
40 |
|
|
testin : in std_logic_vector (3 downto 0) := "0000");
|
41 |
|
|
end;
|
42 |
|
|
|
43 |
|
|
architecture rtl of syncram64 is
|
44 |
|
|
component virtex2_syncram64
|
45 |
|
|
generic ( abits : integer := 9);
|
46 |
|
|
port (
|
47 |
|
|
clk : in std_ulogic;
|
48 |
|
|
address : in std_logic_vector (abits -1 downto 0);
|
49 |
|
|
datain : in std_logic_vector (63 downto 0);
|
50 |
|
|
dataout : out std_logic_vector (63 downto 0);
|
51 |
|
|
enable : in std_logic_vector (1 downto 0);
|
52 |
|
|
write : in std_logic_vector (1 downto 0)
|
53 |
|
|
);
|
54 |
|
|
end component;
|
55 |
|
|
|
56 |
|
|
component artisan_syncram64
|
57 |
|
|
generic ( abits : integer := 9);
|
58 |
|
|
port (
|
59 |
|
|
clk : in std_ulogic;
|
60 |
|
|
address : in std_logic_vector (abits -1 downto 0);
|
61 |
|
|
datain : in std_logic_vector (63 downto 0);
|
62 |
|
|
dataout : out std_logic_vector (63 downto 0);
|
63 |
|
|
enable : in std_logic_vector (1 downto 0);
|
64 |
|
|
write : in std_logic_vector (1 downto 0)
|
65 |
|
|
);
|
66 |
|
|
end component;
|
67 |
|
|
|
68 |
|
|
component custom1_syncram64
|
69 |
|
|
generic ( abits : integer := 9);
|
70 |
|
|
port (
|
71 |
|
|
clk : in std_ulogic;
|
72 |
|
|
address : in std_logic_vector (abits -1 downto 0);
|
73 |
|
|
datain : in std_logic_vector (63 downto 0);
|
74 |
|
|
dataout : out std_logic_vector (63 downto 0);
|
75 |
|
|
enable : in std_logic_vector (1 downto 0);
|
76 |
|
|
write : in std_logic_vector (1 downto 0)
|
77 |
|
|
);
|
78 |
|
|
end component;
|
79 |
|
|
|
80 |
|
|
begin
|
81 |
|
|
|
82 |
|
|
s64 : if has_sram64(tech) = 1 generate
|
83 |
|
|
xc2v : if (tech = virtex2) or (tech = spartan3) or (tech = virtex4)
|
84 |
|
|
or (tech = spartan3e) or (tech = virtex5)
|
85 |
|
|
generate
|
86 |
|
|
x0 : virtex2_syncram64 generic map (abits)
|
87 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
88 |
|
|
end generate;
|
89 |
|
|
arti : if tech = memartisan generate
|
90 |
|
|
x0 : artisan_syncram64 generic map (abits)
|
91 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
92 |
|
|
end generate;
|
93 |
|
|
cust1: if tech = custom1 generate
|
94 |
|
|
x0 : custom1_syncram64 generic map (abits)
|
95 |
|
|
port map (clk, address, datain, dataout, enable, write);
|
96 |
|
|
end generate;
|
97 |
|
|
end generate;
|
98 |
|
|
|
99 |
|
|
nos64 : if has_sram64(tech) = 0 generate
|
100 |
|
|
x0 : syncram generic map (tech, abits, 32)
|
101 |
|
|
port map (clk, address, datain(63 downto 32), dataout(63 downto 32),
|
102 |
|
|
enable(1), write(1), testin);
|
103 |
|
|
x1 : syncram generic map (tech, abits, 32)
|
104 |
|
|
port map (clk, address, datain(31 downto 0), dataout(31 downto 0),
|
105 |
|
|
enable(0), write(0), testin);
|
106 |
|
|
end generate;
|
107 |
|
|
|
108 |
|
|
end;
|
109 |
|
|
|