Top Banner
Midterm Thursday let the slides be your guide Topics: • First Exam - definitely cache, . . • Hamming Code • External Memory & Buses - Interrupts, DMA & Channels, RAID, . . • OS Support - Managing Resources, Scheduling, Memory Management, . . • Pipelining - Phases, Gains, Hazards, Stalling, . .
17

Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

Midterm Thursdaylet the slides be your guide

Topics:

• First Exam - definitely cache, . .

• Hamming Code

• External Memory & Buses - Interrupts, DMA & Channels, RAID, . .

• OS Support - Managing Resources, Scheduling, Memory Management, . .

• Pipelining - Phases, Gains, Hazards, Stalling, . .

Page 2: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS

(RISC)

Pipelining

(We will use MIPS as a practical example of RISC Pipelining)

(Microprocessor without Interlocked Pipeline Stages)

Page 3: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

Recall Key Features of RISC

—Limited and simple instruction set

—Memory access instructions limited to memory <-> registers

—Operations are register to register

—Large number of general purpose registers (and use of compiler technology to optimize register use)

—Emphasis on optimising the instruction pipeline (& memory management)

—Hardwired for speed (no microcode)

Page 4: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

Pipelining ReviewPipelining:

— Break instruction cycle into n phases (one stage per phase)

– e.g. Fetch, Decode, ReadOPs, Execute1, Execute2, WriteBack

— Fetch a new instruction each phase

— Maximum speed gain is n

— Hazards reduce the ability to achieve a gain of n– Types of Hazards

+ Resourceo Hazard occurs when instruction needs a resource being used by another

instruction

+ Datao RAW (hazard if read can occur before write has finished) o WAR (hazard if write can occur before read is finished)o WAW (hazard if writes occur in the unintended order)

+ Controlo Hazard occurs when a wrong fetch decision at a branch results in an

extra instruction fetch and a pipeline flush

— Stalling can always “fix” a hazard

Page 5: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

Data Hazards

• Read after Write (RAW) – true dependency— A Hazard occurs if the Read occurs before the Write is

complete– e.g. Reg 1 Reg 1 + Reg 2 {write occurs after execution} Reg 3 reg 1 – Reg 3 {read occurs before execution}

• Write after Read (WAR) – anti-dependency

— A Hazard occurs if the Write occurs before the Read happens– e.g. Reg M(ptr) {2 memory accesses – long read} {M(ptr) & M(pc)

are same loc}

M(pc) Reg {1 memory access – short write}

• Write after Write (WAW) – output dependency

— A Hazard occurs if the two Writes occur in the reverse order than intended

– e.g. Reg A M(PTR) {2 memory accesses – long write} Reg A Reg B {0 memory accesses – short write}

Page 6: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

Control Hazard

Control Hazards occur when a wrong fetch decision results in a new instruction fetch and the pipeline being flushed

Solutions include:— Multiple Pipeline streams— Prefetching the branch target — Using a Loop Buffer— Branch Prediction— Delayed Branch— Reordering of Instructions— Multiple Copies of Registers (backups)

Page 7: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS Example

• MIPS is a good example of a RISC Architecture (relatively simple and real)

• We will look at how it is organized in terms of Data Paths, and

• And how its pipelining works

Page 8: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS(RISC)

Instructions

(I type) (FP type)

Similar to I and R type

J (J type)

B (I type)

Page 9: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS Instructions

Page 10: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS Instruction Formats

Page 11: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

Basic MIPS Organization

Note: Memory is shown as Instruction and Data Memories. This could be

a) two memories,

b) 2-port memory, or

c) simply a model that allows us to picture the process (timing) moving basically from left to right.

Page 12: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS Basic Data Paths with Controls Shown

Page 13: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS Data Paths with Generation of Control Signals

Note: This figure does not show J (jump) type instruction Data Paths

Page 14: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS Data Paths with Control Signals(including paths for J-type instructions)

Page 15: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS Pipeline Stages

Page 16: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPS Pipelined Data Paths IF | ID | EX | MEM | WB

Page 17: Midterm Thursday let the slides be your guide Topics: First Exam - definitely cache,.. Hamming Code External Memory & Buses - Interrupts, DMA & Channels,

MIPs Pipelined Machine with Controls IF | ID | EX | MEM | WB

(64 bits)

(142 bits)

(107 bits)

(71 bits)