Group 9 Risc

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

RISC

Reduced Instruction
Set Computers
Introduction

What is RISC?
Reduced Instruction Set Computer. is a type
of microprocessor architecture that utilizes a
small, highly-optimized set of instructions,
rather than a more specialized set of
instructions often found in other types of
architectures.
Examples of processors with
the RISC architecture include MIPS,
PowerPC, Atmel's AVR, the Microchip PIC
processors, Arm processors, RISC-V, and all
modern microprocessors have at least some
elements of RISC.
Instruction Execution Characteristics

Overview

Semantic Gap - the difference between the operations provided in high-


level languages and those provided in computer architecture

Symptoms of the semantic gap:


- Execution inefficiency
- Excessive machine program size

Compiler complexity oNew designs had features trying to close gap:


- Large instruction sets
- Dozens of addressing modes
- Various HLL statements in hardware
Intent of these designs:

- Make compiler-writing easier

- Improve execution efficiency by implementing complex sequences of


operations in microcode

- Provide support for even more complex and sophisticated HLL’s

Concurrently, studies of the machine instructions generated by HLL


programs

- Looked at the characteristics and patterns of execution of such instructions

- Results lead to using simpler architectures to support HLL's, instead of


more complex
To understand the reasoning of the RISC advocates, we look at study results on
3 main aspects of computation:

Operations performed - the functions to be performed by the CPU and its interaction
with memory.

Operands used - types of operands and their frequency of use. Determine memory
organization and addressing modes.

Execution Sequencing - determines the control and pipeline organization.


Operations

O Simple counting of statement frequency indicates that assignment (data


movement) predominates, followed by selection/iteration.

O Weighted studies show that call/return actually accounts for the most work

O Target architectural organization to support these operations well

O Patterson study also looked at dynamic frequency of occurrence of classes


of variables. Results showed a preponderance of references to highly localized
scalars:

- Majority of references are to simple scalars


- Over 80% of scalars were local variables
- References to arrays/structures require a previous ref to their index or
pointer, which is usually a local scalar
Operands
O Another study found that each instruction (DEC-10 in this case) references 0.5 operands in memory and
1.4 registers.
O Implications:
- Need for fast operand accessing
- Need for optimized mechanisms for storing and accessing local scalar variables

•Execution Sequencing
O Subroutine calls are the time-consuming operation in HLL's
O Minimize their impact by
O Streamlining the parameter passing
- Efficient access to local variables ßSupport nested subroutine invocation
O Statistics
- 98% of dynamically called procedures passed fewer than 6 parameters
- 92% use less than 6 local scalar variables
- Rare to have long sequences of subroutine calls followed by returns (e.g., a recursive sorting algorithm)
- Depth of nesting was typically rather low
- •Implications
O Reducing the semantic gap through complex architectures may not
be the most efficient use of system hardware
O Optimize machine design based on the most time-consuming tasks of
typical HLL programs
O Use large numbers of registers
- Reduce memory reference by keeping variables close to CPU (more register
refs instead)
- Streamlines instruction set by making memory interactions primarily loads and
stores
O Pipeline design
- Minimize impact of conditional branches
O Simplify instruction set rather than make it more complex
What is a Large register files?

Larger register files are then sometimes


constructed by tiling mirrored and rotated simple
arrays. Register files have one word line per entry
per port, one bit line per bit of width per read port,
and two bit lines per bit of width per write port.
Each bit cell also has a Vdd and Vss.
Large register files have many advantages.
If used effectively they can:

1)reduce memory traffic by removing load and


store operations;

2) improve performance by decreasing path


length; and

3) decrease power consumption by eliminating


operations to the memory hierarchy.
Large register files vs Cache
Difference Between Cache and Register is
that Memory cache helps speed the
processes of the computer because it
stores frequently used instructions and
data. While registers are also a part of a
computer processor and holding one small
piece of data in Processor.
Compiler-Based Register Optimization

 In this case, the number of registers is small compared to the large register file implementation
 The compiler is responsible for managing the use of the registers
 Compiler must map the current and projected use of variables onto the available registers
 Similar to a graph coloring problem
 Form a graph with variables as nodes and edges that link variables that are active at the same time
 Color the graph with as many colors as you have registers
 Variables not colored must be stored in memory
Graph Coloring Approach
Reduced Instruction Set Architecture

