10.verilog 1
10.verilog 1
Verilog
• Verilog HDL
– General-purpose
– Easy to learn, easy to use
– Similar in syntax to C
– Allows different levels of abstraction and mixing them
– Supported by most popular logic synthesis tools
– Post-logic-synthesis simulation libraries by all fabrication
vendors
Design Flow
Trends in HDLs
Generating Checking
inputs Circuit Under Design outputs
to CUD (CUD) of CUD
4
8
Test bench
Design Methodologies
Levels of abstraction
• Verilog supported levels of abstraction
– Behavioral (algorithmic) level
• Describe the algorithm used
• Very similar to C programming
– Dataflow level
• Describe how data flows between registers and is processed
– Gate level
• Interconnect logic gates
– Switch level
• Interconnect transistors (MOS transistors)
• Register-Transfer Level (RTL)
– Generally known as a combination of behavioral+dataflow that is
synthesizable by EDA tools
Modules
module <module_name>(<module_terminal_list>);
...
<module internals>
...
endmodule
• Example:
module TFF(q,clock, reset);
...
<functionality of T_flipflop>
...
endmodule
Verilog Basic Building Block
• Module
endmodule
Instances
module ripple_carry_counter(q, clk, reset);
output [3:0] q;
input clk, reset;
endmodule
Module
Example (cont’d)
module stimulus;
reg clk; reg reset; wire[3:0] q;
Value Definition
Logic zero or
0
false
Logic one or
1
true
Unknown
x
logical value
High
z impedance of
tristate gate
Registers and nets
• NETS –
The nets variables represent the physical connection
between structural entities.
• These variables do not store values (except trireg);
have the value of their drivers which changes
continuously by the driving circuit.
• Some net data types are wire, tri, wor, trior, wand,
triand, tri0, tri1, supply0, supply1 and trireg.
• wire is the most frequently used type.
• A net data type must be used when a signal is: driven
by the output of some device.
• declared as an input or in-out port.
• on the left-hand side of a continuous assignment.
Registers and nets