Timing Analysis
Timing Analysis
Smith Chapter 13
Outline
Gate-delay models
Circuit timing constraints
VITAL models for gate-level simulation
VHDL netlist simulation with VITAL models and Standard
Delay Format (SDF) files
Logic cell delay models
Event Event
Delay
Primitive device delay models
t t
Rise/fall delay
Delays for 0 to 1 and 1 to 0 transitions.
tPLH (rise time): propagation delay for signal changing from
low to high.
tPHL (fall time): propagation delay from high to low.
tPLH tPHL
(rise time) (fall time)
Example: ADK tsmc035 technology
nand02 cell:
tP=0.537466 (ns) INV on A0(RI) to Y(FA)
tP=0.810693 (ns) INV on A0(FA) to Y(RI)
tP=0.421754 (ns) INV on A1(RI) to Y(FA)
tP=0.868593 (ns) INV on A1(FA) to Y(RI)
and02 cell:
tP=0.726188 (ns) INV on A0(RI) to Y(FA)
tP=0.828392 (ns) INV on A0(FA) to Y(RI)
tP=0.679021 (ns) INV on A1(RI) to Y(FA)
tP=0.921874 (ns) INV on A1(FA) to Y(RI)
Ambiguous or Min/Max Delay
Difficult to predict exact rise or fall time of a signal.
For worst-case performance analysis, {tmin, tmax} is specified for
each timing parameter.
c
tmin
ambiguity regions
tmax
Accumulated min/max delays
d
a f
b e
h
g
c
d g h
e
15
101214 16 20 25
Inertial Delay
An input value must persist for some minimum duration of
time to provide the output with the needed inertia to change.
The minimum duration is called inertial delay.
a a
b b
c c
(a) Transport delay model (b) Inertial delay model
t a*
a
c* t
Model with both inertial c
b t Transport
and transport delays: b* Ideal delay
Inertial gate
delay
VHDL transport/inertial delays
2 4 3
1
Timing Constraints:
Flip flop setup, hold & clock times
Constrain signal transitions to ensure reliable
operation
tSU (setup time) of signal X with respect to signal Y = time
prior to active change on Y by which X must be stable
tH (hold time) of signal X with respect to signal Y = time
following active change on Y during which X must be stable
tPW, tH, tL = clock signal minimum pulse width, high time,
low time T
tSU tH
Signal X T = time of clock transition
tSU = flip flop setup time
tH = flip flop hold time
No changes at
flip flop inputs
SN74LS74A (D flip flop) parameters
Source:http://focus.ti.com/lit/ds/symlink/sn74ls74a.pdf
ADK tsmc035 technology D flip flop
Report Timing Info for Instance /DFFR1 of TYPE QPT
tP = 0.637972 (ns) NONINV ON CLK(RI) TO Q(RI) --delays from CLK rise
tP = 0.746466 (ns) INV ON CLK(RI) TO QB(FA)
tP = 0.752151 (ns) INV ON CLK(RI) TO Q(FA)
tP = 0.896604 (ns) NONINV ON CLK(RI) TO QB(RI)
tP = 0.828865 (ns) INV ON R(RI) TO Q(FA) --delays from Reset active
tP = 0.973914 (ns) NONINV ON R(RI) TO QB(RI)
c
a e
b d
g
e
d
c f
f
g
Time t t t
t1 t2 t3 t4
Circuit-level timing constraints
tPCL (propagation delay)
Inputs Outputs
Combinational
Logic
Clock
Minimum clock period
TCLK
entity dff is
generic (
tipd_CLK : VitalDelayType01Z := VitalZeroDelay01Z;
tipd_D : VitalDelayType01Z := VitalZeroDelay01Z;
tpd_CLK_Q : VitalDelayType01Z := VitalZeroDelay01Z;
tpd_CLK_QB : VitalDelayType01Z := VitalZeroDelay01Z;
tsetup_D_CLK_noedge_posedge : VitalDelayType := 0 ns;
thold_D_CLK_noedge_posedge : VitalDelayType := 0 ns;
tpw_CLK_posedge : VitalDelayType := 0 ns;
tpw_CLK_negedge : VitalDelayType := 0 ns;
TimingChecksOn : BOOLEAN := TRUE;
InstancePath : STRING := "*“
);
-- VitalDelayType01Z = delays for 0-1,1-0,0-Z,1-Z,Z-0,Z-1 changes
Continued
DFF model (continued)
port (
D : in STD_LOGIC;
CLK : in STD_LOGIC;
Q : out STD_LOGIC;
QB : out STD_LOGIC
);
attribute VITAL_LEVEL0 of dff : entity is TRUE;
end dff;
Continued
DFF model (continued)
begin
WireDelay : Block begin -- Input wire delays
VitalWireDelay (CLK_ipd, CLK, tipd_CLK);
VitalWireDelay (D_ipd, D, tipd_D);
end Block;
Continued
DFF model (continued)
CONSTANT DFF_table : VitalStateTableType := (
('X','-','-','-','-','X','X','X'), ('-','^','0','0','-','X','0','1'),
('-','^','1','0','-','X','1','0'), ('-','^','0','1','0','X','0','1'),
('-','^','1','1','1','X','1','0'), ('-','f','0','-','0','1','S','S'),
('-','f','0','-','1','1','X','X'), ('-','f','1','-','1','1','S','S'),
('-','f','1','-','0','1','X','X'), ('-','v','B','B','-','X','S','S'),
('-','r','0','-','0','0','S','S'), ('-','r','0','-','-','0','X','X'),
('-','r','1','-','1','0','S','S'), ('-','r','1','-','-','0','X','X'),
('-','/','0','-','-','X','0','1'), ('-','/','1','-','-','X','1','0'),
('-','\','-','-','-','X','S','S'), ('-','*','-','-','-','X','X','X'),
('-','B','*','-','-','X','S','S'), ('-','-','*','-','-','X','S','S'),
('-','-','-','-','-','S','S','S')
);
Continued
DFF model (continued)
------------------------------------
-- FUNCTIONALITY SECTION --
------------------------------------
-- Functional behavior of D flip flop
Violation_0 := Tviol_0 or Pviol_0;
VitalStateTable (
StateTable => DFF_table,
DataIn => STD_LOGIC_VECTOR'(
Violation_0, CLK_ipd, D_ipd
),
NumStates => 2,
Result => Results_0,
PreviousDataIn => PrevData_0
);
Continued
DFF model (continued)
------------------------------------
-- PATH DELAY SECTION --
------------------------------------
(CELL
(CELLTYPE "nand02")
(INSTANCE ix170)
(DELAY
(ABSOLUTE
(PORT A0 (::0.00) (::0.00))
(PORT A1 (::0.00) (::0.00))
(IOPATH A0 Y (::0.09) (::0.08))
(IOPATH A1 Y (::0.12) (::0.10)))))
Timing simulation in Modelsim
Select SDF tab
when starting
simulation.
Click Add to
select SDF file
Select
min, typ
or max
delay
Compile options
-sdftyp modulo7_0.sdf
-Apply delays from SDF file modulo7_0.sdf
-Can also use –sdfmin or –sdfmax.
-sdfnoerror -Reduce SDF errors to warnings to enable
simulation with missing hold times, etc.
-L adk -Library of gate-level VITAL models.
-t ps -Timing resolution consistent with SDF.
Simulating with SDF & testbench
Compile options
-sdftyp /modulo7_bench/UUT=modulo7_1.sdf
-Apply delays only to design instance (UUT).
-Can also use –sdfmin or –sdfmax.
-sdfnoerror -Reduce SDF errors to warnings to enable
simulation with missing hold times, etc.
-L adk -Library of gate-level VITAL models.
-t ps -Timing resolution consistent with SDF.
Testbench: modulo7_bench.vhd
LIBRARY ieee; USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
Alternative
ENTITY modulo7_bench is end modulo7_bench;
to “do” file
ARCHITECTURE test of modulo7_bench is
component modulo7
PORT (reset,count,load,clk: in std_logic;
I: in std_logic_vector(2 downto 0);
Q: out std_logic_vector(2 downto 0));
end component;
for all: modulo7 use entity work.modulo7(Behave);
signal clk : STD_LOGIC := '0';
signal res, cnt, ld: STD_LOGIC;
signal din, qout: std_logic_vector(2 downto 0);
begin
-- instantiate the component to be tested Continue on
UUT: modulo7 port map(res,cnt,ld,clk,din,qout); next slide
Testbench: modulo7_bench.vhd
qint = expected outputs of UUT
clk <= not clk after 10 ns;
Note “delta”
delays for
behavioral
model.
Simulation using SDF file
Note actual
delays within
test circuit.
Delta delays at
testbench level. load
count