Title: ECE 426 VLSI System Design
1ECE 426 - VLSI System Design
- Lecture 11 - FSM State Coding Timing
- March 5, 2003
Prof. John NestorECE DepartmentLafayette
CollegeEaston, Pennsylvania 18042nestorj_at_lafayet
te.edu
2Announcements
- References
- C. Cummings, State Machine Coding Styles for
Synthesis, SNUG 1998, - available at http//www.sunburst-design.com
3Where we are...
- Last Time
- Handshaking
- FIFOs
- Today - Register Transfer Design
- State Coding Assignment
- Timing
4State Assignment
- During design, we use symbolic state names
- Actual state code are determined by state
assignment - Structure (and cost and timing) of logic is
influenced by state assignment - Types of state assignment
- Binary (chosen by designer)
- One-Hot
- Output-Coded
- Generated by CAD Tool (Synopsys)
5Binary State Assignment
- Just pick arbitrary values for state code
- Default behavior in Verilog synthesis
- parameter 20 S0 3d0, S13d1,
- always _at_(posedge clk)
- cs lt ns
- always _at_(cs or in1 or )
- case (cs)
- S0
- S1
- default
- endcase
6One-Hot State Assignment
- Use one flip-flop for each state
- Tradeoff use more flip-flops, but usually less
logic - Popular in FPGAs (why?)
- parameter 40 S0 5b00001, S15b00010,
- always _at_(posedge clk)
- cs lt ns
- always _at_(cs or in1 or )
- case (cs)
- S0
- S1
- default
- endcase
7One-Hot Example Car Alarm
001
010
100
8One Hot Hand Implementation - Car Alarm
9One-Hot State Assignment with Zero Idle
- Idea add all zeros as idle state
- parameter 40 S0 5b00000, S15b00001,
- always _at_(posedge clk)
- cs lt ns
- always _at_(cs or in1 or )
- case (cs)
- S0
- S1
- default
- endcase
10Output-Coded State Machine
- Key idea
- Use state flip-flops directly as outputs
- Assign state codes so outputs have appropriate
value - Advantages
- Output asserted during state (not delayed like a
registered output) - No output logic!
00
10
01
11Larger Output-Coded Example
Example Source J. Wakerly, Digital Design
Principles and Practices, 3rd ed., Prentice-Hall,
2001
12ASM Diagram - T-Bird Taillights
000 000
111 111
001 000
000 100
011 000
000 110
111 000
000 111
13State Assignment w/ Synpopsys
- Just pick arbitrary values for state code
- Default behavior in Verilog synthesis
- parameter 20 // synopsys enum code
- S0 3d0, S13d1, , S73d7
- // synopsys state_vector cs
- reg 20 // synopsys enum code
- cs, ns
- always _at_(posedge clk)
- cs lt ns
- always _at_(cs or in1 or )
- case (cs)
- ...
- endcase
14Synopsys FSM Commands
- Key ideas
- Use a binary encoding that minimizes logic OR
- Use specialized code, but let tool assign codes
- Works with one FSM per module
- dc_shell commands
- (read design)
- compile
- extract
- set_fsm_encoding_style style
- compile
15Review Delay in Static CMOS
- Delay depends on transistor characteristics and
- parasitic loading (RL, CL) and
- transistor characteristics (Rn, Rp)
tr 2.2(RpRL)CL
tf 2.2(RnRL)CL
16Review Delay in Static CMOS
- Parasitics depend on
- Wire Loading (not known exactly before PR)
- Fanout Loading (gate inputs)
17Review Combinational Network Delay
- We know how to find the delay of one gate
- What about a network of connected gates?
18Path Delay in Combinational Networks
- Overall delay of a network is due to
- Connections of gates
- Combination of rising and falling outputs
- Maximum Delay - time between
- Change on a primary input
- Last change on primary output
19Path Delay - Graph Model
20Path Delay - Graph Model
- Model combinational network as a graph
- Nodes correspond to gates
- Edges correspond to connections, weighted by
delay - Worst case delay is defined by the critical path
- Longest path (or paths) when summing weights
- Known as the critical path
21False Paths
- Logic gates are not simple nodessome input
changes dont cause output changes. - A false path cannot be exercised due to Boolean
gate conditions. - False paths cause pessimistic delay estimates.
22Timing Analyzers
- Function compute longest paths in a large
circuit - Additional concerns
- Support sequential logic
- Identify (and ignore) false paths
- A timing analyzer is built in to Design Compiler
23Ways to Improve Path Delay
- Restructure Logic
- Flatten large logic network
- Transistor Sizing
- Custom design make transistors bigger
- Standard cell design choose cell with larger
transistors - Physical Design
- Placement - try to place modules to minimize wire
length - Routing - route "critical nets" first
24Timing in Design Flow - ASIC Design
START
Design Compiler
Synthesize Blocks / Timing Analysis
Timing OK?
N
Y
Place Route / Timing Analysis
Timing OK?
N
Y
DONE
25Path Delay and Synthesis
- Traditional logic synthesis tools control
- Logic structure
- Transistor size (select modules with different
driver sizes) - But, they can't directly control physical design
- Problem interconnect dominates in "deep
submicron" - Response "Physical Synthesis" tools
26Physical Synthesis
- New tools combine synthesis, physical design
- Goals
- Better performance
- "Timing Closure" - create design with minimal
iteration - Reduced design Time
- Example products
- Synopsys - Physical Compiler
- Monterey Design Automation - Dolphin
- Cadence - PKS
- Magma - Blast Fusion
27Review Timing in Sequential Circuits
- Key constraint D must be stable in "window"
around active edge - Setup time - tsetup, tsu
- Hold time - thold, th
Latch "Transparent"
thold
tsetup
thold
tsetup
28Timing Requirements inEdge Triggered Clocking
(Setup Time)
- Given maximum propagation delay - tprop(max)
- tclock must be large enough to meet setup times
- Slack time tslack provides a "safety margin"
Combinational Logic
Register Output
Register Input
Adder
tclock gt tprop(max) tsetup tclock tprop(max)
tsetup tslack
Mux
Clock
tprop(max)
tsetup
29Effect of Clock Skewon Setup-Time Requirements
- Clock may not arrive at FF inputs at same time
- Must account for clock skew in timing
Combinational Logic
Register Output
Register Input
Adder
Mux
tclock gt tprop tsetup tskew
d
Clock
tskew
tprop
tsetup
30Timing Requirements inEdge Triggered Clocking
(Hold Time)
- Given minimum propagation delay - tprop(min)
- tprop(min) must be large enough to meet hold
times - Worst case shift register (minimal output delay)
tprop(min) gt thold tprop(min) gt thold - tskew
Combinational Logic
Register Output
Register Input
Adder
Mux
Clock
thold
Shift Register
tprop(min)
31Level-Triggered Clocking (Latch-Based)
- "Two-sided" timing constraint
- Tclk gt tcomb tsetup
- TH lt tcomb(min)
- Difficult to satisfy - want to eliminate second
constraint by removing "transparency" - Edge-triggered clocking
- Multiple-phase clocking
32Overview Synopsys Design Compiler
- What's under the hood
- Design Library Database (provided by foundry)
- Description of available cells
- Delay model for available cells
- Storage element setup, hold constraints
- Operating condition info
- Timing Analyzer
- Logic optimization commands
- Technology-independent
- Technology dependent (technology mapping)
- Timing optimization commands
- Logic restructuring (e.g., flattening)
- Timing-driven technology mapping
33Overview Synopsys Design Compiler (cont'd)
- Controls - Constraints
- "Design Rule" Constraints
- Transition time
- Fanout load
- Capacitance
- Timing Constraints
- Clock specification
- Input, output constraints
- Overall delay constraints
- False path specification
- Area Constraints
- Maximum Area
34Running the Design Compiler
- design_analyzer
- graphical interface
- graphical display of design
- passes commands to dc_shell through GUI
- dc_shell - text interface
- command-line interface
- scripts used for complex operations
- used with software development tools like "make"
in large designs - Industrial view "real designers use dc_shell
35Timing in the Design Compiler
- DC assumes a synchronous, clock-based system
- Derives setup, hold constraints between registers
- User-specified timing constraints on inputs,
outputs
Comb. Logic (Internal)
Comb. Logic (Output)
Comb. Logic (Input)
D
Q
D
Q
D
Q
D
Q
36Specifying Timing Constraints in DC
- Clock specification
- Period
- Skew (and uncertainty)
- Input constraints
- Output constraints
- Combinational delay constraints
- Special cases
- false paths
- multicycle paths
37Clock specifications in DC
- Basic command create_clock
- defines clock period
- implies timing constraints on all
register-register paths - dc_shell command syntax
- create_clock clockname -period clockpd(ns)
- Example define a 10MHz clock called clk
- create_clock clk -period 100
- DC supports multiple clocks
- Timing analyzer computes "common base period
- Least common multiple of all clocks
- Used by timing analyzer for interactions between
clocks - Generally, multiple clocks should be avoided if
possible
38Clock specifications in DC (cont'd)
- Specifying delay (skew) in clock networks
- Using DC estimates set_propagated_clock
- Absolute delay set_clock_latency
- Unknown delay set_clock_uncertainty
- Specifying an external clock - "virtual" clock
- Use when system clock is not present in current
block, but block inputs, outputs vary relative to
clock - Syntax
- create_clock -period clockpd -name clockname
- Example
- create_clock -period 30 -name sys_clk
39Performance-Based Synthesis
- References
- Synopys Online Documentation (SOLD) Manuals
-access using the "sold" command - Design Compiler User Guide
- Design Compiler Tutorial
- Design Compiler Reference Manual
- Pran Kurup and Taher Abbasi, Logic Synthesis
using Sysnopsys, 2nd ed., Kluwer Academic
Publishers, 1997.
40Coming Up
- More about Timing
- Input Constraints
- Output Constraints