Instruction Sets and Pipelining Cover basics of instruction set types and fundamental ideas of pipelining Later in the course we will go into more depth.

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

The CPU The Central Presentation Unit What is the CPU?
Computer Organization and Architecture
1 Pipelining Part 2 CS Data Hazards Data hazards occur when the pipeline changes the order of read/write accesses to operands that differs from.
1 ITCS 3181 Logic and Computer Systems B. Wilkinson Slides9.ppt Modification date: March 30, 2015 Processor Design.
Topics covered: CPU Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
Computer Organization and Architecture
Chapter Six 1.
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Computer Organization and Architecture
MIPS Pipelined Datapath
S. Barua – CPSC 440 CHAPTER 6 ENHANCING PERFORMANCE WITH PIPELINING This chapter presents pipelining.
1 Lecture 17: Basic Pipelining Today’s topics:  5-stage pipeline  Hazards and instruction scheduling Mid-term exam stats:  Highest: 90, Mean: 58.
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
Computer Organization and Architecture The CPU Structure.
Chapter 12 Pipelining Strategies Performance Hazards.
Chapter 12 CPU Structure and Function. Example Register Organizations.
DLX Instruction Format
Appendix A Pipelining: Basic and Intermediate Concepts
ENGS 116 Lecture 51 Pipelining and Hazards Vincent H. Berk September 30, 2005 Reading for today: Chapter A.1 – A.3, article: Patterson&Ditzel Reading for.
Pipelining. Overview Pipelining is widely used in modern processors. Pipelining improves system performance in terms of throughput. Pipelined organization.
Pipelining By Toan Nguyen.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
Processor Structure & Operations of an Accumulator Machine
Edited By Miss Sarwat Iqbal (FUUAST) Last updated:21/1/13
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the SH-2 32-bit RISC.
Pipeline Hazard CT101 – Computing Systems. Content Introduction to pipeline hazard Structural Hazard Data Hazard Control Hazard.
Chapter 1 An Introduction to Processor Design 부산대학교 컴퓨터공학과.
Presented by: Sergio Ospina Qing Gao. Contents ♦ 12.1 Processor Organization ♦ 12.2 Register Organization ♦ 12.3 Instruction Cycle ♦ 12.4 Instruction.
CSC 4250 Computer Architectures September 15, 2006 Appendix A. Pipelining.
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell CS352H: Computer Systems Architecture Topic 8: MIPS Pipelined.
Pipelining Enhancing Performance. Datapath as Designed in Ch. 5 Consider execution of: lw $t1,100($t0) lw $t2,200($t0) lw $t3,300($t0) Datapath segments.
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
CS.305 Computer Architecture Enhancing Performance with Pipelining Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
CMPE 421 Parallel Computer Architecture
1 Pipelining Part I CS What is Pipelining? Like an Automobile Assembly Line for Instructions –Each step does a little job of processing the instruction.
CS 1104 Help Session IV Five Issues in Pipelining Colin Tan, S
CSIE30300 Computer Architecture Unit 04: Basic MIPS Pipelining Hsin-Chou Chi [Adapted from material by and
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 4: Pipelining * Jeremy R. Johnson Wed. Oct. 18, 2000 *This lecture was derived.
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
CMPE 421 REVIEW: MIDTERM 1. A MODIFIED FIVE-Stage Pipeline PC A Y R MD1 addr inst Inst Memory Imm Ext add rd1 GPRs rs1 rs2 ws wd rd2 we wdata addr wdata.
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
Advanced Architectures
Computer Organization
CDA3101 Recitation Section 8
ARM Organization and Implementation
William Stallings Computer Organization and Architecture 8th Edition
CSCI206 - Computer Organization & Programming
Morgan Kaufmann Publishers
Single Clock Datapath With Control
Pipeline Implementation (4.6)
Morgan Kaufmann Publishers The Processor
Computer Organization and ASSEMBLY LANGUAGE
Lecture 5: Pipelining Basics
CSC 4250 Computer Architectures
CSCI206 - Computer Organization & Programming
How to improve (decrease) CPI
ARM ORGANISATION.
Introduction to Computer Organization and Architecture
MIPS Pipelined Datapath
Pipelining.
Pipelining Hazards.
Presentation transcript:

Instruction Sets and Pipelining Cover basics of instruction set types and fundamental ideas of pipelining Later in the course we will go into more depth about implementation and more advanced topics

Outline Instruction set characteristics Review of the CPU and actions taken to fetch, decode, and execute a sample instruction Review of the fundamental idea of pipelining Fundamentals of RISC architectures

Outline - continued Pipelining with RISC Five-stage pipeline for a RISC processor Hazards and pipeline stalls CPI definition and calculation Structural hazards Data hazards

Instruction Set Architecture Classes Consider the next diagram (figure 2.1) and the table figure 2.2 on page 93 to examine the differences between the four classes of instruction sets. Historically stack and accumulator style were popular architectures, after 1980 most have used load-store (the right-most in both diagrams).

General-purpose Register Computers GPR computers have two advantages: First, registers are faster than memory Second, registers are a more efficient way for compilers than other forms of internal storage Registers can be used to hold variables This reduces memory traffic vice the alternative of having memory hold variables

DSP Comment DSPs can differ. The remark in the first line of page 94 is worth noting: because of the dominance of hand-optimized code in the DSP community the DSPs may have many special-purpose registers and only a few general-purpose registers.

Two Major Instruction Set Characteristics ALU instructions have two or three operands How many of the operands may be memory addresses in ALU instructions Consider carefully the two tables on page 94 and 95. Especially note the advantages and disadvantages.

The CPU Review the next two slides that depict a simple CPU and an associated slide that shows one instruction broken down into the different machine actions

Remarks The MAR and MDR components can operate independently from the ALU and IR decoder since they deal with memory. The instruction or IR decoding section of the graph is quite independent from the rest of the diagram (it doesn’t require the bus for example).

Remarks - continued In effect three parts of this diagram operate somewhat independently: the ALU, the IR decoder and the MAR/MDR which sends data to and from the memory. Pipelining builds on this independence: different instructions can be using the IR decode, the ALU and the memory transfer functions somewhat independently.

Remarks The first three steps mainly fetch the next instruction (1 PC out through 3 IR in ). Steps 4-6 are mainly involved in executing the actual adding part of the instruction (6 … Add) Step 7 is involved in writing the output of the Add instruction The decode part of the operation is more implicit.

Pipelining Review This is from the CS 4014 course and represents a four-stage pipeline vice the five- state RISC pipeline that we will study later. The difference is that this diagram doesn’t have a mem stage – it being combined in other stages

Pipelining Review Formally pipelining is an implementation technique takes advantage of the parallelism that exists among the actions needed to execute an instruction. Informally pipelining is like an assembly line.

Remarks Refer to the earlier CPU diagram and the example of a sample instruction and the actual CPU operations. Note that the fetch, decode, execute and write parts of instructions could (in principle) be separated and make use of independent parts of the CPU.

Appendix A A1 and A2 are the only sections that we will study for now. The time required to move an instruction one step down the pipeline is a processor cycle. If the stages are perfectly balanced then the average time per instruction in a pipelined processor is: time per instruction / number of stages

Remark Depending on how you look at it the reduction due to pipelining can be viewed either as decreasing the CPI or as decreasing the clock cycle time or both.

RISC Instruction Set Implementation in a Pipeline 5 stages IF – instruction fetch ID – instruction decode Ex – execution Mem – memory access WB – write-back (result to register) Look over figure A.1 on page A-7 and the next diagram.

Pipeline = series of data paths shifted in time IM – instruction memory, DM – data memory

Remarks Note usage of pipeline registers discussed on page A-9 and the fact that they are edge- triggered so values change instantaneously on a clock edge.

Performance Issues in Pipelining Go through the example on pages A-10, 11 Stalls and performance are handled with calculations like those found on page A-12 Although there are different ways of defining performance and recalling our in-class discussion last week: note the second paragraph remark: The ideal CPI on a pipelined processor is almost always 1

Pipeline Hazards Structural – resource conflicts when the hardware cannot support all combinations of instructions Data – instruction depends on the result of a previous instruction (time dependent – can’t read the result until it is computed and stored by another instruction) Control – caused by branchs

Hazards cause Stalls The pipeline must be held up temporarily or stalled when a hazard occurs. As a result, no new instructions are fetched during the stall (study why in the last paragraph of page A-11).

A processor with only one memory port will generate a conflict. The load instruction needs the memory port in CC 4 at the same time as instruction 3 needs the memory port.

Remark on figure A.4 Look over figure A.5 on page A-15 where the conflict is settled by introducing a stall for instruction i+3.

Data Hazards The pipeline changes the order of read/write accesses to operands so that the order differs from the order seen by sequential processing.

Example Example: two sequential statements: R1 = R2 + R3; R5 = R4 – R1; Now consider the pipelining of these two statements, see page A-17 and figure A.5 (also the next diagram). In pipelining R1’s value from the first instruction may not be updated before it is needed in the second instruction.

Branch/Control Hazards Look over the examples in figures A.11 through A.14.