R
reto.knaak
Hi to everybody!
I'm trying to make a VHDL DPRAM for a xilinx spartan II. It works great
for the same bus width on each side but I don't know how to make
different bus size. I need a 128x1 on one side and 16x8 on the other
side...
I tried this, but it generates an error.... anyone who can help?
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity latch_dpram is
generic (
WIDTH : integer := 16;
DEPTH : integer := 8
);
port (
w_clk : in std_logic;
w_en_in : in std_logic;
w_data_in : in std_logic_vector(WIDTH*(2**DEPTH)-1 downto 0);
r_clk : in std_logic;
r_addr_in : in std_logic_vector(DEPTH-1 downto 0);
r_data_out : out std_logic_vector(WIDTH-1 downto 0)
);
end entity;
----------------------------------------------------------------------------------------------------
architecture xilinx_latch_ram of latch_dpram is
type memory_type is array (natural range <>) of
std_logic_vector(WIDTH-1 downto 0);
signal memory : memory_type(2**DEPTH-1 downto 0);
signal r_addr_int: std_logic_vector(DEPTH-1 downto 0);
begin
write : process(w_clk)
begin
if w_clk'event and w_clk = '1' then
if w_en_in = '1' then
memory <= w_data_in;
end if;
end if;
end process;
read : process(r_clk)
begin
if r_clk'event and r_clk = '1' then
r_addr_int <= r_addr_in;
end if;
end process;
r_data_out <= memory(to_integer(unsigned(r_addr_int)));
end architecture;
I'm trying to make a VHDL DPRAM for a xilinx spartan II. It works great
for the same bus width on each side but I don't know how to make
different bus size. I need a 128x1 on one side and 16x8 on the other
side...
I tried this, but it generates an error.... anyone who can help?
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity latch_dpram is
generic (
WIDTH : integer := 16;
DEPTH : integer := 8
);
port (
w_clk : in std_logic;
w_en_in : in std_logic;
w_data_in : in std_logic_vector(WIDTH*(2**DEPTH)-1 downto 0);
r_clk : in std_logic;
r_addr_in : in std_logic_vector(DEPTH-1 downto 0);
r_data_out : out std_logic_vector(WIDTH-1 downto 0)
);
end entity;
----------------------------------------------------------------------------------------------------
architecture xilinx_latch_ram of latch_dpram is
type memory_type is array (natural range <>) of
std_logic_vector(WIDTH-1 downto 0);
signal memory : memory_type(2**DEPTH-1 downto 0);
signal r_addr_int: std_logic_vector(DEPTH-1 downto 0);
begin
write : process(w_clk)
begin
if w_clk'event and w_clk = '1' then
if w_en_in = '1' then
memory <= w_data_in;
end if;
end if;
end process;
read : process(r_clk)
begin
if r_clk'event and r_clk = '1' then
r_addr_int <= r_addr_in;
end if;
end process;
r_data_out <= memory(to_integer(unsigned(r_addr_int)));
end architecture;