Verilog关键字Keyword

1、关键字(Keyword):小写字母定义

Keyword(红色不可综合 说明 举例
 always    
 and 与门  
 assign 1、连续赋值语句(Continuous Assignments)  
2、连续赋值(Continuous Assignments)、过程赋值(Procedural Assignments)和过程性连续赋值(Procedural Continuous Assignments)的区别  
3、左侧被赋值的数据类型必须是标量或者线网型数据(wire),wire 型变量只能被赋值一次  
 begin

1、begin……end顺序块用于把多个声明语句组合起来,其中每个声明语句是按顺序执行的(非阻塞赋值除外)。

 

2、如果begin……end顺序块包含局部声明,则必须被命名(即必须有一个标识),通过层次名引用的方法对变量进行访问

 
 buf    
 bufif0    
 bufif1    
 case

With variables as cases, more than one may be true, but the verilog language definition is that only the first true case will be executed. 

注意full_case,parallel_case的使用场景和方法

 
 casex 部分工具可综合  
 casez 部分工具可综合  
 cmos    
 deassign    
 default    
 defparam    
 disable    
 edge    
 else    
 end    
 endcase    
 endfunction    
 endmodule    
 endprimitive    
 endspecify    
 endtable    
 endtask    
 event    
 for    
 force    
 forever 循环次数不确定则不可综合  
 fork    
 function    
 generate(Verilog-2005) 1、当例化多个相同的模块时,一个一个的手动例化比较繁琐,用 generate 进行多个模块的重复例化,可大大简化程序的编写过程  
2、循环变量i必须是genvar类型的,不可以是reg型,integer型  
 highz0    
 highz1    
 if    
 ifnone    
 initial    
 inout    
 input    
 integer

integer类型也是一种寄存器数据类型,integer类型的变量为有符号数,而reg类型的变量则为无符号数

integer类型转换成无符号数的技巧,即利用拼接操作符{}:{$random}

 
 join    
 large    
 localparam(Verilog-2001)    
 macromodule    
 medium    
 module    
 nand    
 negedge    
 nmos    
 nor    
 not    
 notif0    
 notif1    
 or    
 output    
 parameter    
 pmos    
 posedge    
 primitive    
 pull0    
 pull1    
 pulldown    
 pullup    
 rcmos    
 real 实数real不可综合,整数integer可综合  
 realtime    
 reg    
 release    
 repeat    
 rnmos    
 rpmos    
 rtran    
 rtranif0    
 rtranif1    
 scalared    
 small    
 specify    
 specparam    
 strength    
 strong0    
 strong1    
 supply0    
 supply1    
 table    
 task    
 time    
 tran    
 tranif0    
 tranif1    
 tri    
 tri0    
 tri1    
 triand    
 trior    
 trireg    
 vectored    
 wait    
 wand    
 weak0    
 weak1    
 while 循环次数不确定则不可综合  
 wire    
 wor    
 xnor 同或  
 xor 异或  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2、可综合

(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,$finish,fork,join,initial,delays,UDP,wait。
(3)有些工具支持有些工具不支持的结构:casex,casez,wand,triand,wor,trior,real,disable,forever,arrays,memories,repeat,task,while。

要保证Verilog HDL赋值语句的可综合性,在建模时应注意以下要点:
    (1)不使用initial。
    (2)不使用#10。
    (3)不使用循环次数不确定的循环语句,如forever、while等。
    (4)不使用用户自定义原语(UDP元件)。
    (5)尽量使用同步方式设计电路。
    (6)除非是关键路径的设计,一般不采用调用门级元件来描述设计的方法,建议采用行为语句来完成设计。
    (7)用always过程块描述组合逻辑,应在敏感信号列表中列出所有的输入信号。
    (8)所有的内部寄存器都应该能够被复位,在使用FPGA实现设计时,应尽量使用器件的全局复位端作为系统总的复位。
    (9)对时序逻辑描述和建模,应尽量使用非阻塞赋值方式。对组合逻辑描述和建模,既可以用阻塞赋值,也可以用非阻塞赋值。但在同一个过程块中,最好不要同时用阻塞赋值和非阻塞赋值。
    (10)不能在一个以上的always过程块中对同一个变量赋值。而对同一个赋值对象不能既使用阻塞式赋值,又使用非阻塞式赋值。
    (11)如果不打算把变量推导成锁存器,那么必须在if语句或case语句的所有条件分支中都对变量明确地赋值。
    (12)避免混合使用上升沿和下降沿触发的触发器。
    (13)同一个变量的赋值不能受多个时钟控制,也不能受两种不同的时钟条件(或者不同的时钟沿)控制。
    (14)避免在case语句的分支项中使用x值或z值。

 

posted @ 2023-07-29 09:04  NEWICER  阅读(244)  评论(0)    收藏  举报