-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Title : ram.vhd
|
-- Title : ram.vhd
|
-- Project :
|
-- Project :
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- File : ram.vhd
|
-- File : ram.vhd
|
-- Author :
|
-- Author :
|
-- Company :
|
-- Company :
|
-- Created : 2003-12-05
|
-- Created : 2003-12-05
|
-- Last update: 2003-12-05
|
-- Last update: 2003-12-05
|
-- Platform :
|
-- Platform :
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Description: Bloco de ram para armazenar a parte real e a imaginaria.
|
-- Description: Bloco de ram para armazenar a parte real e a imaginaria.
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Copyright (c) 2003
|
-- Copyright (c) 2003
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Revisions :
|
-- Revisions :
|
-- Date Version Author Description
|
-- Date Version Author Description
|
-- 2003-12-05 1.0 tmsiqueira Created
|
-- 2003-12-05 1.0 tmsiqueira Created
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
library IEEE;
|
library IEEE;
|
use IEEE.std_logic_1164.all;
|
use IEEE.std_logic_1164.all;
|
|
|
entity ram is
|
entity ram is
|
|
|
generic (
|
generic (
|
width : natural;
|
width : natural;
|
depth : natural;
|
depth : natural;
|
Addr_width : natural);
|
Addr_width : natural);
|
|
|
port (
|
port (
|
clkin : in std_logic; -- clock para a porta de entrada
|
clkin : in std_logic; -- clock para a porta de entrada
|
wen : in std_logic; -- write enable
|
wen : in std_logic; -- write enable
|
addrin : in std_logic_vector(Addr_width-1 downto 0); -- endereco de entrada
|
addrin : in std_logic_vector(Addr_width-1 downto 0); -- endereco de entrada
|
dinR : in std_logic_vector(width-1 downto 0); -- imag data in
|
dinR : in std_logic_vector(width-1 downto 0); -- imag data in
|
dinI : in std_logic_vector(width-1 downto 0); -- real data in
|
dinI : in std_logic_vector(width-1 downto 0); -- real data in
|
clkout : in std_logic; -- clock para a porta de saida
|
clkout : in std_logic; -- clock para a porta de saida
|
addrout : in std_logic_vector(Addr_width-1 downto 0); -- endereco de leitura
|
addrout : in std_logic_vector(Addr_width-1 downto 0); -- endereco de leitura
|
doutR : out std_logic_vector(width-1 downto 0); -- real data out
|
doutR : out std_logic_vector(width-1 downto 0); -- real data out
|
doutI : out std_logic_vector(width-1 downto 0)); -- imag data out
|
doutI : out std_logic_vector(width-1 downto 0)); -- imag data out
|
|
|
end ram;
|
end ram;
|
|
|
architecture ram of ram is
|
architecture ram of ram is
|
|
|
component blockdram
|
component blockdram
|
generic (
|
generic (
|
depth : natural;
|
depth : natural;
|
Dwidth : natural;
|
Dwidth : natural;
|
Awidth : natural);
|
Awidth : natural);
|
port (
|
port (
|
clkin : in std_logic;
|
clkin : in std_logic;
|
wen : in std_logic;
|
wen : in std_logic;
|
addrin : in std_logic_vector(Awidth-1 downto 0);
|
addrin : in std_logic_vector(Awidth-1 downto 0);
|
din : in std_logic_vector(Dwidth-1 downto 0);
|
din : in std_logic_vector(Dwidth-1 downto 0);
|
clkout : in std_logic;
|
clkout : in std_logic;
|
addrout : in std_logic_vector(Awidth-1 downto 0);
|
addrout : in std_logic_vector(Awidth-1 downto 0);
|
dout : out std_logic_vector(Dwidth-1 downto 0));
|
dout : out std_logic_vector(Dwidth-1 downto 0));
|
end component;
|
end component;
|
|
|
begin -- ram
|
begin -- ram
|
|
|
Real_ram : blockdram
|
Real_ram : blockdram
|
generic map (
|
generic map (
|
depth => depth,
|
depth => depth,
|
Dwidth => width,
|
Dwidth => width,
|
Awidth => Addr_width)
|
Awidth => Addr_width)
|
port map (
|
port map (
|
clkin => clkin,
|
clkin => clkin,
|
wen => wen,
|
wen => wen,
|
addrin => addrin,
|
addrin => addrin,
|
din => dinR,
|
din => dinR,
|
clkout => clkout,
|
clkout => clkout,
|
addrout => addrout,
|
addrout => addrout,
|
dout => doutR);
|
dout => doutR);
|
|
|
Imag_ram : blockdram
|
Imag_ram : blockdram
|
generic map (
|
generic map (
|
depth => depth,
|
depth => depth,
|
Dwidth => width,
|
Dwidth => width,
|
Awidth => Addr_width)
|
Awidth => Addr_width)
|
port map (
|
port map (
|
clkin => clkin,
|
clkin => clkin,
|
wen => wen,
|
wen => wen,
|
addrin => addrin,
|
addrin => addrin,
|
din => dinI,
|
din => dinI,
|
clkout => clkout,
|
clkout => clkout,
|
addrout => addrout,
|
addrout => addrout,
|
dout => doutI);
|
dout => doutI);
|
|
|
end ram;
|
end ram;
|
|
|