首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

在ise综合时如何使用block ram

在ise综合时如何使用block ram

大家看看我得这个RAM程序,我用RAM_STYPE进行了约束,按理说,应该在综合时使用block ram才对,但是综合报告中却没有用block ram,这是为什么?


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;


entity ram is
    Port ( addra : in STD_LOGIC_VECTOR(8 downto 0);
           addrb : in STD_LOGIC_VECTOR(8 downto 0);
           clka : in std_logic;
           clkb : in std_logic;
           dina : in STD_LOGIC_VECTOR(10 downto 0);
           doutb : out STD_LOGIC_VECTOR(10 downto 0);
           ena : in std_logic;
           enb : in std_logic;
           wea : in std_logic);
     attribute ram_stype :string;
     attribute ram_stype of ram: entity is "block";
end ram;


architecture Behavioral of ram is


TYPE Blram IS ARRAY(0 to 512) OF STD_LOGIC_VECTOR(10 DOWNTO 0);
SIGNAL mm:Blram;


begin


p1:process(clka,ena,wea)
 begin
  if (ena='1' and wea='1') then
   if rising_edge(clka) then
   mm(conv_integer(addra))<= dina;
   end if;
  end if;
end process p1;


p2:process(clkb,enb)
begin
if (enb='1') then
 if rising_edge(clkb) then
  doutb <= mm(conv_integer(addrb));
 end if;
end if;
end process p2;


end Behavioral;

我写错了,是使用ram_style进行约束,综合报告中没有用block ram
我改了一下程序,可以了
综合报告里面显示使用的就是Block RAM。我改的地方就是把进程里面的两个IF语句调换了一下顺序,就可以了
但是我不知道为什么会这样?
返回列表