Docsity

Computer Architecture: Pipelining and Performance Enhancement, Lecture notes of Advanced Computer Architecture

Toggle sidebar
bg1
FUNDAMENTALS OF COMPUTER DESIGN
Introduction
Today’ s desktop computers (less than $500 cost) ar e having more performance, larger
memory and storage than a computer bought in 1085 for 1 million dollar. Highest performance
microprocessors of today outperform Supercomputers of less than 10 years ago. The rapid
improvement has come both from advances in the technology used to build computers and
innovations made in the computer design or in other words, the improvement made in the
computers can be attributed to innovations of technology and architecture design.
During the first 25 years of electronic computers, both forces made a major contribution,
delivering performance improvement of about 25% per year.
Microprocessors were evolved during late 1970s and their ability along with improvements
made in the Integrated Circuit (IC) technology y contributed to 35% performance growth per
year.
The virtual elimination of assembly language programming reduced the n eed for object-code
compatibility. The creation of standardized vendor-independent operating system lowered the
cost and risk of bringing out a new architecture.
In the yearly 1980s, the Reduced Instruction Set Computer (RISC) based machines focused the
attention of designers on two critical performance techniques, the exploitation Instruction Level
Parallelism (ILP) and the use of caches. The figu re 1.1 shows the growth in processor
performance since the mid 1980s. The graph plots performance relative to the VAX-11/780 as
measured b y the SPECint benchmarks. From the figure it is clear that architectural and
organizational enhancements led to 16 years of sustained growth in performance at an annual
rate of over 50%. Since 2002, processor performance improvement has dropped to about 20%
per year due to the following hurdles:
•Maximum power dissipation of air-cooled chips
•Little ILP left to exploit efficiently
•Limitations laid by memory latency
The hurdles signals historic switch from relying solely on ILP to Thread Level
Parallelism (TLP) and Data Level Parallelism (DLP).
Classes of Computers
1960: Large Main frames (Millions of $ )
(Applications: Business Data processing, large Scientific computin g)
1970: Minicomputers (Scientific laboratories, Time sharing concepts)
1980: Desktop Computers (μPs) in the form of Personal computers and workstations.
(Larger Memory, more computing power, Replaced Time sharing systems)
1990: Emergence of Internet and WWW, PDAs, emergence of high performance digital
consumer electronics
2000: Cell phones
These changes in computer use have led to three different computing classes each
characterized by different applications, requirements and computing technologies growth in
processor performance since 1980s.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Computer Architecture: Pipelining and Performance Enhancement and more Lecture notes Advanced Computer Architecture in PDF only on Docsity!

FUNDAMENTALS OF COMPUTER DESIGN

Introduction Today’ s desktop computers (less than $500 cost) ar e having more performance, larger memory and storage than a computer bought in 1085 for 1 million dollar. Highest performance microprocessors of today outperform Supercomputers of less than 10 years ago. The rapid improvement has come both from advances in the technology used to build computers and innovations made in the computer design or in other words, the improvement made in the computers can be attributed to innovations of technology and architecture design. During the first 25 years of electronic computers, both forces made a major contribution, delivering performance improvement of about 25% per year. Microprocessors were evolved during late 1970s and their ability along with improvements made in the Integrated Circuit (IC) technology y contributed to 35% performance growth per year. The virtual elimination of assembly language programming reduced the n eed for object-code compatibility. The creation of standardized vendor-independent operating system lowered the cost and risk of bringing out a new architecture. In the yearly 1980s, the Reduced Instruction Set Computer (RISC) based machines focused the attention of designers on two critical performance techniques, the exploitation Instruction Level Parallelism (ILP) and the use of caches. The figu re 1.1 shows the growth in processor performance since the mid 1980s. The graph plots performance relative to the VAX-11/780 as measured b y the SPECint benchmarks. From the figure it is clear that architectural and organizational enhancements led to 16 years of sustained growth in performance at an annual rate of over 50%. Since 2002, processor performance improvement has dropped to about 20% per year due to the following hurdles: •Maximum power dissipation of air-cooled chips •Little ILP left to exploit efficiently •Limitations laid by memory latency The hurdles signals historic switch from relying solely on ILP to Thread Level Parallelism (TLP) and Data Level Parallelism (DLP).

