Computer architecture Lecture 11: Reduced Instruction Set Computers Piotr Bilski.

Slides:



Advertisements
Similar presentations
Reduced Instruction Set Computers
Advertisements

CPU Structure and Function
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
ELEN 468 Advanced Logic Design
Computer Organization and Architecture
RISC Processors – Page 1 of 46CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: RISC Processors Reading: Stallings, Chapter.
PART 4: (2/2) Central Processing Unit (CPU) Basics CHAPTER 13: REDUCED INSTRUCTION SET COMPUTERS (RISC) 1.
Computer Organization and Architecture
Computer Organization and Architecture
Chapter 13 Reduced Instruction Set Computers (RISC) CISC – Complex Instruction Set Computer RISC – Reduced Instruction Set Computer HW: 13.6, 13.7 (Due.
Chapter XI Reduced Instruction Set Computing (RISC) CS 147 Li-Chuan Fang.
Chapter 13 Reduced Instruction Set Computers (RISC)
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
Chapter 13 Reduced Instruction Set Computers (RISC) Pipelining.
Major Advances in Computers(1) The family concept —IBM System/ —DEC PDP-8 —Separates architecture from implementation Microporgrammed control unit.
RISC. Rational Behind RISC Few of the complex instructions were used –data movement – 45% –ALU ops – 25% –branching – 30% Cheaper memory VLSI technology.
1 Pertemuan 23 Reduced Instruction Set Computer 1 Matakuliah: H0344/Organisasi dan Arsitektur Komputer Tahun: 2005 Versi: 1/1.
Chapter 13 Reduced Instruction Set Computers (RISC) CISC – Complex Instruction Set Computer RISC – Reduced Instruction Set Computer.
S. Barua – CPSC 440 CHAPTER 5 THE PROCESSOR: DATAPATH AND CONTROL Goals – Understand how the various.
Reduced Instruction Set Computers (RISC)
Reduced Instruction Set Computers (RISC) Computer Organization and Architecture.
CH12 CPU Structure and Function
Advanced Computer Architectures
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
RISC Processors – Page 1CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: RISC Processors Reading: Stallings, Chapter 13.
COMPUTER ORGANIZATIONS CSNB123 May 2014Systems and Networking1.
Computer Organization and Architecture Reduced Instruction Set Computers (RISC) Chapter 13.
CH13 Reduced Instruction Set Computers {Make hardware Simpler, but quicker} Key features  Large number of general purpose registers  Use of compiler.
Caltech CS184b Winter DeHon 1 CS184b: Computer Architecture [Single Threaded Architecture: abstractions, quantification, and optimizations] Day3:
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
RISC ProcessorsCSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: RISC Processors Reading: Stallings, Chapter 13.
Chapter 8 CPU and Memory: Design, Implementation, and Enhancement The Architecture of Computer Hardware and Systems Software: An Information Technology.
MIPS Processor Chapter 12 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
M. Mateen Yaqoob The University of Lahore Spring 2014.
ECEG-3202 Computer Architecture and Organization Chapter 7 Reduced Instruction Set Computers.
Reduced Instruction Set Computers. Major Advances in Computers(1) The family concept —IBM System/ —DEC PDP-8 —Separates architecture from implementation.
Computer Organization Rabie A. Ramadan Lecture 3.
COMPUTER ORGANIZATIONS CSNB123 NSMS2013 Ver.1Systems and Networking1.
Lecture 2: Instruction Set Architecture part 1 (Introduction) Mehran Rezaei.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Topics to be covered Instruction Execution Characteristics
William Stallings Computer Organization and Architecture 8th Edition
ELEN 468 Advanced Logic Design
Advanced Topic: Alternative Architectures Chapter 9 Objectives
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
CS/COE0447 Computer Organization & Assembly Language
Instructions - Type and Format
Lecture 4: MIPS Instruction Set
William Stallings Computer Organization and Architecture 8th Edition
The University of Adelaide, School of Computer Science
Computer Architecture
Chapter 13 Reduced Instruction Set Computers
Instruction Set Principles
Instruction-level Parallelism: Reduced Instruction Set Computers and
Chapter 12 Pipelining and RISC
Lecture 4: Instruction Set Design/Pipelining
Chapter 11 Processor Structure and function
COMPUTER ORGANIZATION AND ARCHITECTURE
Presentation transcript:

Computer architecture Lecture 11: Reduced Instruction Set Computers Piotr Bilski

Characteristics of the RISC architecture Processor contains large number of the general purpose registers RISC compilers use procedures for the register usage optimization Number of the instructions is small in comparison with CISC architecture Instructions have basic structure Instruction pipeline is optimized

Comparison between the selected processors Parameter IBM 370 VAX SPARC MIPS R4000 PowerPC Ultra Sparc Prod. year Instructions number Instruction size 2-6 B2-57 B1-11 B4 B Addressing modes Register number Cache size64 kB 8 kB32 kB128 kB16/32 kB32 kB

RISC and the programming languages High-level language – alleviations for the programmer, multiple hidden details Necessity to translate high-level language into the machine language Small high-level programs  large machine programs Increase of the effectiveness requires construction of the complex compilers

Characteristics of the executed instructions Instruction types – instructions executed by the processor Types and number of the instruction arguments Instruction scheduling – pipelining

Analysis of the frequency of the executed instructions [%] LanguagePascalFortranPascalCSAL TaskScientificStudentSystem Assigning Loops43534 Call If Goto29030 Other07616

Dynamic occurence Weighted according to the machine instruction Weighted according to the memory reference Language PascalC C C ASSIGN45%38%13% 14%15% LOOP5%3%42%32%33%26% CALL15%12%31%33%44%45% IF29%43%11%21%7%13% GOTO03%0000 other6%1%3%1%2%1% Analysis of the frequency of the executed instructions (cont.)

Arguments processed by the instructions PascalCAverage Constant numbers 16 %23 %20 % Scalar variables 58 %53 %55 % Tables/ structures 26 %24 %25 %

Exploitation of the arguments in the procedure calls Programs including:Compiler, interpreter Small, non-numerical programs 3-4 arguments0-7 %0-5 % 5-7 arguments0-3 %0 % 8-11 arguments1-20 %0-6 % 12 and more arguments 1-6 %0-3 %

Register tables Requirement for the assignment operations optimization – registers Local variables should be stored in one register block Problem of passing arguments to funcions and returning variables Nested function calls and the number of the registers

Register windows Functions use small number of the local variables, so every function requires small number of registers Every function has different set of the registers assigned (so-called window) Neighbor windows overlap, allowing to pass arguments between functions

Register windows - organization Parameter registers Local registers Temporary registers Parameter registers Local registers Temporary registers level I level I+1 Call/return

Window registers - example Current window pointer (CWP) Saved window pointer (SWP)

Global variables Handled by the global registers set Problem of the global register addressing in the window – uniform addressing mode Decision about assignment of the variables to the register depends on the compiler

Registers table and cache Large register tableCache memory All local scalarsRecently used local scalars Single variablesMemory blocks Global variables pointed by the compiler Global variables recently used Variables stored depending on the function nesting Variables stored depending on the swap algorithm Register addressingMemory addressing

Registers table and cache (cont.) R Instruction Decoder Row number Data A Instruction comparison Data Pointers a) b)

