自己用verilog代码写的rom或ram会被综合成查找表LUT+REG构建,并没有使用到block memory资源。

资料:https://www.intel.com/content/www/us/en/programmable/quartushelp/17.0/hdl/vlog/vlog_file_dir_ram.htm

ramstyle Verilog HDL Synthesis Attribute
A Verilog HDL synthesis attribute that controls the way an inferred RAM is implemented. Note: Analysis & Synthesis also recognizes the synonymous synthesis attribute syn_ramstyle. This synthesis attribute behaves identically to the ramstyle synthesis attribute.
To use the ramstyle attribute in a Verilog Design File (.v) Definition, specify the synthesis attribute delimited by (* and *) preceding the Variable Declaration of an inferred RAM whose implementation you want to control. Specify the synthesis attribute value as "logic", "no_rw_check", "M9K", "M20K", "M144K", "MLAB", or depending on the type of memory block you want the Quartus Prime software to use when implementing the inferred RAM. If you use the synthesis attribute on anything but a variable that represents a RAM, or if you specify an illegal value, the Quartus Primesoftware ignores that synthesis attribute. By setting the value to "M4K", "M9K", "M20K", "M144K", or "MLAB", you can choose the type of memory block that the Quartus Prime software uses when implementing the inferred RAM. If the attribute is set to "logic", then the RAM is implemented in logic cells. In addition to specifying the type of memory block for the RAM implementation, by setting the value to "no_rw_check", you can use the ramstyle attribute to indicate that you do not care about the output of the inferred RAM when there are simultaneous reads and writes to the same address. By default, the Quartus Prime software tries to create an inferred RAM with the same read-during-write behavior as your HDL source. In some cases, a RAM must be mapped into logic because it has a read-during-write behavior that is not supported by the memory blocks in your target device. In other cases, the Quartus Prime software must insert extra logic to mimic your read-during-write behavior, which can increase the resource requirements or reduce the performance of your design. Setting the "no_rw_check" value directs the Quartus Prime Compiler that the read-during-write behavior of the HDL source does not need to be preserved. Note: You can specify both a block-type and "no_rw_check" in a single attribute by separating the values with a comma, for example "no_rw_check, M144K", or you can specify only a block-type or "no_rw_check".
For example, in the following code, the ramstyle synthesis attribute specifies that the inferred RAM my_ram should be implemented using an : (* ramstyle = "M144K" *) reg [0:7] my_ram[0:63];
Note: You can also embed the ramstyle synthesis attribute in a comment following the Variable Declaration of an inferred RAM, as shown in the following code: reg [0:7] my_ram[0:63] /* synthesis ramstyle = "M144K" */;

可以选择板卡上的BLOCK RAM芯片型号,让手写的代码综合为block ram;设置为logic,则综合时会使用逻辑资源LUT+REG实现RAM。

除了为 RAM 实现指定内存块的类型之外,通过将值设置为“ no _ rw _ check”,您可以使用 ramstyle 属性来表明,当对同一地址同时进行读写操作时,您不关心推断出的 RAM 的输出。默认情况下,quartusprime 软件会尝试创建一个具有与您的 HDL 源相同的读写行为的推断 RAM。在某些情况下,RAM 必须映射到逻辑中,因为它具有写入期间的读取行为,而目标设备中的内存块不支持这种行为。在其他情况下,Quartus Prime 软件必须插入额外的逻辑来模拟在写入期间的读取行为,这可能会增加资源需求或降低设计的性能。设置“ no _ rw _ check”值指示 Quartus Prime 编译器不需要保留 HDL 源代码在写入过程中的读取行为。

您可以在单个属性中同时指定块类型和“ no _ rw _ check”,方法是用逗号分隔值,例如“ no _ rw _ check,M144K”,或者只指定块类型或“ no _ rw _ check”。

你也可以在推断出的 RAM 的变量声明之后的注释中嵌入 ramstyle synthesis 属性,如下面的代码所示:

reg [0:7] my_ram[0:63] /* synthesis ramstyle = "M144K" */;