Classes of Computers 1960 : Large Main frames (Millions of $ ) (Applications: Business Data processing, large Scientific computin g) 1970: Minicomputers (Scientific laboratories, Time sharing concepts) 1980: Desktop Computers (μPs) in the form of Personal computers and workstations. (Larger Memory, more computing power, Replaced Time sharing systems) 1990: Emergence of Internet and WWW, PDAs, emergence of high performance digital consumer electronics 2000: Cell phones These changes in computer use have led to three different computing classes each characterized by different applications, requirements and computing technologies growth in processor performance since 1980s.

Desktop computing:

The first and still the largest market in dollar terms is desktop computing. Desktop computing system cost range from $ 500 (low end) to $ 5000 (high-end configuration). Throughout this range in price, the desktop market tends to drive to optimize price- performance. The perf ormance concerned is compute performance and graphics performance. The combination of performance and price are the driving factors to the customers and the computer designer. Hence, the newest, high performance and cost effective processor often appears first in desktop computers.

Servers: Servers provide large-scale and reliable computing and file services and are mainly used in the large-scale en terprise computing and web based services. The three important characteristics of servers are: •Dependability : Severs must operate 24x7 hours a week. Failure of server system is far more catastrophic than a failure of desktop. Enterprise will lose revenue if the server is unavailable.

  • Scalability: as the business grows, the server may have to provide more functionality/ services. Thus ability to scale up the computin g capacity, memory, storage and I/O bandwidth is crucial.
  • Throughput : transactions completed per minute or web pages served per second are crucial for servers.

Embedded Computers: Simple embedded microprocessors are seen in washing machines, printers, network switches, handheld devices such as cell phones, smart cards video game devices etc. embedded computers have the widest spread of processing power and cost. The primary goal is often meeting the performance need at a minimum price rather than achieving higher performance at a higher price. The other two characteristic requirements are to minimize the memory and power. In many embedded applications, the memory can be substantial portion of the systems cost and it is very important to optimize the memory size in such cases. The application is expected to fit totally in the memory on the processor chip or off chip memory. The importance of memory size translates to an emphasis on code size which is dictated by the application. Larger memory consumes more power. All these aspects are considered while choosing or designing processor for the embedded applications.

▲ Control operations ▲ MIPS ISA: simple & easy to implement vi) Control flow instructions :All ISAs support: Conditional & Unconditional Branches Procedure C alls & Returns MIPS 80x

  • Conditional Branches tests content of Register Condition code bits
  • Procedure C all JAL CALLF
  • Return Address in a R Stack in M vii) Encoding an ISA Fixed Length ISA Variable Length ISA MIPS 32 Bit long 80x86 (1-18 bytes) Simplifies decoding Takes less space Number of Registers and number of Addressing modes have significant impact on the length of instruction as the register field and addressing mode field can appear many times in a single instruction.

Trends in Technology

The designer must be aware of the following rapid changes in implementation technology. •Integrated C ircuit (IC) Logic technology •Memory technology (semiconductor DRAM technology) •Storage o r magnetic disk technology •Network technology

Network Technology: Network performance depends both on the per formance of the switches and on the performance of the transmission system. Although the technology improves continuously, the impact of these improvements can be in discrete leaps.

Trends in Power in Integrated Circuits For CMOS chips, the dominant source of energy consumption is due to switching transistor, also called as Dynamic power and is given b y the following equation. Power = (1/2)Capacitive load Voltage**

  • Frequency switched dynamic •For mobile devices, energy is the better metric Energy dynamic = Capacitive load x Voltage 2 •For a fixed task, slowing clock rate (frequency switched) reduces power, but not energy •Capacitive load a function of number of transistors connected to output and technology, which determines capacitance of wires and transistors •Dropping voltage helps both, so went from 5V down to 1V •To save energy & dynamic power, most CPUs now turn off clock of inactive modules •Distributing the power, removing the heat and preventing hot spots have become increasingly difficult challenges.
  • The leakage current flows even when a transistor is off. Therefore static power is

equally important. Power static= Current static * Voltage

Trends in Cost

  • The underlying principle that drives the cost down is the learning curvemanufacturing costs decrease over time.
  • Volume is a second key factor in determining cost. Volume decreases cost since it increases purchasing manufacturing efficiency. As a rule of thumb, the cost decreases about 10% for each doubling of volume.
  • Cost of an Integrated Circuit Although the cost of ICs have dropped exponentially, the basic process of silicon manufacture is unchanged. A wafer is still tested and chopped into dies that are packaged.

