A
ashu
Guest
hi
i had written a code for ram but synthesis tool (SYNPLIFY PRO) is not
infering it as block ram in fact it is
using luts which is consuming lot of chip area.... i m using ALTERA
CYCLONE attribute syn_ramstyle is working well for xilinx device but
not for altera .....could somebody suggest any remedy....code is given
below
thanks
ashwani anand
---------------- --------------- --------------
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.std_logic_unsigned.all ;
use ieee.std_logic_arith.all ;
entity ram is
port (
pclk,sclk,r,w : in std_logic ;
read_a , write_a : in std_logic_vector(11 downto 0 );
data_in : in std_logic_vector(25 downto 0 ) ;
data_out : out std_logic_vector(25 downto 0 )
) ;
end ram ;
architecture a of ram is
type temp is array ( 4095 downto 0 ) of std_logic_vector(25 downto 0) ;
signal t_ram : temp ;
begin
process ( pclk,w ) --------- writing in ram
begin
if ( pclk'event and pclk = '1' ) then
if (w = '1') then
t_ram( conv_integer ( unsigned(write_a ))) <= data_in ;
else
end if ;
end if ;
end process ;
process ( sclk,r ) -----------reading from ram
begin
if ( sclk'event and sclk = '1' ) then
if (r = '1') then
data_out <= t_ram( conv_integer ( unsigned(read_a ))) ;
else
data_out <= (others => '0' ) ;
end if ;
end if ;
end process ;
end a ;
i had written a code for ram but synthesis tool (SYNPLIFY PRO) is not
infering it as block ram in fact it is
using luts which is consuming lot of chip area.... i m using ALTERA
CYCLONE attribute syn_ramstyle is working well for xilinx device but
not for altera .....could somebody suggest any remedy....code is given
below
thanks
ashwani anand
---------------- --------------- --------------
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.std_logic_unsigned.all ;
use ieee.std_logic_arith.all ;
entity ram is
port (
pclk,sclk,r,w : in std_logic ;
read_a , write_a : in std_logic_vector(11 downto 0 );
data_in : in std_logic_vector(25 downto 0 ) ;
data_out : out std_logic_vector(25 downto 0 )
) ;
end ram ;
architecture a of ram is
type temp is array ( 4095 downto 0 ) of std_logic_vector(25 downto 0) ;
signal t_ram : temp ;
begin
process ( pclk,w ) --------- writing in ram
begin
if ( pclk'event and pclk = '1' ) then
if (w = '1') then
t_ram( conv_integer ( unsigned(write_a ))) <= data_in ;
else
end if ;
end if ;
end process ;
process ( sclk,r ) -----------reading from ram
begin
if ( sclk'event and sclk = '1' ) then
if (r = '1') then
data_out <= t_ram( conv_integer ( unsigned(read_a ))) ;
else
data_out <= (others => '0' ) ;
end if ;
end if ;
end process ;
end a ;