Chap10_Logic Synthesis with Verilog HDL
Chap10_Logic Synthesis with Verilog HDL
Digital Design
Content
Logic Synthesis
Impact of logic synthesis
Verilog HDL Synthesis
Synthesis design flow, Verification of Gate-Level
netlist
1
2024-12-26
2
2024-12-26
3
2024-12-26
4
2024-12-26
Verilog Constructs
Verilog Operators
Almost all operators in Verilog are allowed for logic
synthesis.
Table 14-2 is a list of the operators allowed. Only
operators such as === and !== that are related to x and z
are not allowed, because equality with x and z does not
have much meaning in logic synthesis.
While writing expressions, it is recommended that you
use parentheses to group logic the way you want it to
appear.
If you rely on operator precedence, logic synthesis tools
might produce an undesirable logic structure.
5
2024-12-26
6
2024-12-26
7
2024-12-26
8
2024-12-26
for loops
The for loops can be used to build cascaded
combinational logic. For example, the following for loop
builds an
8-bit full adder:
c = c_in;
for(i=0; i <=7; i = i + 1)
{c, sum[i]} = a[i] + b[i] + c; // builds an 8-bit ripple adder
c_out = c;
9
2024-12-26
An Example of RTL-to-Gates
Design specification
A magnitude comparator checks if one number is greater
than, equal to, or less than another number. Design a 4-
bit magnitude comparator IC chip that has the following
specifications:
The name of the design is magnitude_comparator
Inputs A and B are 4-bit inputs. No x or z values will appear
on A and B inputs
Output A_gt_B is true if A is greater than B
Output A_lt_B is true if A is less than B
Output A_eq_B is true if A is equal to B
The magnitude comparator circuit must be as fast as possible.
Area can be compromised for speed.
10
2024-12-26
RTL description
The RTL description that describes the magnitude comparator
is shown in Example 14-1. This is a technology independent
description. The designer does not have to worry about the
target technology at this point.
Example 14-1. RTL for Magnitude Comparator
//Module magnitude comparator
module magnitude_comparator(A_gt_B, A_lt_B, A_eq_B, A,
B);//Comparison output
output A_gt_B, A_lt_B, A_eq_B;
//4-bits numbers input
input [3:0] A, B;
assign A_gt_B = (A > B); //A greater than B
assign A_lt_B = (A < B); //A less than B
assign A_eq_B = (A == B); //A equal to B
endmodule
11
2024-12-26
Q&A
12