Professional Documents
Culture Documents
In a pipelined CPU, the execution of instructions is performed in stages. Separate hardware is provided to handle each of these stages. Instructions proceed through the CPU stages:
To implement instruction pipelining, desirable features of (instruction set) IS: all instructions same length registers specified in same place in instruction memory operands only in loads or stores, i.e. RISC But, it is not always the case in reality.
6 stage pipelining
Fetch instruction Decode instruction Calculate operands (i.e. EAs) Fetch operands
Execute instructions Write result Overlap these operations EXAMPLE -6 Stage Pipelining
Timing Diagram
Wrong Timing Diagram: Overlaps
Pipeline Performance n:number of instructions k: stages in pipeline : cycletime (time in seconds needed to advance a set of instructions one stage through the pipeline) Tk: total time for pipelining T0 : total time without pipelining
Total time for equal stages Total time with no pipelining, T0 = nk Total time with pipelining, Tk = (k + (n-1)) Total time for unequal stages For n instructions, with k unequal stages. Each stage have unequal delays. Total time with no pipelining Where is the delay time for stage i Total time with pipelining, where Fill time is ch stage
k (for large n) Note: the equations for T0 and Tk is not equal, it means that each stage from 1 to k would have the time(s), like , . Limits to Pipelining Factors that limits performance enhancement: Unequal duration/delay of stages Conditional branch instruction or interrupts Branch in a Pipeline
Hazards as limitation to pipelining. 3 types of hazards: Resource hazards : HW cannot support this combination of instructions (single person to fold and put clothes away, washer-drier) Data hazards: Instruction depends on result of prior instruction still in the pipeline Data dependencies example A=B+C D=E+A C=GxH Control hazards: Caused by delay between the fetching of instructions and decisions about changes in control flow (branches and jumps). Reduced Instruction Set Computers Major advances in computer : The family concept Separates architecture from implementation Microprogrammed control unit Cache memory Solid State RAM Microprocessors Pipelining Introduces parallelism into fetch execute cycle
Multiple processors CISC and RISC The next step: Reduced Instruction Set Computer in processor architecture Key features of CISC: Large number of predefined instructions making high level programming languages easy to design and implement. Supports microprogramming to simplify computer architecture Key features of RISC Limited and simple instruction set Large number of general purpose registers or use of compiler technology to optimize register use. Emphasis on optimizing the instruction pipeline CISC characteristics Varying number of instructions per cycle Small number of general purpose registers More addressing modes More instruction formats : fewer instructions can be used to implement a given task Use microcode Variable length instruction Simplified compiler: microprogram instructions could be written to match constructs of high level languages
RISC Characteristics One instruction per cycle Register to register operations Few, simple addressing modes Few, simple instruction formats Hardwired design (no microcode) Fixed instruction format More compile time/effort