Dependability:

The Infrastructure providers offer Service Level Agreement (SLA) or Service Level Objectives (SLO) to guarantee that their networking or power services would be Dependable.

  • Systems alternate between 2 states of service with respect to an SLA:
  1. Service accomplishment , where the service is delivered as specified in SLA
  2. Service interruption , where the delivered service is different from the SLA
  • Failure = transition from state 1 to state 2
  • Restoration = transition from state 2 to state 1 The two main measures of Dependability are Module Reliability and Module Availability. Module reliability is a measure of continuous service accomplishment (or time to failure) from a reference initial instant.
  1. Mean Time To Failure ( MTTF ) measures Reliability
  2. Failures In Time ( FIT ) = 1/MTTF, the rate of failures
  • Traditionally reported as failures per billion hours of operation
  • Mean Time To Repair ( MTTR ) measures Service Interruption
  • Mean Time Between Failures ( MTBF ) = MTTF+MTTR
  • Module availability measures service as alternate between the 2 states of accomplishment and interruption (number between 0 and 1, e.g. 0.9)
  • Module availability = MTTF / ( MTTF + MTTR)

Performance:

The Execution time or Response time is defined as the time between the start and completion of an event. The total amount of work done in a given time is defined as the Throughput. The Administrator of a data center may be interested in increasing the Throughput. The computer user may be interested in reducing the Response time. Computer user says that computer is faster when a program runs in less time.

Example:

A System contains Floating point (FP) and Floating Point Square Root (FPSQR) unit. FPSQR is responsible for 20% of the execution time. One proposal is to enhance the FPSQR hardware and speedup this operation by a factor of 15 second alternate is just to try to make all FP instructions run faster by a factor of 1.6 times faster with the same effort as required for the fast FPSQR, compare the two design alternative

Pipelining: Basic and Intermediate concepts

Pipeline is an implementation technique that exploits parallelism among the instructions in a sequential instruction stream. Pipeline allows to overlapping the execution of multiple instructions. A Pipeline is like an assembly line each step or pipeline stage completes a part of an instructions. Each stage of the pipeline will be operating an a separate instruction. Instructions enter at one end progress through the stage and exit at the other end. If the stages are perfectly balance. (assuming ideal conditions), then the time per instruction on the pipeline processor is given by the ratio:

Time per instruction on unpipelined machine/ Number of Pipeline stages Under these conditions, the speedup from pipelining is equal to the number of stage pipeline. In practice, the pipeline stages are not perfectly balanced and pipeline does involve some overhead. Therefore, the speedup will be always then practically less than the number of stages of the pipeline. Pipeline yields a reduction in the average execution time per instruction. If the processor is assumed

to take one (long) clock cycle per instruction, then pipelining decrease the clock cycle time. If the processor is assumed to take multiple CPI, then pipelining will aid to reduce the CPI.

A Simple implementation of a RISC instruction set Instruction set of implementation in RISC takes at most 5 cycles without pipelining. The 5 clock cycles are:

1. Instruction fetch (IF) cycle: Send the content of program count (PC) to memory and fetch the current instruction from memory to update the PC. 2. Instruction decode / Register fetch cycle (ID): Decode the instruction and access the register file. Decoding is done in parallel with reading registers, which is possible because the register specifies are at a fixed location in a RISC architecture. This corresponds to fixed field decoding. In addition it involves:

  • Perform equality test on the register as they are read for a possible branch.
  • Sign-extend the offset field of the instruction in case it is needed.
  • Compute the possible branch target address. 3. Execution / Effective address Cycle (EXE) The ALU operates on the operands prepared in the previous cycle and performs one of the following function defending on the instruction type.
  • Register- Register ALU instruction: ALU performs the operation specified in the instruction using the values read from the register file.
  • Register- Immediate ALU instruction: ALU performs the operation specified in the instruction using the first value read from the register file and that sign extended immediate.

4. Memory access (MEM) For a load instruction, using effective address the memory is read. For a store instruction memory writes the data from the 2nd^ register read using effective address. 5. Write back cycle (WB) Write the result in to the register file, whether it comes from memory system (for a LOAD instruction) or from the ALU.

