Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pipelining II Andreas Klappenecker CPSC321 Computer Architecture.

Similar presentations


Presentation on theme: "Pipelining II Andreas Klappenecker CPSC321 Computer Architecture."— Presentation transcript:

1 Pipelining II Andreas Klappenecker CPSC321 Computer Architecture

2 Basic Idea

3 Non-Pipelined vs. Pipelined Execution

4 Pipelining - Ideal Preconditions Instruction set design ideally, instructions are of equal length few instruction formats memory operands only in load and stores aligned data: only one memory access per load Sources of problems instructions with variable lengths (memory needs to be accessed multiple times) unaligned data (multiple memory accesses to obtain single data item)

5 Hazards Structural Hazards hardware cannot support the combination of instructions in the same clock cycle e.g. accessing the memory at the same time Control Hazards need to make decision based on results of one instruction while other is still executing e.g. branching Data Hazards instruction depends on results of instruction still in pipeline

6 Control Hazards Solutions: stalling: delay by one cycle to wait for result prediction: predict the result delayed decision: rearrange and perform operations first that do not harm

7 Stall on Branch Assume that all branch computations are done in stage 2 Delay by one cycle to wait for the result

8 Branch Prediction

9 Delayed Branch

10 Single Cycle Datapath

11 Problems Write back data to register file may create data hazard Selection of the next PC may create a control hazard Solutions: have a separate data path for each instruction (not really, you got to be kidding!) chop data path into small pieces keep everything that belongs together into one piece introduce registers to separate the stages

12 Pipelined Version Pipeline separation registers, width varies

13

14

15

16

17

18 Store Word Instruction fetch: as before decode & register file read: as before execute and address calculation: as before forwarding of register contents to EX/MEM pipelining register Memory access send data and address to memory Last step: nothing happens

19

20

21 Summary Some instructions do not require the complete datapath No information transfer from one pipeline stage to another is possible, except through pipeline registers Everything that happened in any previous stage will be overwritten Correction for store required: Where is the information on the write register?

22

23

24

25

26

27

28

29

30 Pipeline Control Data is traveling along the pipeline stages All data belonging to one instruction must be kept within that stage Information transfer only through pipeline registers Control information must travel with the instruction

31 Outlook Control for pipelined architecture Effect of various hazards Superscalar architectures issue multiple instructions per cycle Dynamic pipeline scheduling rescheduling of instructions by hardware to avoid pipeline stalls Intel architectures


Download ppt "Pipelining II Andreas Klappenecker CPSC321 Computer Architecture."

Similar presentations


Ads by Google