Professional Documents
Culture Documents
Lecture5 Spring2003 PDF
Lecture5 Spring2003 PDF
n Timing
n Our designs are limited by getting data between FFs
Lecture 5: Timing n Combinational Logic delay, Routing delay, and FF
parameters dictate the maximum speed
n Clock Distribution
n H-Tree format for getting clocks at the same time
n Dedicated clock routing tries to reduce skew and jitter
David Black-Schaffer
n FF Timing
davidbbs@stanford.edu n Make sure the slowest path is fast enough for the FF
EE183 Spring 2003 based on the clock (MaxPath)
n Make sure the fastest path is not too fast for the FF
based on the clock (MinPath)
EE183 Lecture 5 - Slide 2
1
always @(current_state_q or button)
begin
else
end
begin
If any states are ever
n Keep this in mind when writing your next_state_d
end
= `GO; not used they MUST
be included in a
verilog. end
default: begin
go = 1'b0; default statement.
next_state_d = `STOP;
end
endcase
an else for every if
a default for every case
EE183 Lecture 5 - Slide 5
every output must be defined in every state
EE183 Lecture 5 - Slide 6
2
Combination Logic Delay Routing Delay
n Time to get through gates n This can be (IS!) the real killer
n The more gates (more complicated logic) the slower
n FPGA wiring slow compared to ASIC
n One-hot encoding
n Lots of switches to go through
n Well, sort of:
n Wires dont go exactly where you want
n FPGA doesnt have gates we have those 4-input
LUTs (look-up-tables) n Routing can be ~50% of your total delay
n All functions of 4 inputs or less are the same speed
n Manual placement? NP-hard problem?
n >4 inputs and we have to hook up multiple CLBs
(routing delay) n Hope the tools work well!
3
Jitter What is Faster?
n Is a 1.1GHz P4 faster than a 933MHz P3?
n Wall clock time is all that matters.*
n How long does it take to get your answer
n Faster clock speed doesnt mean you do more
n Pipelining: less of each instruction per clock, but more
instructions and more clocks = greater throughput
4
Setup and Hold Diagram Tclk->Q
n Tclk->Q: the amount of time you have to
Tsetup Thold
wait after the CLK before the output (Q) is
valid
CLK n If you try to use the output before this you
will get inconsistent results depending on
D can change Stable D can change if Q changes
Tclk->Q
5
MaxPath Timing Constraint MinPath Timing Constraint
n Add up the components that result in the time n Consider what happens when the same
budget; the period must be greater than this clock edge is considered at the far DFF.
value. n Tclk->q+Tcl_pdmin >= Tskew + Thold
n Tclk->q+Tcl_pdmax+Tsetup+Tskew<= Clock Period n 1 + 1 >= 2 + 1
n 1 + 10 + 1 + 2 <= Clock Period n Whoops!! The new value from FF A can
n 14ns <= Clock Period get there so fast that when the clock
n Max Frequency is 71MHz arrives the new value may change before
n Longest one is the Critical Path it has been latched in to FF B.
n AKA, Hold-Time Violation
EE183 Lecture 5 - Slide 21 EE183 Lecture 5 - Slide 22
6
Lecture 5 Key Points
n Speed is a function of how fast you can get from
FF to FF.
n Routing and combinational logic delay is what
will mostly bite you in this class.
n FFs themselves do have input and output timing
requirements of which you need to be aware
n Logistics
n Lab 1 DEMO due Friday at 5pm.
n Office Hours: Mon/Wed/Fri 10-11am,
Tue/Thur 7-9pm, and demos Fri 3-5pm
EE183 Lecture 5 - Slide 25