zoukankan      html  css  js  c++  java
  • FPGA 的 RAM 的 区别

    FPGA 上有两种RAM, BLock Ram 和 Distributed Ram。

    Block Ram:

    1、bram是FPGA 中定制的ram资源。位置是固定的,例如BRAM就是一列一列分布的,这就可能造成用户逻辑和BRAM之间的route延时比较长。举个最简单的例子,在大规模FPGA中,如果用光所有的BRAM,性能一般会下降,甚至出现route不通的情况,就是这个原因。灵活的运用BRAM和distributed RAM可以有效利用FPGA资源,提升性能。如果需要用较多的BRAM,合理规划布局也可以提升性能,可以使用Planahead进行布局规划。

    2、bram 的输出需要时钟

    3、较大的存储应用,建议用bram;零星的小ram,一般就用dram。但这只是个一般原则

    Distributed Ram:

    1、dram就是用逻辑单元拼出来的,会浪费LUT 资源。

    2、dram可以是纯组合逻辑,即给出地址马上出数据,也可以加上register变成有时钟的ram。

    CLB举例:

    xilinx spartan3an系列fpga:
           一个CLB包含4个SLICE,其中左边两个SLICE可用于存储、移位寄存器和逻辑配置,称为SLICEM;右边的两个SLICE只能用于逻辑组合,称为SLICEL。每个SLICE中有2个LUT,2个存储单元,多路复用器,进位链等。一个LUT和一个存储单元称为一个LOGIC CELL,因此通常一个SLICE等效于2.25个LOGIC CELL。

    在Xilinx中,有两种LUT,一种是可以作为Distributed RAM的,另一种只能作为LUT的。块RAM是比较大块的RAM,即使用了它的一小部分,那么整个Block RAM就不能再用了。所以,要用的RAM是小的,时序要求不高的要用Distributed RAM,节省资源。

    1、使用IP core generator 

    IP core generator 有两种memory生成工具, Distributed Memory Generator 和 Block Memory Genertor。这样,根据需要指定使用哪一类RAM。

    2、使用硬件语言编程

         使用verilog 或者VHDL自己写一个模块,在综合的时候会自动调用Block Bram实现。

         用硬件语言写的RAM是综合成Distributed memory 还是Bram 是根据缩写的代码决定的。如果想采用distributed memory, 可以使用ram_stryle 指定。

         Xilinx's XST will infer block RAM if the read address is registered inside the module. Setting the ram_style attribute to block or absence of the attribute has no effect. If the read address is not registered or the ram_style attribute is set to distributed, distributed RAM will be inferred. Registering the write data & address or the read output have no effect on block RAM vs. distributed RAM. (Note: the first "s" in synthesis must be lower case.)

       When you declare a RAM in your code, XST(Xilinx synthesizer tool) may implement it as either block RAM or distributed RAM depend on your code. But if you want, you can force the implementation style to use block RAM or distributed RAM resources. This is done using the ram_style constraint. 例子见:

    http://vhdlguru.blogspot.nl/2011/01/block-and-distributed-rams-on-xilinx.html

    自己写的使用是使用reg 类型,至于怎么综合看代码是如何是实现的。 

    猛然发现,我要实现的不是RAM,而是一个可以单次写一个,单次读多个的一个寄存器组。而RAM每次只能读一个地址,⊙﹏⊙b汗

    高山仰止,景行行止。虽不能至,然心向往之。
  • 相关阅读:
    大三上寒假15天--第6天
    大三上寒假15天--第5天
    大三上寒假15天--第4天
    大三上寒假15天--第3天
    selenium(python)登录时账号密码错误提示语
    selenium(python)用HTMLTestRunner导出报告(断言)信息的显示
    Jmeter打开url时提示“请在微信客户端打开链接问题”
    python(unittest)报告导出(二):使用 BeautifulReport导出
    python(unittest)报告导出(一):使用HTMLTestRunner导出
    selenium+python+unittest:一个类中只执行一次setUpClass和tearDownClass里面的内容(可解决重复打开浏览器和关闭浏览器,或重复登录等问题)
  • 原文地址:https://www.cnblogs.com/xingzifei/p/4883911.html
Copyright © 2011-2022 走看看