1位宽存储器阵列

时间:2015-07-07 11:05:50

标签: vhdl ram

我正在使用ISE 14.7,我正在尝试使用一些1位宽的分布式RAM模块进行设计。

我的记忆声明:

type tyMemory is array (0 to MEMORY_NUM - 1) of std_logic_vector(MEMORY_SIZE - 1 downto 0) ;
signal Memory: tyMemory := ( others => (others => '0')) ;
attribute ram_style : string ;
attribute ram_style of Memory : signal is "distributed" ;

我的代码:

MemoryGen : for i in 0 to MEMORY_NUM - 1 generate
    process( CLK )
    begin
        if rising_edge(CLK) then
            if CE = '1' then
                DataOut(i) <= Memory(i)(Addr(i)) ;
                Memory(i)(Addr(i)) <= DataIn(i) ;
            end if ;
        end if ;
    end process ; 
end generate ;

合成后,我收到了这个警告:

WARNING:Xst:3012 - Available block RAM resources offer a maximum of two write ports. 
You are apparently describing a RAM with 16 separate write ports for signal <Memory>. 
The RAM will be expanded on registers.

如何使xst使用size = ARRAY_LENGTH且width = 1的分布式内存块?

我可以创建和使用单独的内存组件(并且可以工作),但我需要更优雅的解决方案。

2 个答案:

答案 0 :(得分:1)

您需要创建一个描述可变长度1位宽内存的实体,然后使用generate语句创建这些内存的数组。虽然您所做的工作将提供您在模拟器中所要求的功能,但如果您的代码以某种方式编写,大多数FPGA工具将只提取存储器元素。

通过在http://www.xilinx.com/support/documentation/sw_manuals/xilinx14_7/ise_n_xst_user_guide_v6s6.htm为您的设备选择适当的文档,您可以找到有关Xilinx ISE工具将作为存储元件理解的代码的文档。查看“HDL编码技术”。

请注意,如果您的内存长度较大,则无法在不添加手动流水线操作的情况下从中获得最大性能。如果您的内存超过分布式内存的预期有用最大长度,我想您会得到一条综合消息。假设您使用的是Spartan 6设备,您可以在此处找到有用支持的分布式内存大小的信息:http://www.xilinx.com/support/documentation/user_guides/ug384.pdf第52页。

答案 1 :(得分:0)

这应该推断出16位宽的BlockRAM:

architecture ...
  attribute ram_style : string;

  subtype tyMemory is std_logic_vector(MEMORY_SIZE - 1 downto 0) ;

begin
  genMem : for i in 0 to MEMORY_NUM - 1 generate
    signal Memory : tyMemory := (others => '0');
    attribute ram_style of Memory : signal is "block";
  begin
    process(clk)
    begin
      if rising_edge(clk) then
        if CE = '1' then
          Memory(Addr(i)) <= DataIn(i) ;
          DataOut(i) <= Memory(Addr(i)) ;
        end if ;
      end if ;
    end process ; 
  end generate ;
end architecture;
相关问题