Five stage Pipeline for a RISC processor

Each instruction taken at most 5 clock cycles for the execution

The pipeline can be thought of as a series of data paths shifted in time. This shows the overlap among the parts of the data path, with clock cycle 5 (CC 5) showing the steady-state situation. Because the register file is used as a source in the ID stage and as a destination in the WB stage, it appears twice. We show that it is read in one part of the stage and written in another by using a solid line, on the right or left, respectively, and a dashed line on the other side. The abbreviation IM is used for instruction memory, DM for data memory, and CC for clock cycle.

Basic Performance issues in Pipelining

Pipelining increases the CPU instruction throughput but, it does not reduce the execution time of an individual instruction. In fact, the pipelining increases the execution time of each instruction due to overhead in the control of the pipeline. Pipeline overhead arises from the combination of register delays and clock skew. Imbalance among the pipe stages reduces the performance since the clock can run no faster than the time needed for the slowest pipeline stage.

Pipeline Hazards Hazards may cause the pipeline to stall. When an instruction is stalled, all the instructions issued later than the stalled instructions are also stalled. Instructions issued earlier than the stalled instructions will continue in a normal way. No new instructions are fetched during the stall. Hazard is situation that prevents the next instruction in the instruction stream from executing during its designated clock cycle. Hazards will reduce the pipeline performance.

Performance with Pipeline stall

A stall causes the pipeline performance to degrade from ideal performance. Performance improvement from pipelining is obtained from:

Assume that, i) cycle time overhead of pipeline is ignored ii) stages are balanced With these assumptions

If all the instructions take the same number of cycles and is equal to the number of pipeline stages or depth of the pipeline, then,

If there are no pipeline stalls, Pipeline stall cycles per instruction = zero Therefore, Speedup = Depth of the pipeline.

Types of hazard Three types hazards are:

  1. Structural hazard

DADD R1,R2,R DSUB R4,R1,R AND R6,R1,R OR R8,R1,R XOR R10,R1,R

DADD instruction produces the value of R1 in WB stage (Clock cycle 5) but the DSUB instruction reads the value during its ID stage (clock cycle 3). This problem is called Data Hazard. DSUB may read the wrong value if precautions are not taken. AND instruction will read the register during clock cycle 4 and will receive the wrong results. The XOR instruction operates properly, because its register read occurs in clock cycle 6 after DADD writes in clock cycle 5. The OR instruction also operates without incurring a hazard because the register file reads are performed in the second half of the cycle whereas the writes are performed in the first half of the cycle.

What makes pipelining hard to implements?

Dealing with exceptions: Overlapping of instructions makes it more difficult to know whether an instruction can safely change the state of the CPU. In a pipelined CPU, an instruction execution extends over several clock cycles. When this instruction is in execution, the other instruction may raise exception that may force the CPU to abort the instruction in the pipeline before they complete.

Types of exceptions and requirements: The term exception is used to cover the terms interrupt, fault and exception. I/O device request, page fault, Invoking an OS service from a user program, Integer arithmetic overflow, memory protection overflow, Hardware malfunctions, Power failure etc. are the different classes of exception. Individual events have important characteristics that determine what action is needed corresponding to that exception.

i) Synchronous versus Asynchronous

If the event occurs at the same place every time the program is executed with the same data and memory allocation, the event is asynchronous. Asynchronous events are caused by devices external to the CPU and memory such events are handled after the completion of the current instruction.

ii) User requested versus coerced:

User requested exceptions are predictable and can always be handled after the current instruction has completed. Coerced exceptions are caused by some hardware event that is not under the control of the user program. Coerced exceptions are harder to implement because they are not predictable

iii) User maskable versus user non maskable :

If an event can be masked by a user task, it is user maskable. Otherwise it is user non maskable.

iv) Within versus between instructions:

Exception that occur within instruction are usually synchronous, since the instruction triggers the exception. It is harder to implement exceptions that occur within instructions than those between instructions, since the instruction must be stopped and restarted. Asynchronous exceptions that occurs within instructions arise from catastrophic situations and always causes program termination.

v) Resume versus terminate: If the program’s execution continues after the interrupt, it is a resuming event otherwise if is terminating event. It is easier implement exceptions that terminate execution.