Professional Documents
Culture Documents
Objectives
A brief overview of week6 RISC Architecture CISC Architecture CPU Registers and Cache Superscalar Comparison
Timing of Pipeline
Pipelining
30 A B C D
Multiple tasks operating simultaneously using different resources
March 20, 2012
40
40
40
40 20
(Dr. John Kubiatowicz, UC Berkeley) Richard Salomon, Sudipto Mitra Copyright Box Hill Institute
between the CPU and other system components Perform data changing operations only in the CPU
March 20, 2012
RISC Characteristics
Simple fixed length instructions that
for
What is RISC ?
Introduction
RISC stands for Reduced Instruction Set Computer RISC processors have simpler types of instructions than CISC CISC stands for Complex Instruction Set Computer RISC computers are optimized to reduce the number of cycles per instruction Instruction Pipelining Sudipto Mitra More Registers Richard Salomon,Hill Institute Copyright Box
Introduction - RISC
Simple address modes Simpler is better - easier design (& less time) Save space - simpler means smaller & faster Smaller means less heat Load/Store architecture Uniform instruction length Instruction pipelining
Richer instruction set, some simple, some very complex Instructions generally take more than 1 clock to execute Instructions of a variable size Instructions interface with memory in multiple mechanisms with complex addressing modes Microcode control No pipelining
(Yi gao, Shilang Tang, Zhongli Ding) Richard Salomon, Sudipto Mitra Copyright Box Hill Institute
Alternative - RISC
CISC: 3 instructions Load Register 1, B Add Register 1, C Store Register 1, A RISC:10 instruction Address of B in read register Read B Move data Register 1 Address of C in read register Read C Move data Register 2 Add Register 1, Register 2, Register 3 Move Register 3 to write register Address of A in write register Write A to memory
March 20, 2012
(Programming Language Design and Implementation, Prentice Hall, 2000) Richard Salomon, Sudipto Mitra Copyright Box Hill Institute
CISC Architecture
It is based on the Von Neumann architecture Motivated by a desire to have low memory bandwidth due to memory being expensive & slow
RISC Architecture
It is based on the Harvard Architecture to achieve the goal of one instruction per Richard Salomon, Sudipto Mitra cycle Copyright Box Hill Institute
CISC Architecture
Main Memory
Cache
Instructions/Data
RISC Architecture
Independent paths for instructions & data Control Unit can be hardwired due to low number of simple operations. Less processing logic.
Data Cache (Data) Data Main Memory Cache (Instructions)
Richard Salomon, Sudipto Mitra Copyright Box Hill Institute
Processor (hardwired)
Instructions
March 20, 2012
Instructions
Prefetching and Cache Registers Superscalar (multiple execution units) Pipelining / Stalls Reordering (Out-of-Order execution) Branch Prediction Code Creep (Code Bloat)
Richard Salomon, Sudipto Mitra Copyright Box Hill Institute
CPU
32 Data Cache 32 Internal Buses 32
Instruction Cache 32
I/O Adaptors
To I/O devices
Main Memory
M- I/O Bus
Registers v Cache
Cache
Recently used local scalars Individual variables Blocks of memory Compiler assigned global variables Recently used global variables Save/restore based on procedure Save/restore based on nesting caching algorithm Register addressing Memory addressing
(W Stallings)
March 20, 2012
Registers
More registers help with performance Programs are often loading, unloading and overwriting these locations sometimes too soon With more registers you keep the data longer which can mean increased performance
More Registers
Global Registers R0 to R9
Are seen by all procedures, and are used to store global program variables.
GLOBAL
March 20, 2012
R0
Richard Salomon, Sudipto Mitra Copyright Box Hill Institute
HIGH
LOCAL
LOW HIGH LOCAL LOW HIGH LOCAL LOW
R9
Global
March 20, 2012
A Global
B Global
C C Global
R0
(W Stallings)
March 20, 2012
(W Stallings)
March 20, 2012
Superscalar (1)
Allow more things to happen at once Add extra execution units Instructions could be interwoven so that each execution unit could be kept busy Superscalar means that more work can get done at the same time
Superscalar (2)
PowerPC G4 processor:
The Branch Unit dispatches up to the 3 main execution units. Each of these has its own register sets. Up to 3 instructions can be issued per cycle: a branch and 2 instructions to any 2 separate execution units. Sudipto Mitra Richard Salomon,
March 20, 2012
CISC IBM 370/168 1973 DEC VAX Intel 11/780 486 1978 1989
235
51
94
184
62
32
4 or 8
11
11
32
32
32
23-256
Cache Stalls
If you have a pipe, and one of the stages is dependent on another instructions data and the instruction hasn't been completed, then the process stalls.
Branch instructions (conditionals) stall the process Prediction tries to guess which data or commands will be required next Development:
Compiler bit was set to the most often used path Then set to go the same way next time Load both options - then discard the wrong one
March 20, 2012
ADD Rs, S2, Rd Rd <- Rs+S2 Add the contents of the source register Rs to S2 a CPU register or a constant, store result to destination register Rd
Clear Register
CLR Rs, S2 ADD R0, R0, Rd ADD R0, R0, R0 Rd := 0 + 0 R0 := 0 + 0
NOP
NOP
Register
File
Instruction Cache. 64 Kb
March 20, 2012
Data Cache. 64 Kb
Richard Salomon, Sudipto Mitra Copyright Box Hill Institute
BUS
CISC
large variable variable small slow
Current Development
More transistors means less need for tight design More complex single-stream processors
more parallelism in a single core get the processor to do more in each cycle
There are no commercially available CPUs (computers) that employ a pure RISC architecture Because current technology allows us to place literally millions of transistors on a chip, the best features of both CISC and RISC are employed in modern CPUs Now we can investigate the CISC vs RISC story in more detail
March 20, 2012
Reality Check
Summary
RISC is a philosophy with the goal to reduce the COMPLEXITY in the processor Using your CORE space more wisely Simpler instructions = easier design Easier design = faster to market
References
Stallings William, 2003, Computer Organization & Architecture designing for performance, 7th edn, Pearson Education, Inc. D.Tabak, RISC Architecture, Research Studies Press, 1987 A.J. van de Goor, Computer Architecture and Design, Addison-Wesley, 1989 Computer System Architecture, M Morris Mano, 3rd edn, Prentice Hall. A.L.Decegama, The Technology of Parallel Processing, Prentice-Hall, 1989 K.Dowd & C.R. Severance , High Performance Computing, OReilly, 1998
March 20, 2012
References
RISC Machines, Ric Giaquinta, Graeme Brokenshire, Abele Woldekidan Comparison Between CISC and RISC, Yi gao, Shilang Tang, Zhongli Ding, May 2000 http://www.mackido.com http://www.cs.washinton.edu/homes/lazowaska/cra/ris c.html http://www.pcmech.com/cpuhistory.html http://www.lightner.net/lightner/zen.html http://gene.wins.uva.nl/~djakman/Paper_APR.html http://thetech.pcwebopedia.com/TERM/m/microproces sor.html
Richard Salomon, Sudipto Mitra Copyright Box Hill Institute