Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - ram not infering as block ram

 
Thread Tools Search this Thread
Old 11-03-2006, 09:06 AM   #1
Default ram not infering as block ram


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 ;



ashu
  Reply With Quote
Old 11-06-2006, 01:51 PM   #2
KJ
 
Posts: n/a
Default Re: ram not infering as block ram

ashu wrote:
> 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

1. Peruse the Altera documentation for the correct method to infer
memory. What you'll find is that what they have there works and
(although they don't mention it) the code you get is portable across
most other FPGA vendors as well without change.
2. Ask yourself why do you required the input 'r' to equal '1' in order
to set data_out (otherwise it is set to 0)? The answer I'm guessing is
that you don't. Data_out could be set as you have it under the "if (r
= '1') then" all the time regardless of whether "r = '1'" or not. This
is the source of your difficulties in getting it to synthesize into
internal memory.
3. General cleanup...i.e. won't fix anything, but makes your code
clearer.
- Both process sensitivity lists should only have 'pclk' in them, they
are not sensitive to either 'w' or 'r'.
- Don't use std_logic_arith. It has problems, it is not a standard;
ieee.numeric_std does not have either of these drawbacks.
- Use "rising_edge(pclk)" instead of "pclk'event and pclk = '1'".
rising_edge() is an ieee.std_logic_1164 function that more clearly
expresses design intent.

By the way, when written correctly you should find that you likely
won't need any 'syn_ramstyle' attribute either. Try it and see,
usually you don't need it.

KJ



KJ
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I block an IP address range on PIX? iinken General Help Related Topics 0 08-23-2008 10:10 AM
MSN Messenger Block Checker and Yahoo Block Checker mianriz Software 0 07-30-2006 09:22 AM
Invalid Block Address Error with Nero = Many Coasters Lucky Dog DVD Video 0 04-05-2004 08:18 PM
How to block the MSN port? Dilash A+ Certification 2 12-31-2003 01:55 AM
How to Block the MSN Messenger Port Dilash A+ Certification 7 12-27-2003 11:05 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46