- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
BRAM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-13-2009 11:49 PM
I inferred single port BRAM for the size of 27*65 using two methods, RTL and coregen.
Using coregen infers 1 RAMB16 block and RTL logic of same infers 2 RAMB16 blocks. I use spartan-3e FPGA.
What is the reason for this??
Re: BRAM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-14-2009 01:08 AM
Hi Sridar,
some time ago I made the same observation as you did now.
The coding rules for infering BRAMS are very tight, and sometimes not really clever.
So, unless you haven't made some mistake in your code (hard to say without anything posted) the synthesis tool has a different oppinion than you about how to interpret it.
Best way to clear this is to open a webcase and send your code and the coregen results of your intended result to XILINX and hope for improvements.
Have a nice synthesis
Eilert
Re: BRAM
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-14-2009 02:00 AM - edited 08-14-2009 02:23 AM
Thanks Mr.Eilert,
I just followed the guidelines from xilinx guides to infer a RAM. I wil file a case against this.
One more think i noticed is, number of RAM blocks inferred for dual port is two times greater than single port through coregen for the same memory size. Is this correct?
Thanks again and i have attached my code for single port RAM below.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity memory is
port (
addr: IN std_logic_VECTOR(4 downto 0);
clk,din,en,we : IN std_logic;
din : in std_logic_vector (64 downto 0);
dout: OUT std_logic_VECTOR(64 downto 0));
end memory;
architecture Behavioral of memory is
Type memd is array (0 to 26) of std_logic_vector (64 downto 0);
signal memor : memd;
begin
process (Clk)
begin
if (clk'event and clk = '1') then
if (en= '1') then
if (we = '1') then
memor(conv_integer(addr)) <= din;
else
dout <= memor(conv_integer(addr));
end if;
end if;
end if;
end process;
end Behavioral;
Re: BRAM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-14-2009 07:33 AM
Hi,
As per your code , u r reading synchronously.
If you read independent of clock ,tool may infer BRAM.
Just check it.
Re: BRAM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-14-2009 10:01 AM
Hi --
process (Clk)
begin
if (clk'event and clk = '1') then
if (en= '1') then
if (we = '1') then
memor(conv_integer(addr)) <= din;
else
dout <= memor(conv_integer(addr));
end if;
end if;
end if;
end process;
I wonder if the "else" which does your read is the problem. Single-port BRAM read is independent of writes (although of course they share the same address). Your code blocks the read during writes, and I wonder if the synthesis tools think you want something else.
Try this:
mybram : process (Clk)
begin
if rising_edge(clk) then
isEnabled : if (en = '1') then
isWrite : if (we = '1') then
memor(conv_integer(addr)) <= din;
endif isWrite:;
dout <= memor(conv_integer(addr));
end if isEnabled;
end if;
end process mybram;
----------------------------------------------------------------
Yes, I do this for a living.
Re: BRAM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-16-2009 09:43 PM
As per my knowledge, tool infers DRAM if read asynchronously (This is all xilinx guides say).
Re: BRAM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
08-16-2009 09:45 PM
>> Your code blocks the read during writes, and I wonder if the synthesis tools think you want something else.
The problem is that the code infers BRAM, but only the number of BRAMs are different when using RTL and coregen.
And i tried the code snippet, still the same result.











