Verilog基本模型(Basic Modelling)
Verilog的基本组成单元为模组(Module)。
语法(Syntax)
模组关键字 模组名 [ ( 端口列表 ) ];
模组组成项;
endmodule
模组关键字 = module | macromodule
module_word module_name [ ( port_list ) ];
module_items;
endmodule
module_word = module | macromodule
例程(Example)
module Mod1(A, B, C);
input A, B;
ouput C;
assign C = A & B;
endmodule
原语(Primitives)
原语极为小的元件,Verilog中有些内置的原语(built-in primitives),即门模型和开关模型。用户可以自己定义原语(UDP User Defined Primitives)。
Built-in Primitives
语法
gate_type [ ( strength ) ] [ #( delay ) ] [ instance_name ] [ instance_range ] ( terminal, terminal, ... );
switch_type [ #( delay ) ] [ instance_name ] [ instance_range ] ( terminal, terminal, ... );
内置原语列表如下:
Name |
Gate Type |
Terminals |
Logic |
and, nand, or, nor,xor, xn |