Verilog简明语法:Verilog语法总结

Verilog语法总结

1,典型的Verilog模块结构

cpp 复制代码
//	1,典型的	Verilog模块结构
module	M(P1, P2, P3, P4);
input			P1, P2;
output	[7:0]	P3;
inout			P4;

reg		[7:0]	R1, M1 [1:1024];
wire	W1, W2, W3, W4;

parameter		C1 = "This is a string";
initial		
begin : 块名
		//	声明语句

end

always@(触发事件)
begin
//	声明语句


end

//	连续赋值语句
assign	W1 = Expression;

wire	(Strong1, Weak0)	[3:0]	#(2, 3)	W2 = Expression;	//	???

//	模块实例引用
COMP	U1(W3,	W4);
COMP	U2(.P1(W3),		.P2(W4));

task	T1;				//	任务定义
	input	A1;
	inout	A2;
	output	A3;
		begin
				//	声明语句
		end
endtask

function	[7:0]	F1;		//	函数定义
	input	A1;
		begin
							//	声明语句
			F1 = 表达式;
		end

endfunction

endmodule	//	模块结束

2,声明语句

cpp 复制代码
//	2,声明语句
#delay
wait(Expression)
@(A or B or C)
@(posedge	Clk)
	Reg	 	=  Expression;
	Reg		<= Expression;

VectorReg[Bit]		= Expression;
VectorReg[MSB:LSB]	= Expression;
Memory[Address]		= Expression;

assign	Reg		= Expression;
deassign	Reg;

TaskEnable(...),
disable		TaskOrBlock;
EventName;

if(Condition)
...
else if(Condition)
...
else
...

case(Selection)
Choice1:
...

Choice2, Choice3:
...

default:
...

endcase

for(I = 0; I < MAX; I = I + 1)
...
	repeat(8)
...

while(Condition)
...

forever
...

3,Verilog语法总结的价值

上面简要语法总结可供读者快速查找,应注意其语法表示方法与本手册中其它地方的不同。

相关推荐
s09071361 天前
FPGA中CIC设计注意事项
算法·fpga开发·cic滤波器
Aaron15881 天前
RFSOC+VU13P在无线信道模拟中的技术应用分析
数据结构·人工智能·算法·fpga开发·硬件架构·硬件工程·射频工程
碎碎思1 天前
BerkeleyLab Bedrock:为 FPGA 与加速计算打造的开源基石
fpga开发·开源
zidan14121 天前
xilinx常用文档说明
fpga开发
ShiMetaPi1 天前
GM-3568JHF丨ARM+FPGA异构开发板系列教程:外设教程 04 WIFI
网络·arm开发·fpga开发·智能路由器·fpga
FPGA_小田老师1 天前
FPGA基础知识(二十):Xilinx Block Memory IP核(5)--ROM 详解
fpga开发·rom·coe文件格式·导入coe·block memory
FPGA_无线通信1 天前
压缩解压缩算法 BFP-8bit
fpga开发
红糖果仁沙琪玛1 天前
AD7616驱动开发-FPGA
驱动开发·fpga开发
坏孩子的诺亚方舟1 天前
FPGA系统架构设计实践13_FPGA系统功能安全
fpga开发·系统架构·功能安全概念
ALINX技术博客2 天前
【新品解读】5G/6G 基带系统级验证,AXVU13G 如何缩短高速系统研发周期
5g·fpga开发·fpga