EDA VHDL Simulation
EDA VHDL Simulation
History of VHDL
• <1985: various tools for circuit design; many were in-house tools
2
VHDL: A Hardware Description Language
Synthesis of a multiplexer
A 0
Specification: If Sel = 0, Q
Q=A; B 1
Else
Q=B; Sel
EDA
Tools PROCESS (A, B, Sel)
Nand_a BEGIN
S1
A
Inv
Nand_c
IF Sel=‘0’ THEN
Sel Q <= A;
Seln Q ELSE
Q <= B;
B
S2 END IF;
Nand_b END PROCESS;
3
VHDL Simulation with Delays
A 1
0
B 1
0
Sel 1
0
Q 1
0
0 10 12 20 30 40 t(ns)
4
VHDL Simulation without Delays
ELSE
B S2
Q <= B;
Nand_b
END IF;
END PROCESS;
A 1
0
B 1
0
Sel 1
0
Q 1
0
0 10 20 30 40 t(ns)
5
Naïve Execution Order of Multiple Processes
A C=AB=AA
B=A
P1: PROCESS (A) P2: PROCESS (A, B)
BEGIN BEGIN
B <= not A; C<=A and B;
END PROCESS; END PROCESS;
A 1 A 1
0 P1 0 2 P1 1 P2
B 1 B 1
0 0 3 P2
C 1 C 1
0 0
0
no change
0 10 20 t(ns) 0 10 20 t(ns)
P1P2 P2P1P2
A B
PROCESS (clk)
D Q BEGIN
IF clk’event and clk=‘1’ THEN
clk B <= A;
END IF;
END PROCESS;
A 1
0
clk 1
0
no change change at clock edge
B 1
0
0 10 20 30 40 t(ns)
7
VHDL Description of Multiple Flip-flops
A B C
D Q D Q
clk
The clock signal (clk) reaches all flip-flops at the same time.
8
Naïve Simulation of Multiple Flip-Flops
A 1 A 1
0 0
clk 1 clk 1
0 1 P1
0 4 P1, no change
P1
B 1 B 1
2
0 0 3 P2
1 2 P2 1
C C 1 P2, no change
0 0
0 10 20 30 40 t(ns) 0 10 20 30 40 t(ns)
P1P2 P2P1
A 1 A 1
0 0
clk 1 clk 1
0 1 P1
0 4 P1, no change
P1
B 1 B 1
2
0 0 3 P2
1 2 P2 1
C C 1 P2, no change
0 0
0 10 20 30 40 t(ns) 0 10 20 30 40 t(ns)
P1P2 P2P1
Implicit delay: a change at B cannot reach B′ instantly.
A B B′ C
D Q D Q
clk
The clock signal (clk) reaches all flip-flops at the same time.
10
Implicit Delta Delay
Implicitly added by the simulator
A 1 A 1
0 0
clk 1 clk 1
0 1 P1
0 4 P1, no change
P1
B 1 B 1
2
0 B changes at 10+ 0 10+ 3 P2
1 2 P2 1 1 P2, no change
C C
0 0
0 10 20 30 40 t(ns) 0 10 20 30 40 t(ns)
no change C changes at 30 + C changes at 30+
P1P2 P2P1
• is an imaginary delay equal to 0.
• Signals (with the assignment “<=“) without explicit delay
are updated after one delay.
• The delay helps maintain consistent simulation results.
11
Mismatch between Simulation and Circuit due to Delay
A 1 clk_1=clk_2
0
Clk_1 1 A 1
0 clk_2 changes at 10+
1 0
Clk_2 0 Clk_1 1
Clk_2 0
B 1 B 1
0 B changes at 10+ 0
1 1
C C
0 C changes at 10+2 0
0 10 20 30 t(ns) 0 10 20 30 t(ns)
This mismatch can only be avoided by using the clock signal carefully.
12
Adding Delays to Avoid Mismatch?
clk_1=clk_2
A 1 A1
0 0
Clk_1 1 Clk_1 1
0 clk_2 changes at 10+ 0
1 1
Clk_2 0 Clk_2 0
B 1 B changes at 15 B1 B changes at 9
0 0
1 no change at 10 1
C C
0 0
0 10 20 30 t(ns) 0 2 4 6 8 10 12 14 16 t(ns)
C changes at 35 C changes at 17
PROCESS (A) A
C
BEGIN B
C <= A xor B;
END PROCESS; Circuit to describe
A 1 A 1
0 0
1 1
B B
0 0
1 1
C 0 C 0
0 10 20 30 t(ns) 0 10 20 30 t(ns)
14
Event-driven Simulation
Execution of all transactions at time step tn in Δ-cycles. Advancing the simulation time tn → tn+1 ,
when all transactions at time tn have been executed.
Δ-cycle:
• Signal-Update-Phase:
• Process-Evaluation-Phase:
Signal- Signal-
Update Update
+Δ +Δ
Process- Process-
Evaluation Evaluation
tn tn+1 time
15
Transport Delay
Modeling of an ideal component with unlimited bandwidth.
ENTITY inverter IS
PORT (
inp : IN std_logic;
outp : OUT std_logic);
END inverter;
inp
inp outp
outp
ns
5 10 15 20 25 30 35
16
Inertial Delay
Modeling of real components with finite bandwidth.
(Pulses, which are shorter than the component’s delay, will be suppressed.)
ENTITY inverter IS
PORT (
inp : IN std_logic;
outp : OUT std_logic);
END inverter;
inp
inp outp
outp
ns
5 10 15 20 25 30 35
17
Delays in VHDL
18
Thanks!
19