Register olptimization using compiler For the small number of registers, decision must be made, which variables should be assigned to them An infinite number of the symbolic registers is created, which are further mapped onto the real registers Assignment is the graph coloring problem

Graph coloring example Vertices are symbolic registers Colors are real registers Register interference

Problems of the compiler design Does smaller program mean smaller machine code? Are programs containing more complex procedures faster? proc. 1proc. 2proc. 3 RISC I1,0 VAX 110,80,67 M680000,9

RISC instruction characteristics One instruction executed during the cycle Data transfer operations „from register to register” Only simple addressing modes Simple instruction formats

RISC machine instruction One instruction during one machine cycle Machine cycle is the time required to fetch two arguments from registers, performing ALU operation and storing result into the register no microcode, instruction executed by the hardware!

Data transfer register-register All data should be in registers Exceptions are memory references (LOAD, STORE) Smaller instruction list, simpler control unit AddBCA ACB SubtractBDD AddrArBrC AddrBrArC SubtractrD rB Instruction size = 168 B Instruction size = 60 B

Simple instruction formats All instructions have constant size! Simple instructions are easier to optimize during compilation ALU for the simpler instructions is simpler and faster Pipelining is more effective Easier interrupt handling The most frequently executed instructions can be implemented in the hardware

CISC vs RISC ProcessorTypeInstruction size Indirect addressing Argument number R2000RISC4 Bno1 SPARCRISC4 Bno1 IBM RS/6000RISC4 Bno1 Intel i860RISC4 Bno CISC12 Bno2 M68040CISC22 Byes2 VAXCISC56 Byes6

Pipelining Register-to-register processing –Instruction fetching (F) –Instruction execution (E) Loading and writing into memory –Instruction fetching (F) –Instruction execution (E) –Memory operation (M)

Sequential operation and pipelining F E M

Pipelining 2-stage – one memory access 3-stage – two memory accesses 4-stage F E M F E F E M F E M F F E 1 E 2 M

Pipelining with branch Program: 100 LOAD X,A 101 ADD 1,A 102 JUMP ADD A,B 104 SUB C,B 105 STORE A,Z F E M F E F F E M

Insertion of the empty instruction Program: 100 LOAD X,A 101 ADD 1,A 102 JUMP NOOP 106 STORE A,Z F E M F E F E M F E

Reversed instruction sequence Program: 100 LOAD X,A 101 JUMP ADD 1,A 105 STORE A,Z F E M F E F E M

RISC example – MIPS R bit architecture processor (with such registers and ALU bus) In the R4000 there is one processor and one Memory Management Unit – MMU 32 general purpose registers, up to 128 kB of the cache memory (half for the instructions and data) Constant instruction format – 4 bytes No conditional codes Three instruction formats

MIPS R4000 instruction formats Operation rs rt Immediate OperationTarget Operation rs rt rd offset function Operation with the immediate operand branch Register addressing

RISC example – Sun SPARC processor uses register windows (2 to 32 windows 24 registers each) Eight global registers (0-7) Output registers (called with the called procedure, 8-15) Input registers (used with the calling procedure, 24-31) Local registers, labelled with All instructions 32-bit long

SPARC instruction formats Op relative shifting of the program counter 2 30 Op a cond. op2 rel. shift. of the progr. Count Op Target op2 Immediate constant Op Target Op3 Src-1 FP-op Src Op Target Op3 Src-1 0 dism. Src Op Target Op3 Src-1 1 Imm. constant call branch SETHI Floating point format Generic format