Lecture # 11
Lecture # 11
Lecture # 11
Course Instructor: Dr. Afshan Jamil
Outline
• Pipelined datapath
• Single cycle datapath-steps
• Bug in the datapath
• Corrected datapath
• Pipeline example
• Pipeline control
Pipelined Datapath
• We now move to building a pipelined datapath
• First recall the 5 steps in instruction execution
1. Instruction Fetch & PC Increment (IF)
2. Instruction Decode and Register Read (ID)
3. Execution or calculate address (EX)
4. Memory access (MEM)
5. Write result into register (WB)
• Review: single-cycle processor
– all 5 steps done in a single clock cycle
– dedicated hardware required for each step
Pipelined Datapath – Key Idea
<<
1
32 6
4
Clock Cycle 2
SW LW
<<
1
32 6
4
Clock Cycle 3
ADD SW LW
<<
1
32 6
4
Clock Cycle 4
SUB ADD SD
LD
<<
1
32 6
4
Clock Cycle 5
SUB ADD SD LD
<<
1
32 6
4
Clock Cycle 6
SUB ADD SW
<<
1
32 6
4
Clock Cycle 7
SUB ADD
<<
1
32 6
4
Clock Cycle 8
SUB
<<
1
32 6
4
Alternative View – Multiple-
Clock-Cycle Diagram
CC 1 CC 2 CC 3 CC 4 CC 5 CC 6 CC 7 CC 8
Time axis
ld x3, 10(x22) IM REG ALU DM REG
Write-back
Execution/Address Calculation Memory access stage stage control
stage control lines control lines lines
Reg ALU ALU ALU Mem Mem Reg Mem to
Instruction Dst Op1 Op0 Src Branch Read Write write Reg
R-format 1 1 0 0 0 0 0 1 0
ld 0 0 0 1 0 1 0 1 1
sd X 0 0 1 0 0 1 0 X
beq X 0 1 0 1 0 0 0 X
Pipelined Control
• Control signals derived from instruction
– As in single-cycle implementation
Pipelined Control