Why CISC?
 CISC trends to richer instruction sets
 More instructions
 More complex instructions

 Reasons:
 To simplify compilers
 To improve performance
Are compilers simplified?
 Assertion: If there are machine instructions that resemble HLL statements, compiler
construction is simpler

 Counter-arguments:

 Complex machine instructions are often hard to exploit because


the compiler must find those cases that fit the construct
 Other compiler goals
o Minimizing code size
o Reducing instruction execution count

o Enhancing pipelining are more difficult with a complex


instruction set
 Studiesshow that most instructions actually produced by CISC
compilers are the relatively simple ones

Is performance improved?
 Assertion: Programs will be smaller and they will execute faster
 Smaller programs save memory
 Smaller programs have fewer instructions, requiring less instruction
fetching
 Smaller programs occupy fewer pages in a paged environment, so
have fewer page faults
 More instructions fit in cache(s)
 Counter:
 Inexpensive memory makes memory savings less compelling
Characteristics of Reduced Instruction Set Architectures

 One instruction per cycle


 A machine cycle is defined to be the time it takes to fetch two operands
from registers, perform an ALU operation, and store the result in a register.
 RISC machine instructions should be no more complicated than, and
execute about as fast as, microinstructions on CISC machines.
 there is little or no need for microcode; the machine instructions can be
hardwired.
 Register-to-register operations
 simplifies the instruction set control unit.
o Ex: the VAX has 25 different ADD instructions
 encourages the optimization of register use
 Simple addressing modes
 Almost all instructions use simple register addressing.
 more complex modes can be synthesized in software from the
simple ones.
 Simple instruction formats
 only one or a few formats are used
 Instruction length is fixed and aligned on word boundaries.
 Field locations, especially the opcode, are fixed.
Potential Benefits
 more effective optimizing compilers
 most instructions generated by a compiler are relatively simple anyway.
 The instruction pipelining technique can be applied much more effectively with a reduced
instruction set.
 RISC processors are more responsive to interrupts
CISC versus RISC Characteristics

(1) RISC designs may benefit from the inclusion of some CISC features and that
(2) CISC designs may benefit from the inclusion of some RISC features.
RISC Pipelining
o Register-to-register, so an instruction cycle has 2 phases
 I: Instruction Fetch
 E: Execute (an ALU operation w/ register input and output)
o For load and store operations, 3 phases are needed
 I: Instruction fetch
 E: Execute (actually memory address calculation)
 D: Memory (register-to-memory or memory-to-register)
 Since the E phase usually involves an ALU operation, it may be longer than the other
phases.
o E1: Register file read o E2: ALU operation and register write
Optimization of Pipelining
 Delayed Branch
 makes use of a branch that does not take effect until after the execution of the following
instruction
• branch "takes effect" during its execution phase
• the instruction location immediately following the branch is called the delay slot
• Rather than wasting an instruction with a NOOP, it may be possible to move the
instruction preceding the branch to the delay slot, while still retaining the original program
semantics
 Conditional branches
 NOOP delay is still required.
 Berkeley RISC and IBM 801 systems
 Delayed Load
 On load instructions, the register to be loaded is locked by the processor
 The processor continues execution of the instruction stream until reaching an instruction needing
a locked register
 If load takes a specific maximum number of clock cycles, it may be possible to rearrange
instructions to avoid the idle.
Super pipelining
 The one that makes use of more, and
finer-grained, pipeline stages.
 The MIPS R3000 is an example of super
pipelining
• All instructions follow the same
sequence of 5 pipeline.
 External instruction and data cache
operations, and the ALU operations, into
2 phases
• A super pipelined system existing hardware is used several times per cycle by inserting pipeline registers
to split up each pipe stage
• The multiple depends on the degree of super pipelining

 The MIPS R4000 is an example of super pipelining of degree 2


The RISC vs. CISC Controversy
 RISC approach is demonstrably better.
 RISC to CISC are hampered by several problems
 There is no pair of RISC and CISC machines that are closely comparable.
 Most commercially available “RISC” machines possess a mixture of RISC and CISC
characteristics.

• RISC systems have become more complex (As chip densities and speeds increase)
• To improve performance, CISC systems have increased their number of generalpurpose
registers and increased emphasis on instruction pipeline design.

You might also like