Verilog设计指定寄存器数组在综合时使用block memory资源的更多相关文章

  1. 小白在使用ISE编写verilog代码综合时犯得错误及我自己的解决办法

    一:错误原因,顶层信号声明类别错误 错误前 更改后 二:综合时警告 更改前: 错误原因:调用子模块时 输出端口只能用wire类型变量进行映射 这是verilog语法规定的 tx_done在uart_t ...

  2. 硬件描述语言Verilog设计经验总结

    一.硬件描述语言Verilog 粗略地看Verilog与C语言有许多相似之处.分号用于结束每个语句,注释符也是相同的(/* ... */和// 都是熟悉的),运算符"=="也用来测 ...

  3. Verilog设计中的锁存器

    问题: 什么是锁存器? 什么时候出现锁存器? 锁存器对电路有什么影响? 如何在FPGA设计中避免锁存器? 在FPGA设计中应该避免锁存器.实际上,锁存器与D触发器实现的逻辑功能基本相同,都有暂存数据的 ...

  4. 数字逻辑实践3->EDA技术与Verilog设计

    本文属于EDA技术概述类文章 1 EDA技术及其发展 概念 EDA(Electronic Design Automation),指的是以计算机为工作平台,以EDA软件工具为开发环境,以PLD期间或者A ...

  5. 使用Synplify综合时保留logic

    在使用Synplify综合时,此工具会自动优化我的设计. 当然此功能有好有坏,最近有个项目需要使用Chipscope观察内部信号,打开inserter就懵了,信号列表中我的设计有的是名字被改了,有的是 ...

  6. 基于basys2驱动LCDQC12864B的verilog设计图片显示

    话不多说先上图 前言 在做这个实验的时候在网上找了许多资料,都是关于使用单片机驱动LCD显示,确实用单片机驱动是要简单不少,记得在FPGA学习交流群里问问题的时候,被前辈指教,说给我最好的指教便是别在 ...

  7. !干货! 为设计指定输入驱动强度 set_driving_cell set_drive set_input_transition

    !干货! 为设计指定输入驱动强度 set_driving_cell set_drive set_input_transition 本文转自:自己的微信公众号<集成电路设计及EDA教程> 里 ...

  8. Web API核查表:设计、测试、发布API时需思考的43件事[转]

    Web API核查表:设计.测试.发布API时需思考的43件事   当设计.测试或发布一个新的Web API时,你是在一个原有的复杂系统上构建新的系统.那么至少,你也要建立在HTTP上,而HTTP则是 ...

  9. 第二十四节:Java语言基础-讲解数组的综合应用

    数组的综合应用 // 打印数组 public static void printArray(int[] arr) { for(int x=0;x<arr.length;x++) { if(x!= ...

  10. Verilog设计Valid-Ready握手协议

    转自http://ninghechuan.com 我不生产知识,我只是知识的搬运工. Handshake Protocol握手协议!为了保证数据传输过程中准确无误,我们需要加上握手信号来控制信号的传输 ...

随机推荐

  1. Elasticsearch提示low disk watermark [85%] exceeded on [UTyrLH40Q9uIzHzX-yMFXg][Sonofelice][/Users/baid...

    mac本地启动es之后发现运行一段时间一分钟就能打印好几条info日志: [2018-03-13T10:15:42,497][INFO ][o.e.c.r.a.DiskThresholdMonitor ...

  2. gitlab修改代码提交后显示中文名称

    公司要求提交的代码能显示出是哪位提交的,所以要求显示中文名称以便统计工作 修改方法: 打开CMD命令提示符输入页面,输入修改指令: git config --global user.name &quo ...

  3. CentOS7下搭建JumpServer

    JumpServer 部署架构图 JumpServer 功能架构图 JumpServer 是广受欢迎的开源堡垒机,是符合 4A 规范的专业运维安全审计系统. JumpServer 使用 Python ...

  4. appium基本使用(Android)

    一.环境搭建 详情可见:https://www.cnblogs.com/lihongtaoya/p/16971096.html 二.元素定位 详情可见:https://www.cnblogs.com/ ...

  5. Java读取文件后文件被占用

    Java读取文件响应后文件一直被占用问题 原因: 由于是封装的函数,请求和响应对象都是 形参地址 虽然在此函数里关闭了输出流,但是由于有返回值,调用未结束,输出流无法提前关闭 解决: 1:调用函数后, ...

  6. 聊聊web漏洞挖掘第一期

    之前写2022年度总结的时候,有提到要给大家分享漏洞挖掘技巧.这里简单分享一些思路,更多的内容需要大家举一反三. 文章准备昨晚写的,昨天晚上出去唱歌,回来太晚了,耽搁了.昨天是我工作的last day ...

  7. [C++]bitwise和memberwise的区别

    在看<深入探索C++对象模型>这本书的时候,我看见了bitwise senimatics和memberwise senimatics,看的时候还不清楚这两个是什么意思,书本上直接使用的是英 ...

  8. SwiftUI(一)

    macOS 11.4 Xcode 12.5.1 1.新建工程,创建一个swiftui文件   2.创建后有些画布是在下面显示的     3.先来看下效果图   4. CardImageView.swi ...

  9. Linux C 打印变量数组内容到一个文件中的方法。

    思路: 1.以追加的方式新建打开一个文件 2.将buf 按字节,先将整型转换为字符串,之后写入到文件中. memset(tmp_buf, 0, sizeof(tmp_buf)); sprintf(tm ...

  10. ZXing CaptureActivity黑屏问题

    关于zxing captureActivity黑屏的问题,我在网上搜索一下,结果发现几乎没有这方面的资料.后来自己用了半天时间,独步跟踪调试,查看相机类的代码,最后发现了一点问题,就是关闭相机的时候没 ...