Verilog设计指定寄存器数组在综合时使用block memory资源
自己用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资源的更多相关文章
- 小白在使用ISE编写verilog代码综合时犯得错误及我自己的解决办法
		一:错误原因,顶层信号声明类别错误 错误前 更改后 二:综合时警告 更改前: 错误原因:调用子模块时 输出端口只能用wire类型变量进行映射 这是verilog语法规定的 tx_done在uart_t ... 
- 硬件描述语言Verilog设计经验总结
		一.硬件描述语言Verilog 粗略地看Verilog与C语言有许多相似之处.分号用于结束每个语句,注释符也是相同的(/* ... */和// 都是熟悉的),运算符"=="也用来测 ... 
- Verilog设计中的锁存器
		问题: 什么是锁存器? 什么时候出现锁存器? 锁存器对电路有什么影响? 如何在FPGA设计中避免锁存器? 在FPGA设计中应该避免锁存器.实际上,锁存器与D触发器实现的逻辑功能基本相同,都有暂存数据的 ... 
- 数字逻辑实践3->EDA技术与Verilog设计
		本文属于EDA技术概述类文章 1 EDA技术及其发展 概念 EDA(Electronic Design Automation),指的是以计算机为工作平台,以EDA软件工具为开发环境,以PLD期间或者A ... 
- 使用Synplify综合时保留logic
		在使用Synplify综合时,此工具会自动优化我的设计. 当然此功能有好有坏,最近有个项目需要使用Chipscope观察内部信号,打开inserter就懵了,信号列表中我的设计有的是名字被改了,有的是 ... 
- 基于basys2驱动LCDQC12864B的verilog设计图片显示
		话不多说先上图 前言 在做这个实验的时候在网上找了许多资料,都是关于使用单片机驱动LCD显示,确实用单片机驱动是要简单不少,记得在FPGA学习交流群里问问题的时候,被前辈指教,说给我最好的指教便是别在 ... 
- !干货! 为设计指定输入驱动强度 set_driving_cell set_drive set_input_transition
		!干货! 为设计指定输入驱动强度 set_driving_cell set_drive set_input_transition 本文转自:自己的微信公众号<集成电路设计及EDA教程> 里 ... 
- Web API核查表:设计、测试、发布API时需思考的43件事[转]
		Web API核查表:设计.测试.发布API时需思考的43件事 当设计.测试或发布一个新的Web API时,你是在一个原有的复杂系统上构建新的系统.那么至少,你也要建立在HTTP上,而HTTP则是 ... 
- 第二十四节:Java语言基础-讲解数组的综合应用
		数组的综合应用 // 打印数组 public static void printArray(int[] arr) { for(int x=0;x<arr.length;x++) { if(x!= ... 
- Verilog设计Valid-Ready握手协议
		转自http://ninghechuan.com 我不生产知识,我只是知识的搬运工. Handshake Protocol握手协议!为了保证数据传输过程中准确无误,我们需要加上握手信号来控制信号的传输 ... 
随机推荐
- 事件 jQuery类库、Bootstrap页面框架
			目录 jQuery查找标签 基本选择器 组合选择器 层级选择器 属性选择器 基本筛选器 表单筛选器 筛选器方法 链式的本质(jQuery一行代码走天下) 操作标签 class操作 位置操作 文本操作 ... 
- 前端h5适配刘海屏和滴水屏
			前端适配苹果刘海屏,安卓刘海屏水滴瓶 其实w3c早就为我们提供了解决方法(CSS3新特性viewport-fit) 在w3c.org官方给出的关于圆形展示(Round display)的标准中, 提到 ... 
- JavaScript:如何知道一个变量的数据类型?:typeof
			使用typeof去查看一个变量的数据类型,如下图所示,展示了JS的七大基础数据类型和对象: 这里有必要提一下: 函数也是一个对象,但是函数的特殊性,使得在使用typeof去判断其类型的时候,会输出fu ... 
- 使用time.Time数据类型获取时间报错
			报错类型:Error 1292: Incorrect datetime value: '0000-00-00' for column 'created_at' at row 1 在添加用户到数据库时, ... 
- Linux安装&卸载mysql5.7
			Linux系统下卸载mysql 停止mysql服务 systemctl stop mysqld.service 查看安装的mysql服务 rpm -qa|grep -i mysql 删除安装的mysq ... 
- 如何使用Redis和RabbitMQ实现一个学生抢课系统(可类比商品秒杀系统)
			1.如何使用Redis和RabbitMQ实现一个学生抢课系统(可类比商品秒杀系统) 电商项目中的秒杀场景我们都很常见,不只是京东和淘宝现在很多的小程序公众号也有做现时限购的秒杀场景,那么如何做一个秒杀 ... 
- Windows 平台计算 CPU 总利用率
			利用 GetSystemTimes 可以获得 Windows 系统的 Idle Time. Kernel Time 和 User Time.Idle Time 是系统空闲的时间,也就是系统没有利用的时 ... 
- Java程序员用代码,计算最大公约数和最小公倍数
			作者:小傅哥 博客:https://bugstack.cn 源码:https://github.com/fuzhengwei/java-algorithms 沉淀.分享.成长,让自己和他人都能有所收获 ... 
- AtCoder Beginner Contest 282 G - Similar Permutation
			套路题 题意 求有多少个 \(1\) 到 \(n\) 的排列满足恰有 \(k\) 对在排列中相邻的数满足前小于后 \(2 \leq n \leq 500, 0 \leq k \leq (n - 1)\ ... 
- 分布式协议与算法-Quorum NWR
			1.强一致性与最终一致性 1.1强一致性 强一致性能保证写操作完成后,任何后续访问都能读到更新后的值:强一致性可以保证从库有与主库一致的数据.如果主库突然宕机,我们仍可以保证数据完整.但如果从库宕机或 ... 
