Processor Pipelines Flashcards
Draw the CPU overview focusing on the data path
.
? between stages keep the processes in different stages
Registers
How is the address for the memory access generated?
From rs1 and immediate
Which register holds data for the store?
rs2
Why is it quicker to do things later and then decide if we need the result?
Because hardware is parallel
Add control logic to the data path diagram
.
What does the branch unit do?
Generates next PC value. If there is no branching just adds 4 to PC
What does the mux after register file access do?
Selects either immediate or rf[rs2] as the second operator
Why do we need a jump and link instruction?
Because we can’t specify a 32 bit immediate and instruction in 32 bits
How does a store instruction work?
Starts out like an I-type instruction and does the address calculations: read register operands, calculate address rf[rs1] + sign_extended_immediate
Write register rf[rs2] value to this location in memory
How does a load instruction work?
Starts out like an I-type instruction and does the address calculations: read register operands, calculate address rf[rs1] + sign_extended_immediate
Read memory and update destination register rf[rd]
Draw the part of the data path corresponding to load/store instructions
.
Draw the part of the data path corresponding to R-type instructions
.
Draw the part of the data path corresponding to I-type instructions
.
What happens with branch instructions?
- Read register operands
- Compare operands
Use ALU, subtract and check outputs - Calculate target address
Sign-extend displacement, shift left 1 place, add to PC value
What is the data path?
Made up of elements that process data and addresses. Data flows through this path, with some of the data coming from the instruction. Fixed
What is the control path?
Control path signals are determined by the instruction and other microarchitectural state (eg. result of ALU operation is zero or negative). Determines how each part of ther data path is used to perform each instruction
Highlight the influence of control for R-type instructions on the data and control path diagram
.
Highlight the influence of control for I-type arithmetic instructions on the data and control path diagram
.
Highlight the influence of control for I-type load instructions on the data and control path diagram
.
Highlight the influence of control for S-type store instructions on the data and control path diagram
.
Highlight the influence of control for B-type instructions on the data and control path diagram
.
List 3 performance issues with with the processor pipeline
- Longest delay determines clock period
Critical path = load instruction
Instruction memory -> register file -> ALU -> data memory -> register file - Not feasible to very period for different instructions
- Violates the design principle of making the common case fast
What is the critical path through the processor pipeline?
Load instruction
Instruction memory -> register file -> ALU -> data memory -> register file