Computer-Aided Design For Digital Systems
Computer-Aided Design For Digital Systems
For
Digital Systems
In the beginning…
“Integrated Circuits” with transistors and interconnecting
wires on the same semiconductor substrate date from
the early 1960’s. Early IC’s used bipolar transistors and
“transistor-transistor logic” (TTL).
VDD
A
B
A Out
Out
B
GND
Schematic symbols generally had a 1:1 relationship with
low-level implementations (transistor patterns)
A
B
Schematic entry included hierarchy, where lower- C
VHDL was born, and was in widespread use by the time IEEE
released a spec in 1987.
Gateway Design Automation noticed, and released Verilog as a
commercial product in 1990.
Background
Verilog is based on C, and is simpler than VHDL. It rapidly became
the market leader, even though it was expensive.
By mid 1990’s, synthesis had proven it’s worth, and became the
major force behind HDL adoption.
endmodule
History
void bubbleSort(int a[], int n)
{
HDL’s are not sequential int i, j;
for (i = 0; i < n-1; i++)
programming languages like C or for (j = 0; j < n-i-1; j++)
if (a[j] > a[j+1])
Java that describe algorithms using {
int temp = a[j];
step-by-step processes. a[j] = a[j+1];
a[j+1] = temp;
}
}
History
void bubbleSort(int a[], int n)
{
HDL’s are not sequential int i, j;
for (i = 0; i < n-1; i++)
programming languages like C or for (j = 0; j < n-i-1; j++)
if (a[j] > a[j+1])
Java that describe algorithms using {
int temp = a[j];
step-by-step processes. a[j] = a[j+1];
a[j+1] = temp;
}
}
A
HDL’s describe circuits. They can be B
C
simulated or synthesized, but they do X
not result in an executable (object) file
Behavioral vs. Structural Models
More involved designs are hierarchical, with top-level designs built from
lower-level blocks. Low-level “leaf” blocks are typically use behavioral
HDL, and these are assembled into systems using structural HDL.
Behavioral vs. Structural Models
A
module example (input A, B, C, output X); B
C
assign X = (!A | B | C) & (B | C) & (!A | B | !C); X
endmodule
Behavioral
endmodule Structural
Behavioral vs. Structural Models
Behavioral HDL defines outputs as functions of inputs, without describing any circuit
components that might be used in constructing the circuit.
Structural HDL is a form of netlist, defining a circuit as a collection of subordinate
components and their interconnecting wires.
A B C Y I$001: INV(B,N$001)
Drive an output B
0 0 0 0 signal Y to a 1 C I$002: AND2(N$001,C,N$002)
0 0 1 1 Y I$003: INV(C,N$003)
0 1 0 0 whenever input B is
not asserted at the A I$004: AND2(A,N$003,N$004)
0 1 1 0
1 0 0 1 same time C is, or I$005: OR2(N$002,N$004,Y)
1 0 1 1 when A is asserted
1 1 0 1 when C is not.
1 1 1 0
A
B G3 N3
C A
G4 G6 X B
N4
C
G5 N5
Time
T1 T2 T3 T4 T5 T6 T7 T8
Simulator
Sequential processing algorithm defines a set of steps that are taken in
a specific order; Concurrent processing steps occur whenever new
input data is available, with no implied sequence relationship between
separate concurrent processes.
Consider a simulation of a 2-input mux: At what time(s) should gate A1
be simulated? What about gate O1?
A
A N2
A1
B B
N1 O1 Y
C
A2
C N3
Y
T0 T1 T2 T3 T4 T5 T6
Simulator – Modelling time
Simulators model time as arbitrarily small “time steps”, typically around
10ps.
“Simulator time” is held constant during the simulator time step, until all
circuit nodes/instances have been simulated and there are no more
changes. Only then does simulator time advance.
Simulator – Modelling time
A B
N$60 I$19: NAND3(N$43,N$41,N$44,N$53)
Block 1 N$42 I$22
N$43 I$20: OR3(N$45,N$43,N$46,N$54)
N$53
I$19 N$61 I$21: NAND2(N$53,N$54,N$58)
N$44
N$58 I$23 I$25 I$22: OR2(B,N$42,N$60)
B I$21 N$64 I$23: OR2(N$42,N$58,N$61)
Block 3 N$45
Clk N$46 I$20 N$62 I$24: FF(Clk,B,N$62)
N$54 I$25: AND3(N$60,N$61,N$62,N$54)
I$24
Clk
Block 2
...
and netlist. Instances and nets not named in ... ...
B 0 0 0 - - -
the source file get auto-generated names. N$42 ... 1 1 0 - - - ...
N$43 ... 1 1 1 - - - ...
Only some nets will change in any given time Clk ... 0 0 1 - - - ...
step. Here, only N$42 and Clk change. Only N$54 ... 1 1 1 - - - ...
instances whose inputs have changed in a N$58 ... 0 0 0 - - - ...
N$61 ... 0 0 0 - - - ...
given step are simulated.
...
Time
Simulator
Consider the circuit and
netlist…
g1
A
B g3
C
g4 g6 X
g5
g2
not g1 (N1,A);
not g2 (N2,C);
or g3 (N3,N1,B,C);
or g4 (N4,B,C);
or g5 (N5,N1,N2,B);
and g6 (X,N3,N4,N5);
Simulator
Consider the circuit and …gate order is immaterial, and
netlist… so is netlist statement order
g1
A B g4
B g3
C
C g1
A g3 g6 X
g4 g6 X
g5
g5
g2
g2
g5
g2
not (N1,A);
Consider our example circuit not (N2,C);
or (N3,N1,B,C);
and netlist… or (N4,B,C);
or (N5,N1,N2,B);
and (X,N3,N4,N5);
Simulator
module netlist(
g1
A input A, B, C,
B g3
C output X
);
g4 g6 X
g5
wire N1,N2,N3,N4,N5;
g2
not (N1,A);
Add a few lines, and you get a not (N2,C);
or (N3,N1,B,C);
valid Verilog source file. The or (N4,B,C);
example shows structural or (N5,N1,N2,B);
and (X,N3,N4,N5);
Verilog – structural VHDL
would look similar. endmodule
Simulator
module netlist(
g1
A input A, B, C,
B g3
C output X
);
g4 g6 X
g5
wire N1,N2,N3,N4,N5;
g2
not (N1,A);
not (N2,C);
The order of lines in the or (N3,N1,B,C);
Verilog file does not matter. or (N4,B,C);
or (N5,N1,N2,B);
and (X,N3,N4,N5);
endmodule
Simulator
module netlist(
g1
A input A, B, C,
B g3
C output X
);
g4 g6 X
g5
wire N1,N2,N3,N4,N5;
g2
and (X,N3,N4,N5);
not (N1,A);
The order of lines in the or (N4,B,C);
Verilog file does not matter. or (N3,N1,B,C);
not (N2,C);
or (N5,N1,N2,B);
endmodule
Simulator
N1
module netlist(
A N3
input A, B, C,
B
C output X
);
X
N4
N5
wire N1,N2,N3,N4,N5;
N2
assign N1 = !A;
We can replace the structural assign N2 = !C;
assign N3 = N1 | B | C;
description with a behavioral assign N4 = B | C;
description… assign N5 = N1 | B | N2;
assign X = N3 & N4 & N5;
endmodule
Simulator
N1
module netlist(
A N3
input A, B, C,
B
C output X
);
X
N4
N5
wire N1,N2,N3,N4,N5;
N2
assign N5 = N1 | B | N2;
We can replace the structural assign N1 = !A;
assign X = N3 & N4 & N5;
description with a behavioral assign N2 = !C;
description… assign N3 = N1 | B | C;
assign N4 = B | C;
N5 wire N1,N2,N3,N4,N5;
N2
Most “real world” designs use hierarchy, where more complex circuits
are constructed from simpler modules using “structural Verilog”.
Pre-designed Verilog are generally known as “IP blocks”; today, you can
download any one of thousands of IP blocks.
Why use an HDL?
Text-based – any editor will do