自己用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. RedisTemplate设置redis的key时出现\xac\xed\x00\x05t\x00\x0f前缀

    1.问题描述 使用redisTemplate设置redis的key-value,程序运行没有问题,但是却在redis客户端查不到设置的key-value. 2.产生原因 出现这种乱码前缀的原因是没有进 ...

  2. IOS14广告追踪

    今天回顾一个权限问题 1.工程中先导入一下两个框架 #import <AppTrackingTransparency/AppTrackingTransparency.h> #import  ...

  3. 【Redis实战专题】「性能监控系列」全方位探索Redis的性能监控以及优化指南

    Redis基本简介 Redis是一个开源(BSD 许可).内存存储的数据结构服务器,可用作数据库,高速缓存和消息队列代理.它支持字符串.哈希表.列表.集合.有序集合等数据类型.内置复制.Lua 脚本. ...

  4. 【Django drf】 序列化类常用字段类和字段参数 定制序列化字段的两种方式 关系表外键字段的反序列化保存 序列化类继承ModelSerializer 反序列化数据校验源码分析

    目录 序列化类常用字段类和字段参数 常用字段类 常用字段参数 选项参数 通用参数 序列化类高级用法之source source填写类中字段 source填写模型类中方法 source支持跨表查询 定制 ...

  5. while循環的一些判斷條件和讀取循環精簡方法

    while是入口條件循環 在進入循環體時必須要有獲取輸入數據并判斷的并檢查輸入數據的值,所以在while之前放一個scanf函數,讓循環繼續執行. 如果想讓循環繼續進行,那麽還需要在循環内設置一個讀取 ...

  6. JS循环类数组对象,获得页面所有的某个ClssaName,处理它的属性

    举例:获得所有的某个ClssaName,处理它的第一个子元素中的title赋值给内容 let links = Array.from(document.getElementsByClassName('m ...

  7. 生成1-n之间的随机数-猜数字小游戏

    生成1-n之间的随机数 获取随机数 获取1-n之间的随机数,包含n,代码如下: // 导包 import java.util.Random; public class Test01Random { p ...

  8. qt获取子控件坐标

    QPoint pos = ui->m_blt->mapToGlobal(QPoint(0, 0)); 就可以了.

  9. python开发简单的命令行工具

    介绍 Python模块argparse,这是一个命令行选项,参数和子命令的解释器,使用该模块可以编写友好的命令行工具,在程序中定义好需要的参数,argparse将弄清楚如何解析 sys.argv中的参 ...

  10. 论文翻译:2022_Time-Shift Modeling-Based Hear-Through System for In-Ear Headphones

    论文地址:基于时移建模的入耳式耳机透听系统 引用格式: 摘要 透传(hear-through,HT)技术是通过增强耳机佩戴者对环境声音的感知来主动补偿被动隔离的.耳机中的材料会减少声音 500Hz以上 ...