自己用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. appium基本使用(Android)

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

  2. 升级csproj文件为vs2017工程格式(SDK样式)

    csproj文件在VS2017后格式变更为SDK样式.framework项目如果需要源链接等等功能,需要进行手动升级. 升级过程 升级需要Project2015To2017Nuget包. > d ...

  3. Axure 环境进度条

    步骤一:拖拉摆放好相关控件 1.4个半圆环,一个白色上半圆环 (上白),一个白色下半圆环 (下白),一个灰色上半圆环 (上灰),一个灰色下半圆环 (下灰),排放层次为: 下灰<下白<上灰& ...

  4. 图文并茂记录下重新配置Win10系统Flutter环境--内含Android Studio 下载安装教程

    Flutter 是什么 Flutter是Google开源的构建用户界面(UI)工具包,帮助开发者通过一套代码库高效构建多平台精美应用,支持移动.Web.桌面和嵌入式平台.Flutter 开源.免费,拥 ...

  5. vivo 超大规模消息中间件实践之路

    作者:vivo 互联网存储技术团队-Luo Mingbo.中间件团队- Liu Runyun 本文根据"2022 vivo开发者大会"现场演讲内容整理而成. 本文主要介绍超大数据规 ...

  6. css边框,盒子模型、浮动、定位

    边框,盒子模型.浮动.定位 一.边框 border-width : 边框宽度 border-style : 边框样式 1.solid 实线 2.none 无边框 3.dotted 点状虚线边框 4.d ...

  7. 解决Java.awt设计GUI程序时Label标签中文乱码解决(idea)

    未修改时对话框里边无法显示Label的文本内容,显示的都是方框!网上都是Run--Edit Configurations--VM options:填入-Dfile.encoding=gbk 但是我实际 ...

  8. Java自动装箱与拆箱

    装箱就是自动将基本数据类型转换为包装器类型(int-->Integer).调用方法:Integer的 valueOf(int) 方法 拆箱就是自动将包装器类型转换为基本数据类型(Integer- ...

  9. 穿透的switch语句-循环概述与基本组成部分

    穿透的switch语句 在switch语句中,如果case的后面不写break,将出现穿透现象,也就是不会在判断下一个case的值,直接向后运 行,直到遇到break,或者整体switch结束. pu ...

  10. 【随笔记】NDK 编译开源库 ffmpeg

    一.下载源代码 wget http://ffmpeg.org/releases/ffmpeg-4.4.tar.gz tar -zxvf ffmpeg-4.4.tar.gz 二.编译配置脚本 #! /b ...