Download presentation
Presentation is loading. Please wait.
Published byRalf Webb Modified over 9 years ago
1
RTL Hardware Design by P. Chu Chapter 81
2
1. Overview on sequential circuits 2. Synchronous circuits 3. Danger of synthesizing asynchronous circuit 4. Inference of basic memory elements 5. Simple design examples 6. Timing analysis 7. Alternative one-segment coding style 8. Use of variable for sequential circuit RTL Hardware Design by P. Chu Chapter 82
3
Combinational vs sequential circuit ◦ Sequential circuit: output is a function of current input and state (memory) Basic memory elements ◦ D latch ◦ D FF (Flip-Flop) ◦ RAM Synchronous vs asynchronous circuit RTL Hardware Design by P. Chu Chapter 83
4
RTL Hardware Design by P. Chu Chapter 84 D latch: level sensitive D FF: edge sensitive
5
RTL Hardware Design by P. Chu Chapter 85
6
RTL Hardware Design by P. Chu Chapter 86 Problem wit D latch: Can the two D latches swap data?
7
RTL Hardware Design by P. Chu Chapter 87 Timing of a D FF: ◦ Clock-to-q delay ◦ Constraint: setup time and hold time
8
Globally synchronous circuit: all memory elements (D FFs) controlled (synchronized) by a common global clock signal Globally asynchronous but locally synchronous circuit (GALS). Globally asynchronous circuit ◦ Use D FF but not a global clock ◦ Use no clock signal RTL Hardware Design by P. Chu Chapter 88
9
One of the most difficult design aspects of a sequential circuit: How to satisfy the timing constraints The Big idea: Synchronous methodology ◦ Group all D FFs together with a single clock: Synchronous methodology ◦ Only need to deal with the timing constraint of one memory element RTL Hardware Design by P. Chu Chapter 89
10
RTL Hardware Design by P. Chu Chapter 810 Basic block diagram ◦ State register (memory elements) ◦ Next-state logic (combinational circuit) ◦ Output logic (combinational circuit) Operation ◦ At the rising edge of the clock, state_next sampled and stored into the register (and becomes the new value of state_reg ◦ The next-state logic determines the new value (new state_next) and the output logic generates the output ◦ At the rising edge of the clock, the new value of state_next sampled and stored into the register Glitches has no effects as long as the state_next is stabled at the sampling edge
11
RTL Hardware Design by P. Chu Chapter 811
12
Synthesis: reduce to combinational circuit synthesis Timing analysis: involve only a single closed feedback loop (others reduce to combinational circuit analysis) Simulation: support “cycle-based simulation” Testing: can facilitate scan-chain RTL Hardware Design by P. Chu Chapter 812
13
Not formally defined, Just for coding Three types: ◦ “Regular” sequential circuit ◦ “Random” sequential circuit (FSM) ◦ “Combined” sequential circuit (FSM with a Data path, FSMD) RTL Hardware Design by P. Chu Chapter 813
14
D Latch/DFF ◦ Are combinational circuits with feedback loop ◦ Design is different from normal combinational circuits (it is delay-sensitive) ◦ Should not be synthesized from scratch ◦ Should use pre-designed cells from device library RTL Hardware Design by P. Chu Chapter 814
15
RTL Hardware Design by P. Chu Chapter 815 E.g., a D latch from scratch
16
RTL Hardware Design by P. Chu Chapter 816
17
VHDL code should be clear so that the pre- designed cells can be inferred VHDL code ◦ D Latch ◦ Positive edge-triggered D FF ◦ Negative edge-triggered D FF ◦ D FF with asynchronous reset RTL Hardware Design by P. Chu Chapter 817
18
RTL Hardware Design by P. Chu Chapter 818 D Latch No else branch D latch will be inferred
19
RTL Hardware Design by P. Chu Chapter 819 Pos edge- triggered D FF No else branch Note the sensitivity list
20
RTL Hardware Design by P. Chu Chapter 820 Neg edge-triggered D FF
21
RTL Hardware Design by P. Chu Chapter 821 D FF with async reset No else branch Note the sensitivity list
22
RTL Hardware Design by P. Chu Chapter 822 Register Multiple D FFs with same clock and reset
23
RTL Hardware Design by P. Chu Chapter 823 5. Simple design examples Follow the block diagram ◦ Register ◦ Next-state logic (combinational circuit) ◦ Output logic (combinational circuit)
24
RTL Hardware Design by P. Chu Chapter 824 D FF with sync enable Note that the en is controlled by clock Note the sensitivity list
25
RTL Hardware Design by P. Chu Chapter 825
26
RTL Hardware Design by P. Chu Chapter 826
27
RTL Hardware Design by P. Chu Chapter 827 T FF
28
RTL Hardware Design by P. Chu Chapter 828
29
RTL Hardware Design by P. Chu Chapter 829
30
RTL Hardware Design by P. Chu Chapter 830 Free-running shift register
31
RTL Hardware Design by P. Chu Chapter 831
32
RTL Hardware Design by P. Chu Chapter 832
33
RTL Hardware Design by P. Chu Chapter 833
34
RTL Hardware Design by P. Chu Chapter 834 Universal shift register 4 ops: parallel load, shift right, shift left, pause
35
RTL Hardware Design by P. Chu Chapter 835
36
RTL Hardware Design by P. Chu Chapter 836
37
RTL Hardware Design by P. Chu Chapter 837 Arbitrary sequence counter
38
RTL Hardware Design by P. Chu Chapter 838
39
RTL Hardware Design by P. Chu Chapter 839 Free-running binary counter Count in binary sequence With a max_pulse output: asserted when counter is in “11…11” state
40
RTL Hardware Design by P. Chu Chapter 840
41
RTL Hardware Design by P. Chu Chapter 841 Wrapped around automatically Poor practice:
42
RTL Hardware Design by P. Chu Chapter 842 Binary counter with bells & whistles
43
RTL Hardware Design by P. Chu Chapter 843
44
RTL Hardware Design by P. Chu Chapter 844 Decade (mod-10) counter
45
RTL Hardware Design by P. Chu Chapter 845
46
RTL Hardware Design by P. Chu Chapter 846 Programmable mod-m counter
47
RTL Hardware Design by P. Chu Chapter 847
48
RTL Hardware Design by P. Chu Chapter 848
49
RTL Hardware Design by P. Chu Chapter 849
50
Combinational circuit: ◦ characterized by propagation delay Sequential circuit: ◦ Has to satisfy setup/hold time constraint ◦ Characterized by maximal clock rate (e.g., 200 MHz counter, 2.4 GHz Pentium II) ◦ Setup time and clock-to-q delay of register and the propagation delay of next-state logic are embedded in clock rate RTL Hardware Design by P. Chu Chapter 850
51
RTL Hardware Design by P. Chu Chapter 851 state_next must satisfy the constraint Must consider effect of ◦ state_reg: can be controlled ◦ synchronized external input (from a subsystem of same clock) ◦ unsynchronized external input Approach ◦ First 2: adjust clock rate to prevent violation ◦ Last: use “synchronization circuit” to resolve violation
52
RTL Hardware Design by P. Chu Chapter 852 Setup time violation and maximal clock rate
53
RTL Hardware Design by P. Chu Chapter 853
54
RTL Hardware Design by P. Chu Chapter 854 E.g., shift register; let Tcq=1.0ns Tsetup=0.5ns
55
RTL Hardware Design by P. Chu Chapter 855 E.g., Binary counter; let Tcq=1.0ns Tsetup=0.5ns
56
RTL Hardware Design by P. Chu Chapter 856
57
RTL Hardware Design by P. Chu Chapter 857 Hold time violation
58
RTL Hardware Design by P. Chu Chapter 858
59
RTL Hardware Design by P. Chu Chapter 859 Output delay
60
Combine register and next-state logic/output logic in the same process May appear compact for certain simple circuit But it can be error-prone RTL Hardware Design by P. Chu Chapter 860
61
RTL Hardware Design by P. Chu Chapter 861 D FF with sync enable
62
RTL Hardware Design by P. Chu Chapter 862
63
RTL Hardware Design by P. Chu Chapter 863
64
RTL Hardware Design by P. Chu Chapter 864 Interpretation: any left-hand-side signal within the clk’event and clik=‘1’ branch infers a D FF
65
RTL Hardware Design by P. Chu Chapter 865 T FF
66
RTL Hardware Design by P. Chu Chapter 866
67
RTL Hardware Design by P. Chu Chapter 867
68
RTL Hardware Design by P. Chu Chapter 868
69
RTL Hardware Design by P. Chu Chapter 869 Binary counter with bells & whistles
70
RTL Hardware Design by P. Chu Chapter 870
71
RTL Hardware Design by P. Chu Chapter 871
72
RTL Hardware Design by P. Chu Chapter 872 Free-running binary counter Count in binary sequence With a max_pulse output: asserted when counter is in “11…11” state
73
RTL Hardware Design by P. Chu Chapter 873
74
RTL Hardware Design by P. Chu Chapter 874
75
RTL Hardware Design by P. Chu Chapter 875
76
RTL Hardware Design by P. Chu Chapter 876
77
RTL Hardware Design by P. Chu Chapter 877 Programmable mod-m counter
78
RTL Hardware Design by P. Chu Chapter 878
79
RTL Hardware Design by P. Chu Chapter 879
80
RTL Hardware Design by P. Chu Chapter 880
81
RTL Hardware Design by P. Chu Chapter 881
82
Two-segment code ◦ Separate memory segment from the rest ◦ Can be little cumbersome ◦ Has a clear mapping to hardware component One-segment code ◦ Mix memory segment and next-state logic / output logic ◦ Can sometimes be more compact ◦ No clear hardware mapping ◦ Error prone Two-segment code is preferred RTL Hardware Design by P. Chu Chapter 882
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.