当前位置:网站首页>synthesizable之Verilog可不可综合
synthesizable之Verilog可不可综合
2022-07-23 22:06:00 【深色瞳孔】
1.可综合与不可综合语句汇总:
(1)所有综合工具都支持的结构:always,assign,begin,end,case,wire,tri,aupply0,supply1,reg,integer,default,for,function,and,nand,or,nor,xor,xnor,buf,not,bufif0,bufif1,notif0,notif1,if,inout,input,instantitation,module,negedge,posedge,operators,output,parameter。
(2)所有综合工具都不支持的结构:time,defparam,$finish,fork,join,initial,delays,UDP,wait。
(3)有些工具支持有些工具不支持的结构:casex,casez,wand,triand,wor,trior,real,disable,forever,arrays,memories,repeat,task,while。
2.建立可综合模型的原则
要保证Verilog HDL赋值语句的可综合性,在建模时应注意以下要点:
(1)不使用initial。
(2)不使用#10。
(3)不使用循环次数不确定的循环语句,如forever、while等。确定循环次数时可用多次例化调用或者使用generate_genvar_endgenerate语句
(4)不使用用户自定义原语(UDP元件)。
(5)尽量使用同步方式设计电路。
(6)除非是关键路径的设计,一般不采用调用门级元件来描述设计的方法,建议采用行为语句来完成设计。
(7)用always过程块描述组合逻辑,应在敏感信号列表中列出所有的输入信号,或直接(*)。
(8)所有的内部寄存器都应该能够被复位,在使用FPGA实现设计时,应尽量使用器件的全局复位端作为系统总的复位。
(9)对时序逻辑描述和建模,应尽量使用非阻塞赋值方式。对组合逻辑描述和建模,既可以用阻塞赋值,也可以用非阻塞赋值。但在同一个过程块中,最好不要同时用阻塞赋值和非阻塞赋值。
(10)不能在一个以上的always过程块中对同一个变量赋值。而对同一个赋值对象不能既使用阻塞式赋值,又使用非阻塞式赋值。
(11)如果不打算把变量推导成锁存器,那么必须在if语句或case语句的所有条件分支中都对变量明确地赋值。
(12)避免混合使用上升沿和下降沿触发的触发器。
(13)同一个变量的赋值不能受多个时钟控制,也不能受两种不同的时钟条件(或者不同的时钟沿)控制。
(14)避免在case语句的分支项中使用x值或z值,但可以用。
3.不可综合verilog语句
1、initial 只能在test bench中使用,不能综合。
2、events event在同步testbench时更有用,不能综合。
3、real 不支持real数据类型的综合。
4、time 不支持time数据类型的综合。
5、force 和release 不支持force和release的综合。
6、assign 和deassign 不支持对reg 数据类型的assign或deassign进行综合,支持对wire数据类型的assign或deassign进行综合。
7、fork join 不可综合,可以使用非块语句达到同样的效果。
8、primitives 支持门级原语的综合,不支持非门级原语的综合。
9、table 不支持UDP 和table的综合。
10、敏感列表里同一信号同时带有posedge和negedge
如:always @(posedge clk or negedge clk) begin…end
这个always块不可综合。
如:always @(posedge clk or negedge rst_n) begin…end
这个always块可综合。
11、同一个reg变量被多个always块驱动,易引发竞争冒险
12、延时 以#开头的延时不可综合成硬件电路延时,综合工具会忽略所有延时代码,但不会报错。
如:a=#10 b;
这里的#10是用于仿真时的延时,在综合的时候综合工具会忽略它。也就是说,在综合的时候上式等同于a=b;
13、与X、Z的比较 可能会有人喜欢在条件表达式中把数据和X(或Z)进行比较,殊不知这是不可综合的,综合工具同样会忽略。所以要确保信号只有两个状态:0或1。

边栏推荐
猜你喜欢

Principle and implementation of hash table, unordered set and mapping

众邦科技又一潜心力作 —— 陀螺匠 OA 系统

Cookies and sessions

STM32+ESP8266+MQTT协议连接阿里云物联网平台

LeetCode高频题62. 不同路径:机器人从左上角到右下角的路径有多少条?纯概率排列组合问题,而不是动态规划题
![[hiflow] Tencent cloud's new generation of automation assistant, which I used to complete the enterprise epidemic prompt (no code)](/img/8a/52ef97e43c4b06e08ab826f4e46501.png)
[hiflow] Tencent cloud's new generation of automation assistant, which I used to complete the enterprise epidemic prompt (no code)

Openlayers instance advanced view positioning advanced view positioning
![[mathematical modeling summer training] location of distribution center](/img/d5/c9b4de6750a7ed080c194250629467.png)
[mathematical modeling summer training] location of distribution center

阿里onedate分层思想

How to use cesium knockout?
随机推荐
怎么开户买收益百分之六的理财产品呢?
【AcWing】周赛
Pulsar open source message queue_ Understand pulsar --- pulsar work notes 001
给定一个以数字组成的数组,实现输出id为数字,并且从小到大排序的name
Openlayers instance advanced view positioning advanced view positioning
How does MySQL prepare SQL (solve the problem that in query SQL preprocessing can only query one record)
Postgraduate entrance examination | advanced mathematics Chapter4 indefinite integral
软件体系结构期末复习六十题
Leetcode high frequency question 53. maximum subarray sum, continuous subarray with maximum sum, return its maximum sum
How to completely force the killing of background unrelated processes?
LeetCode高频题53. 最大子数组和,具有最大和的连续子数组,返回其最大和
Golang invalid argument to intn报错的解决
还在为XShell破解烦恼,试试tabby
欧氏聚类(API)及其单木分割
开源分布式链路追踪对比
Complete set of official openlayers instances
JMeter performance comprehensive practice - sign in and batch sign in
MySQL索引事务
【golang学习笔记】并发基础
Leaderboard design in game server