Resource (FMAPs) use when using block RAMs

Hello,

I am trying to get acquainted with the amount of logic it takes to implement common structures to an FPGA. I built a simple VHDL 2x16bit memory like follows and targeted it to a xc4013 device (which includes block RAMs)

---- entity mem is port( Dr: in std_logic_vector(15 downto 0); wr: in std_logic; clock: in std_logic; clear: in std_logic; Rr: out std_logic_vector(15 downto 0); Ad: in std_logic_vector(1 downto 0) ); end mem;

------------------------------------------------------------------ architecture behv of mem is type ram_type is array (0 to 3) of std_logic_vector(15 downto 0); signal tmp_ram1_r: ram_type; begin process(clock, clear) begin if clear = '1' then -- do nothing elsif (clock='1' and clock'event) then if (wr='1') then tmp_ram1_r(conv_integer(Ad))

Reply to
ra_arce
Loading thread data ...

Reply to
Ken McElvain

It appears to me that you are trying to implement a wide, but shallow RAM, like 16 bits wide (in parallel) and 2 addresses deep. That's not the way the LUT-RAMs are organized. Each LUT is 1 bit wide and 16 addresses deep. So you can read or write one bit, but you can sequentially and randomly address 16 locations. Does that make things clarer ? Peter Alfke, Xilinx Applications

Reply to
Peter Alfke

Reply to
Rafael Arce

Thanks for your responses.

I guess one or more of the following assumptions that I am making about single port RAMs must be wrong:

  1. single port RAMs are separate entities from common CLBs
  2. single port RAMs contain all the necesary logic to implement read/write of 1 bit to any of 16 addresses.
  3. synplify uses the FMAPs quantity to report only on common CLB LUTs.

This why I can understand that Synplify says that 16 single port RAMs are needed. I can also understand that 1 LUT is being used for wirte enable. But, based on these assumptions, I still can't understand the extra 16 LUTs.

Which of my assumptions are incorrect?

Thanks again, Rafael

Reply to
Rafael Arce

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.