Tsung-Chu Huang
2004/09/14
SCHEMATICS
output [31:0] S;
output C; HDL
…
ends
VDD
VDD V 0 3V
M1 Z IN 0 0 NCH
M2 Z IN V V PCH
A IN Z NETLIST
R1 A IN 15
C1 Z 0 1P
VIN A 0 PWL(0 0 1N 3V)
System Level
SystemC Verilog
Industry VHDL
Academic
VHDL
RTL Verilog
Verilog
Gate Level
Transistor Level
Board-Level
Register-Level
Logic-Level
Circuit-Level
Transistor-Level
Physics-Level
HDL T.-C. Huang / NCUE Fall 2004 9
Y-Chart
Gajski transferred the level-view table into a sphere chart:
if(c) then
Behaviorial p<=a*b; Structural
View
View
UDP
Symbol
Spec
library
sim
ver synthesize
Physical
HDL T.-C. Huang / NCUE Fall 2004 11
Usual Levels & Views
Behavioral-View Structural-View Physical-View
System-Level
“Behavioral Mode”
“Gate-Level”
Logic-Level
Program
||
Algorithm
+
Data Structure
if(c) then
Behaviorial p<=a*b; Structural
View
View
UDP
Symbol
Spec
1. External Representation
2. Structural Properties
3. Hardware Descriptive Languages
4. Internal Representation
5. Example: A Simple Verilog Parser in
C Language.
1. Branches/Fanout
2. Stem
3. Fanout-free
4. Reconvergent Fanout
5. Gate Type
6. Inversion
7. Inversion Parity
8. Level of a Gate in Circuit
G1 G4
G3
G2 G5
G7
G6
17
11 10
16
0 14
8 9
15
1 12
2 13
3 7
6
Top
module
Instance Net
List
module module module
Pin List
Port List
Instance Pin List
module module
Port List
Instance Instance
A B C F A B C F
0 0 0 1 X 1 0 0
0 0 1 1 1 1 X 0
0 1 0 0 X 0 X 1
0 1 1 1 0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 0 F = B + ABC
1 1 1 0
PI: PO:
Primary Inputs N Primary Outputs
X L
Combinational Z
Circuit
PPI: PPO:
Pseudo PI Pseudo PO
M Q Q
Q
D
D D M
Q D
Q D
PS: Present State y Y NS: Next State
Clk State Count S ≤ 2 M
00 01
1/1 0/0 0/0
11 10
HDL T.-C. Huang / NCUE Fall 2004 26
State Table & Flow Table
K-map or
Q X D Z McKlusky Method:
Q1 Q0 X0 D1 D0 Z0 D1 = Q1 X + Q1Q0 X + Q1 Q0 X
0 0 0 0 0 0 D0 = X
0 0 1 0 1 0 Z = Q1Q0 X
0 1 0 1 0 0 X
0 1 1 0 1 0 Z
1 0 0 0 0 0
1 0 1 1 1 0
1 1 0 1 0 0
Q0D
1 1 1 0 1 1
Q1D
HDL T.-C. Huang / NCUE Fall 2004 27
Binary Decision Diagrams
1. A Binary Decision Diagram (BDD) is a graph
model of the function of a circuit.
F = AC + BC F
A C
0 1 0 1
B B B A
1 0
0
C 1 C 1 Reduced Ordered BDD
0 1
0
0 1
HDL T.-C. Huang / NCUE Fall 2004 28
Programs as Functional Models
1. Assembly-Like: 3. C-Code is the
LDA A direct and fast
AND B
INV
simulator.
OR C
C=A+B;
STA F A=R1*R2;
B=~B;
2. C-Like:
main(F, A, B, C)
{ int F, A, B, C;
F = ~ ( A && B ) || C;
}
2. C or Verilog-like Language:
module Adder(Co, Sum, A, B, Ci);
Input [15:0] A, B;
Input Ci;
output Co;
output [15:0] Sum;
assign {Co, Sum} = A + B + Ci;
endmodule
1. Verilog-like Code:
Sum = #20 A+B;
initial
begin
A=1; B=0;
#10 B=1; A=0;
#40 B=0;
#10 $stop;
end