basics of computer architecture and introduction.ppt
1.
CS 5513: ComputerArchitecture
Lecture 1: Introduction
Daniel A. JimĂŠnez
The University of Texas at San Antonio
http://www.cs.utsa.edu/~dj
http://www.cs.utsa.edu/~dj/cs5513
2.
Outline
⢠Computer Scienceat a Crossroads
⢠Computer Architecture v. Instruction Set Arch.
⢠What Computer Architecture brings to table
3.
⢠Old ConventionalWisdom: Power is free, Transistors expensive
⢠New Conventional Wisdom: âPower wallâ Power expensive, Xtors free
(Can put more on chip than can afford to turn on)
⢠Old CW: Sufficiently increasing Instruction Level Parallelism via
compilers, innovation (Out-of-order, speculation, VLIW, âŚ)
⢠New CW: âILP wallâ law of diminishing returns on more HW for ILP
⢠Old CW: Multiplies are slow, Memory access is fast
⢠New CW: âMemory wallâ Memory slow, multiplies fast
(200 clock cycles to DRAM memory, 4 clocks for multiply)
⢠Old CW: Uniprocessor performance 2X / 1.5 yrs
⢠New CW: Power Wall + ILP Wall + Memory Wall = Brick Wall
â Uniprocessor performance now 2X / 5(?) yrs
ď Sea change in chip design: multiple âcoresâ
(2X processors per chip / ~ 2 years)
Âť More simpler processors are more power efficient
Crossroads: Conventional Wisdom in Comp. Arch
Sea Change inChip Design
⢠Intel 4004 (1971): 4-bit processor,
2312 transistors, 0.4 MHz,
10 micron PMOS, 11 mm2
chip
⢠Processor is the new transistor?
⢠RISC II (1983): 32-bit, 5 stage
pipeline, 40,760 transistors, 3 MHz,
3 micron NMOS, 60 mm2
chip
⢠125 mm2
chip, 0.065 micron CMOS
= 2312 RISC II+FPU+Icache+Dcache
â RISC II shrinks to ~ 0.02 mm2
at 65 nm
â Caches via DRAM or 1 transistor SRAM?
6.
Problems with SeaChange
⢠Algorithms, Programming Languages, Compilers,
Operating Systems, Architectures, Libraries, ⌠not
ready to supply Thread Level Parallelism or Data
Level Parallelism for 1000 CPUs / chip,
⢠Architectures not ready for 1000 CPUs / chip
⢠Unlike Instruction Level Parallelism, cannot be solved by just by
computer architects and compiler writers alone, but also cannot
be solved without participation of computer architects
7.
Instruction Set Architecture:Critical
Interface
instruction set
software
hardware
⢠Properties of a good abstraction
â Lasts through many generations (portability)
â Used in many different ways (generality)
â Provides convenient functionality to higher levels
â Permits an efficient implementation at lower levels
8.
Example:
MIPS
0
r0
r1
°
°
°
r31
PC
lo
hi
Programmable storage
2^32 xbytes
31 x 32-bit GPRs (R0=0)
32 x 32-bit FP regs (paired DP)
HI, LO, PC
Data types ?
Format ?
Addressing Modes?
Arithmetic logical
Add, AddU, Sub, SubU, And, Or, Xor, Nor, SLT, SLTU,
AddI, AddIU, SLTI, SLTIU, AndI, OrI, XorI, LUI
SLL, SRL, SRA, SLLV, SRLV, SRAV
Memory Access
LB, LBU, LH, LHU, LW, LWL,LWR
SB, SH, SW, SWL, SWR
Control
J, JAL, JR, JALR
BEq, BNE, BLEZ,BGTZ,BLTZ,BGEZ,BLTZAL,BGEZAL
32-bit instructions on word boundary
9.
Instruction Set
Architecture
â... theattributes of a [computing] system as seen by
the programmer, i.e. the conceptual structure and
functional behavior, as distinct from the organization
of the data flows and controls the logic design, and
the physical implementation.â
â Amdahl, Blaauw, and Brooks, 1964
SOFTWARE
SOFTWARE
-- Organization of Programmable
Storage
-- Data Types & Data Structures:
Encodings & Representations
-- Instruction Formats
-- Instruction (or Operation Code) Set
-- Modes of Addressing and Accessing Data Items and Instructions
-- Exceptional Conditions
10.
ISA vs. ComputerArchitecture
⢠Old definition of computer architecture
= instruction set design
â Other aspects of computer design called implementation
â Insinuates implementation is uninteresting or less challenging
⢠Our view is computer architecture >> ISA
⢠Architectâs job much more than instruction set
design; technical hurdles today more challenging
than those in instruction set design
⢠Since instruction set design not where action is,
some conclude computer architecture (using old
definition) is not where action is
â We disagree on conclusion
â Agree that ISA not where action is
11.
Comp. Arch. isan Integrated Approach
⢠What really matters is the functioning of the complete
system
â hardware, runtime system, compiler, operating system, and
application
⢠Computer architecture is not just about transistors,
individual instructions, or particular implementations
â E.g., Original RISC projects replaced complex instructions with a
compiler + simple instructions
12.
Computer Architecture is
Designand Analysis
Design
Analysis
Architecture is an iterative process:
⢠Searching the space of possible designs
⢠At all levels of computer systems
Creativity
Good Ideas
Good Ideas
Mediocre Ideas
Bad Ideas
Cost /
Performance
Analysis
13.
CS 5513 Administrivia
Instructor:Prof. Daniel A. JimĂŠnez
Office: SB 4.01.58
Office Hours: By appointment
T. A: Xinran Yu
Office: Office Hours in Main Lab
Office Hours: Monday, 3:00pm to 4:30pm
Class: Tuesday/Thursday 5:30pm to 6:45pm, HSS 3.04.28
Text: Hennessy and Patterson, Computer Architecture: A
Quantitative Approach, 4th Edition
Web page: http://www.cs.utsa.edu/~dj/cs5513
See web page for reading and homework assignments
14.
CS 5513 CourseFocus
Understanding the design techniques, machine structures,
technology factors, evaluation methods that will
determine the form of computers in 21st Century
Technology Programming
Languages
Operating
Systems History
Applications Interface Design
(ISA)
Measurement &
Evaluation
Parallelism
Computer Architecture:
⢠Organization
⢠Hardware/Software Boundary
Compilers
15.
Research Paper Reading
â˘As graduate students, you are now researchers
⢠Most information of importance to you will be in
research papers
⢠Ability to rapidly scan and understand research papers
is key to your success
⢠So: you will read a few papers in this course
â The structure of this reading is to be decided
⢠Papers will be on web page
16.
Related Courses
Prerequisites forCS 5513
CS 3733 â Operating Systems (requires CS 3843)
CS 4753/CS 3853 â Computer Architecture
both of these prerequire:
CS 3843 â Computer Organization
CS 3823 â Programming Languages
knowledge of C/C++/Java and assembly language
Classes with CS 5513 as a prerequisite
CS 6513 â Advanced Architecture
CS 6553 â Performance Evaluation
CS 6643 â Parallel Processing
CS 6653 â Parallel Algorithms
17.
Coping with CS5513
⢠Students without proper prerequisites will have a
difficult time in this class. It is often difficult for
the graduate studies committee to determine
whether a class from another university is
equivalent to one of our prerequisites.
⢠We will have an âentrance quizâ to help you
determine whether you would like to enroll in a
different class.
⢠Will spend a few lectures reviewing material that is
also covered in an undergrad computer
architecture class.
18.
Grading
⢠15% Homeworks
â˘25% Midterm Exam(s)
⢠25% Second Exam
⢠25% Project
â Transition from undergrad to grad student
â We want you to succeed, but you need to show initiative
â pick topic (more on this later)
â meet with faculty to gauge progress
â written report like conference paper
â work in groups
â Opportunity to do âresearch in the smallâ to help make transition
from good student to research colleague
⢠10% Class Participation
â Contribute to the class discussion
19.
Outline
⢠Computer Scienceat a Crossroads
⢠Computer Architecture v. Instruction Set Arch.
⢠What Computer Architecture brings to table
20.
What Computer Architecturebrings to Table
⢠Other fields often borrow ideas from architecture
⢠Quantitative Principles of Design
1. Take Advantage of Parallelism
2. Principle of Locality
3. Focus on the Common Case
4. Amdahlâs Law
5. The Processor Performance Equation
⢠Careful, quantitative comparisons
â Define, quantity, and summarize relative performance
â Define and quantity relative cost
â Define and quantity dependability
â Define and quantity power
⢠Culture of anticipating and exploiting advances in
technology
⢠Culture of well-defined interfaces that are carefully
implemented and thoroughly checked
21.
1) Taking Advantageof Parallelism
⢠Increasing throughput of server computer via
multiple processors or multiple disks
⢠Detailed HW design
â Carry lookahead adders uses parallelism to speed up computing
sums from linear to logarithmic in number of bits per operand
â Multiple memory banks searched in parallel in set-associative
caches
⢠Pipelining: overlap instruction execution to reduce
the total time to complete an instruction sequence.
â Not every instruction depends on immediate predecessor ď
executing instructions completely/partially in parallel possible
â Classic 5-stage pipeline:
1) Instruction Fetch (Ifetch),
2) Register Read (Reg),
3) Execute (ALU),
4) Data Memory Access (Dmem),
5) Register Write (Reg)
Limits to pipelining
â˘Hazards prevent next instruction from executing
during its designated clock cycle
â Structural hazards: attempt to use the same hardware to do
two different things at once
â Data hazards: Instruction depends on result of prior
instruction still in the pipeline
â Control hazards: Caused by delay between the fetching of
instructions and decisions about changes in control flow
(branches and jumps).
I
n
s
t
r.
O
r
d
e
r
Time (clock cycles)
Reg
ALU
DMem
Ifetch Reg
Reg
ALU
DMem
Ifetch Reg
Reg
ALU
DMem
Ifetch Reg
Reg
ALU
DMem
Ifetch Reg
24.
2) The Principleof Locality
⢠The Principle of Locality:
â Program access a relatively small portion of the address space at any instant of time.
⢠Two Different Types of Locality:
â Temporal Locality (Locality in Time): If an item is referenced, it will tend to be
referenced again soon (e.g., loops, reuse)
â Spatial Locality (Locality in Space): If an item is referenced, items whose addresses
are close by tend to be referenced soon
(e.g., straight-line code, array access)
⢠Last 30 years, HW relied on locality for memory perf.
P MEM
$
25.
Levels of theMemory Hierarchy
CPU Registers
100s Bytes
300 â 500 ps (0.3-0.5 ns)
L1 and L2 Cache
10s-100s K Bytes
~1 ns - ~10 ns
$1000s/ GByte
Main Memory
G Bytes
80ns- 200ns
~ $100/ GByte
Disk
10s T Bytes, 10 ms
(10,000,000 ns)
~ $1 / GByte
Capacity
Access Time
Cost
Tape
infinite
sec-min
~$1 / GByte
Registers
L1 Cache
Memory
Disk
Tape
Instr. Operands
Blocks
Pages
Files
Staging
Xfer Unit
prog./compiler
1-8 bytes
cache cntl
32-64 bytes
OS
4K-8K bytes
user/operator
Mbytes
Upper Level
Lower Level
faster
Larger
L2 Cache
cache cntl
64-128 bytes
Blocks
26.
3) Focus onthe Common Case
⢠Common sense guides computer design
â Since its engineering, common sense is valuable
⢠In making a design trade-off, favor the frequent
case over the infrequent case
â E.g., Instruction fetch and decode unit used more frequently
than multiplier, so optimize it 1st
â E.g., If database server has 50 disks / processor, storage
dependability dominates system dependability, so optimize it 1st
⢠Frequent case is often simpler and can be done
faster than the infrequent case
â E.g., overflow is rare when adding 2 numbers, so improve
performance by optimizing more common case of no overflow
â May slow down overflow, but overall performance improved by
optimizing for the normal case
⢠What is frequent case and how much performance
improved by making case faster => Amdahlâs Law
27.
4) Amdahlâs Law
ď¨ďŠ
enhanced
enhanced
enhanced
new
old
overall
Speedup
Fraction
Fraction
1
ExTime
ExTime
Speedup
ďŤ
ď
ď˝
ď˝
1
Best you could ever hope to do:
ď¨ ďŠ
enhanced
maximum
Fraction
-
1
1
Speedup ď˝
ď¨ ďŠ ďş
ďť
ďš
ďŞ
ďŤ
ďŠ
ďŤ
ď
ď´
ď˝
enhanced
enhanced
enhanced
old
new
Speedup
Fraction
Fraction
ExTime
ExTime 1
28.
Amdahlâs Law example
â˘New CPU 10X faster
⢠I/O bound server, so 60% time waiting for I/O
ď¨ ďŠ
ď¨ ďŠ
56
.
1
64
.
0
1
10
0.4
0.4
1
1
Speedup
Fraction
Fraction
1
1
Speedup
enhanced
enhanced
enhanced
overall
ď˝
ď˝
ďŤ
ď
ď˝
ďŤ
ď
ď˝
⢠Apparently, its human nature to be attracted by 10X
faster, vs. keeping in perspective its just 1.6X faster
29.
5) Processor performanceequation
CPU time = Seconds = Instructions x Cycles x
Seconds
Program Program Instruction Cycle
Inst Count CPI Clock Rate
Program X
Compiler X (X)
Inst. Set. X X
Organization X X
Technology X
inst count
CPI
Cycle time
30.
Whatâs a ClockCycle?
⢠Old days: 10 levels of gates
⢠Today: determined by numerous time-of-flight
issues + gate delays
â clock propagation, wire lengths, drivers
Latch
or
register
combinational
logic
31.
And in conclusionâŚ
⢠Computer Architecture >> instruction sets
⢠Computer Architecture skill sets are different
â 5 Quantitative principles of design
â Quantitative approach to design
â Solid interfaces that really work
â Technology tracking and anticipation
⢠CS 5513 to learn new skills, transition to research
⢠Computer Science at the crossroads from
sequential to parallel computing
â Salvation requires innovation in many fields, including
computer architecture
⢠Read Chapter 1, then Appendices A & B.
Editor's Notes
#13Â This slide is for the 3-min class administrative matters.
Make sure we update Handout #1 so it is consistent with this slide.
#24Â The principle of locality states that programs access a relatively small portion of the address space at any instant of time.
This is kind of like in real life, we all have a lot of friends. But at any given time most of us can only keep in touch with a small group of them.
There are two different types of locality: Temporal and Spatial. Temporal locality is the locality in time which says if an item is referenced, it will tend to be referenced again soon.
This is like saying if you just talk to one of your friends, it is likely that you will talk to him or her again soon.
This makes sense. For example, if you just have lunch with a friend, you may say, letâs go to the ball game this Sunday. So you will talk to him again soon.
Spatial locality is the locality in space. It says if an item is referenced, items whose addresses are close by tend to be referenced soon.
Once again, using our analogy. We can usually divide our friends into groups. Like friends from high school, friends from work, friends from home.
Letâs say you just talk to one of your friends from high school and she may say something like: âSo did you hear so and so just won the lottery.â
You probably will say NO, I better give him a call and find out more.
So this is an example of spatial locality. You just talked to a friend from your high school days. As a result, you end up talking to another high school friend. Or at least in this case, you hope he still remember you are his friend.
+3 = 10 min. (X:50)