ΗΜΥ 312 -- ΑΡΧΙΤΕΚΤΟΝΙΚΗ ΗΛΕΚΤΡΟΝΙΚΩΝ ΥΠΟΛΟΓΙΣΤΩΝ Χειµερινό Εξάµηνο 2014 ΔΙΑΛΕΞΗ 01: ΕΙΣΑΓΩΓΗ Διδάσκουσα: ΜΑΡΙΑ Κ. ΜΙΧΑΗΛ Επίκουρη Καθηγήτρια, ΗΜΜΥ (mmichael@ucy.ac.cy) [Προσαρµογή από Computer Architecture, Hennessy & Patterson, 2005, UCB] ΔΙΑΔΙΚΑΣΤΙΚΑ Διδάσκουσα: Μαρία Μιχαήλ Γραφείο: Green Park, #411 Τηλέφωνο: 22892277 Ώρες Γραφείου: µε ραντεβού email: mmichael@ucy.ac.cy Βοηθός: Σταύρος Χατζηθεοφάνους Γραφείο: Ερευνητικό Κέντρο ΚΙΟΣ, Λεωφόρος Κερύνειας email: hadjitheophanous.stavros@ucy.ac.cy ΗΜΥ312 Δ01 Εισαγωγή.2 2014
ΔΙΑΔΙΚΑΣΤΙΚΑ (συν.) Διαλέξεις: Δευτέρα και Πέµπτη, 15:00 16:30 Πανεπιστηµιούπολη, ΧΩΔ02, 012 Ιστοσελίδα: http://www.eng.ucy.ac.cy/mmichael/courses/ece312 Σύγγραµµα: Computer Architecture, A Quantitive Approach 4 th or 5 th Edition, Hennessy and Patterson Σηµειώσεις: pdf στην ιστοσελίδα πριν ή µετά τις διαλέξεις (συνήθως ΜΕΤΑ ) ΗΜΥ312 Δ01 Εισαγωγή.3 2014 ΒΑΘΜΟΛΟΓΙΑ q Κατ οίκον εργασίες και συµµετοχή στο µάθηµα 10% q 2 Ενδιάµεσες Εξετάσεις (20% καθεµιά) 40% 1 η Ενδιάµεση Σάββατο 18 Οκτωβρίου 2 η Ενδιάµεση 2 η ή 3 η βδοµάδα Νοεµβρίου q Τελική Εξέταση (εφ όλης της ύλης) 50% ΗΜΥ312 Δ01 Εισαγωγή.4 2014
Το Εργαστήριο q q Το εργαστηριακό µέρος διδάσκεται ως ξεχωριστό µάθηµα (ΗΜΥ 314, Τετάρτες 11:00-14:00 @ ΛΑ130) Τα 2 µαθήµατα (ΗΜΥ312 και ΗΜΥ 314) είναι συναπαιτούµενα! ΗΜΥ312 Δ01 Εισαγωγή.5 2014 ΣΤΟΧΟΙ ΜΑΘΗΜΑΤΟΣ q Εισαγωγή στην αρχιτεκτονική ηλεκτρονικών υπολογιστών. q Εις βάθος κατανόηση των διαφόρων συνιστωσών που απαρτίζουν τον ηλεκτρονικό υπολογιστή. q Ανάλυση απόδοσης και εκτίµηση διαφόρων αρχιτεκτονικών µεθόδων για επεξεργαστή, µνήµη, συστήµατα εισόδου/εξόδου δεδοµένων, ειδικών εφαρµογών, και παράλληλης επεξεργασίας δεδοµένων. ΗΜΥ312 Δ01 Εισαγωγή.6 2014
ΤΙ ΠΡΕΠΕΙ ΝΑ ΞΕΡΕΤΕ (ΗΜΥ 212 και ΗΜΥ 213 ) q Προαπαιτούµενα: ΗΜΥ 212 και ΗΜΥ 213 ΚΑΙ αποδεδειγµένη γνώση σε όλα από τα ακόλουθα: o Βασικός Προγραµµατισµός Υπολογιστών o Αριθµητικά Συστήµατα o Δυαδική Άλγεβρα o Συνδυαστικά και Ακολουθιακά Κυκλώµατα o Οργάνωση και βασικά στοιχεία ηλεκτρονικών υπολογιστών ΗΜΥ312 Δ01 Εισαγωγή.7 2014 ΕΝΟΤΗΤΕΣ ΜΑΘΗΜΑΤΟΣ q Διαλέξεις: o o o o o 1 βδοµάδα για επιρροή της Τεχνολογίας στην Αρχιτεκτονική. 4 βδοµάδες µνήµη και χειρισµός δεδοµένων, είσοδος/έξοδος. 4 βδοµάδες σχεδίαση επεξεργαστών ΙSA, µονάδα λογικής και αριθµητικής, διασωλήνωση, συχνότητα, 3 βδοµάδες εισαγωγή στα θέµατα παραλληλισµού εντολών, πολυεπεξεργαστών, και επεξεργαστών πολλαπλών νηµάτων και πολλαπλών πυρήνων. 1 βδοµάδα για επίκαιρα-καυτά θέµατα αρχιτεκτονικής. ΗΜΥ312 Δ01 Εισαγωγή.8 2014
ΠΩΣ ΟΡΓΑΝΩΝΕΤΑΙ Η ΑΡΧΙΤΕΚΤΟΝΙΚΗ Η/Υ Επίπεδα περιγραφής Η/Υ Application Compiler Operating System Firmware Memory system Instr. Set Proc. I/O system Instruction Set Architecture Datapath & Control Digital Design Circuit Design q Πολλαπλά επίπεδα περιγραφής/αφαιρετικότητας (levels of abstraction) q Συχνές αλλαγές q Σχεδίαση, Μέτρηση, και Ανάλυση / Εκτίµηση ΗΜΥ312 Δ01 Εισαγωγή.9 2014 Αρχιτεκτονική By the architecture of a system, I mean the complete and detailed specification of the user interface. As Blaauw has said, Where architecture tells what happens, implementation tells how it is made to happen. The Mythical Man-Month, Fred Brooks, pg 45 Αναφερόµενοι στην αρχιτεκτονική ενός συστήµατος, εννοούµε την πλήρη και λεπτοµερή περιγραφή των προδιαγραφών που θα βλέπει ο χρήστης Δηλαδή, η αρχιτεκτονική µας εξηγεί ΤΙ γίνεται, ενώ η υλοποίηση µας εξηγεί το ΠΩΣ γίνεται. ΗΜΥ312 Δ01 Εισαγωγή.10 2014
Instruction Set Architecture (ISA) Σετ Εντολών q ISA: An abstract interface between the hardware and the lowest level software of a machine that encompasses all the information necessary to write a machine language program that will run correctly, including instructions, registers, memory access, I/O, and so on.... the attributes 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 Enables implementations of varying cost and performance to run identical software q ABI (application binary interface): The user portion of the instruction set plus the operating system interfaces used by application programmers. Defines a standard for binary portability across computers. ΗΜΥ312 Δ01 Εισαγωγή.11 2014 ISA Type Sales Περιγράφει τους Επεξεργαστές Millions of Processor 1400 1200 1000 800 600 400 200 Other SPARC Hitachi SH PowerPC Motorola 68K MIPS IA-32 ARM 0 1998 1999 2000 2001 2002 PowerPoint comic bar chart µε προσεγγιστικά αποτελέσµατα. ΗΜΥ312 Δ01 Εισαγωγή.12 2014
What is Computer Architecture? Application Physics Gap too large to bridge in one step (but there are exceptions, e.g. magnetic compass) In its broadest definition, computer architecture is the design of the abstraction layers that allow us to implement information processing applications efficiently using available manufacturing technologies. ΗΜΥ312 Δ01 Εισαγωγή.13 2014 Abstraction Layers in Modern Systems Original domain of the computer architect ( 50s- 80s) Application Algorithm Programming Language Operating System/Virtual Machines Instruction Set Architecture (ISA) Microarchitecture Gates/Register-Transfer Level (RTL) Circuits Devices Physics Domain of recent computer architecture ( 90s) ΗΜΥ312 Δ01 Εισαγωγή.14 2014
Computing Devices Then EDSAC, University of Cambridge, UK, 1949 ΗΜΥ312 Δ01 Εισαγωγή.15 2014 Computing Devices Now Sensor Nets Smart phones Media Players Set-top boxes Servers Laptops Games Routers Robots Cameras Automobiles Supercomputers ΗΜΥ312 Δ01 Εισαγωγή.16 2014
Ο Νόµος του Moore q Το 1965, ο Gordon Moore προέβλεψε ότι ο αριθµός των transistor που θα µπορούν να προσαρµοστούν σε ένα die θα διπλασιαζόταν κάθε 18 µε 24 µήνες (δηλ., µεγαλώνει εκθετικά). q Ήταν σωστός!!! το εµπόδιο του ενος εκατοµµυρίου transistor/chip ξεπεράστηκε το1980. 2300 transistors, 1 MHz clock (Intel 4004) - 1971 16 Million transistors (Ultra Sparc III) 42 Million transistors, 2 GHz clock (Intel Xeon) 2001 55 Million transistors, 3 GHz, 130nm technology, 250mm 2 die (Intel Pentium 4) - 2004 140 Million transistor (HP PA-8500) ΗΜΥ312 Δ01 Εισαγωγή.17 2014 ΒΕΛΤΙΩΣΗ ΣΤΗΝ ΑΠΟΔΟΣΗ Performance (SPEC Int) 10000 1000 100 10 IBM RS6000 MIPS M2000 SUN-4/260 MIPS M/120 1 Intel Pentium 4/3000 DEC Alpha 21264A/667 DEC Alpha 21264/600 Intel Xeon/2000 DEC Alpha 4/266 DEC AXP/500 IBM POWER 100 HP 9000/750 DEC Alpha 5/500 DEC Alpha 5/300 Ρυθµός αύξησης απόδοσης ~ 1.5-1.6 ανά έτος 1987 1989 1991 1993 1995 1997 1999 2001 2003 Year ΗΜΥ312 Δ01 Εισαγωγή.18 2014
ΜΕΓΕΘΟΣ ΜΝΗΜΗΣ DRAM Kbit capacity 1000000 100000 10000 1000 100 10 16K 64K 256K 1M 4M 16M 1976 1978 1980 1982 1984 1986 1988 1990 1992 1994 1996 1998 2000 2002 Year of introduction 512M 64M 128M 256M Ρυθµός αύξησης χωριτικότητας ~ 4Χ ανά 3 έτη µέχρι 1996 ~ 2Χ ανά 2 έτη µετά 1996 ΗΜΥ312 Δ01 Εισαγωγή.19 2014 ΑΠΟΤΕΛΕΣΜΑΤΑ ΒΕΛΤΙΩΣΗΣ ΤΕΧΝΟΛΟΓΙΑΣ q Processor logic capacity: increases about 30% per year performance: 2x every 1.5 years ClockCycle = 1/ClockRate 500 MHz ClockRate = 2 nsec ClockCycle 1 GHz ClockRate = 1 nsec ClockCycle 4 GHz ClockRate = 250 psec ClockCycle q Memory DRAM capacity: 4x every 3 years, now 2x every 2 years memory speed: 1.5x every 10 years cost per bit: decreases about 25% per year q Disk capacity: increases about 60% per year ΗΜΥ312 Δ01 Εισαγωγή.20 2014
Uniprocessor Performance Performance (vs. VAX-11/780) 10000 1000 100 10 From Hennessy and Patterson, Computer Architecture: A Quantitative Approach, 4th edition, October, 2006 25%/year 52%/year??%/year What happened???? 1 1978 1980 1982 1984 1986 1988 1990 1992 1994 1996 1998 2000 2002 2004 2006 VAX : 25%/year 1978 to 1986 RISC + x86: 52%/year 1986 to 2002 RISC + x86:??%/year 2002 to present ΗΜΥ312 Δ01 Εισαγωγή.21 2014 The End of the Uniprocessor Era Single biggest change in the history of computing systems ΗΜΥ312 Δ01 Εισαγωγή.22 2014
Conventional Wisdom in Computer Architecture q Old Conventional Wisdom: Power is free, Transistors expensive q New Conventional Wisdom: Power wall Power expensive, Transistors free (Can put more on chip than can afford to turn on) q Old CW: Sufficient increasing Instruction-Level Parallelism via compilers, innovation (pipelining, superscalar, out-of-order, speculation, VLIW, ) q New CW: ILP wall law of diminishing returns on more HW for ILP q Old CW: Multiplies are slow, Memory access is fast q New CW: Memory wall Memory slow, multiplies fast (200 clock cycles to DRAM memory, 4 clocks for multiply) q Old CW: Uniprocessor performance 2X / 1.5 yrs q 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 ΗΜΥ312 Δ01 Εισαγωγή.23 2014 Sea Change in Chip Design q Intel 4004 (1971): 4-bit processor, 2312 transistors, 0.4 MHz, 10 micron PMOS, 11 mm 2 chip q RISC II (1983): 32-bit, 5 stage pipeline, 40,760 transistors, 3 MHz, 3 micron NMOS, 60 mm 2 chip q 125 mm 2 chip, 0.065 micron CMOS = 2312 RISC II+FPU+Icache+Dcache o RISC II shrinks to ~ 0.02 mm 2 at 65 nm o Caches via DRAM or 1 transistor SRAM? Is Processor the new transistor? ΗΜΥ312 Δ01 Εισαγωγή.24 2014
Déjà vu all over again? q Multiprocessors imminent in 1970s, 80s, 90s, q today s processors are nearing an impasse as technologies approach the speed of light.. David Mitchell, The Transputer: The Time Is Now (1989) q Transputer was premature Custom multiprocessors tried to beat uniprocessors Procrastination rewarded: 2X seq. perf. / 1.5 years q We are dedicating all of our future product development to multicore designs. This is a sea change in computing Paul Otellini, President, Intel (2004) q Difference is all microprocessor companies have switched to multiprocessors (AMD, Intel, IBM, Sun; all new Apples 2+ CPUs) Procrastination penalized: 2X sequential perf. / 5 yrs Biggest programming challenge: from 1 to 2 CPUs ΗΜΥ312 Δ01 Εισαγωγή.25 2014 Problems with Sea Change q Algorithms, Programming Languages, Compilers, Operating Systems, Architectures, Libraries, not ready to supply Thread-Level Parallelism or Data-Level Parallelism for 1000 CPUs / chip q Architectures not ready for 1000 CPUs / chip Unlike Instruction-Level Parallelism, cannot be solved by computer architects and compiler writers alone, but also cannot be solved without participation of architects q Need a reworking of all the abstraction layers in the computing system stack ΗΜΥ312 Δ01 Εισαγωγή.26 2014
Abstraction Layers in Modern Systems Original domain of the computer architect ( 50s- 80s) Application Algorithm Programming Language Operating System/Virtual Machines Instruction Set Architecture (ISA) Microarchitecture Gates/Register-Transfer Level (RTL) Circuits Devices Physics Parallel computing, security, Domain of recent computer architecture ( 90s) Reliability, power, Reinvigoration of computer architecture, mid-2000s onward. ΗΜΥ312 Δ01 Εισαγωγή.27 2014 Sea of Change is also Application Driven Τι είναι σήµερα ο Ὑπολογιστής; ΗΜΥ312 Δ01 Εισαγωγή.28 2014
ΚΑΤΑΝΟΜΗ ΑΓΟΡΑΣ Millions of Computers 1200 1000 800 600 400 200 0 290 93 3 488 114 3 892 135 4 862 129 4 1122 131 5 1998 1999 2000 2001 2002 Embedded Desktop Servers ΗΜΥ312 Δ01 Εισαγωγή.29 2014 ΠΑΡΑΔΕΙΓΜΑ ΟΡΓΑΝΩΣΗΣ ΣΥΣΤΗΜΑΤΟΣ q Σχεδιαστικοί στόχοι 25% κόστος επεξεργαστή 25% κόστος µνήµης Υπόλοιπο σε I/O συστήµατα, τροφοδοσία ενέργειας (και cooling), κάσα. Computer CPU Memory Devices Control Input Datapath Output ΗΜΥ312 Δ01 Εισαγωγή.30 2014
ΠΑΡΑΔΕΙΓΜΑ ΟΡΓΑΝΩΣΗΣ q TI SuperSPARC tm TMS390Z50 in Sun SPARCstation20 SuperSPARC MBus Module Floating-point Unit Integer Unit L2 $ CC MBus DRAM Controller Inst Cache Ref MMU Bus Interface Data Cache Store Buffer L64852 SBus SBus DMA SBus Cards MBus control M-S Adapter SCSI Ethernet STDIO serial kbd mouse audio RTC Boot PROM Floppy ΗΜΥ312 Δ01 Εισαγωγή.31 2014 MIPS R3000 Instruction Set Architecture q Instruction Categories Load/Store Computational Jump and Branch Floating Point - coprocessor Memory Management Special Registers R0 - R31 PC HI LO 3 Instruction Formats: all 32 bits wide OP rs rt rd sa funct OP OP rs rt immediate jump target Q: Πόσοι γνωρίζετε το MIPS ISA? ΗΜΥ312 Δ01 Εισαγωγή.32 2014
ΕΝΑ ΣΗΜΑΝΤΙΚΟ ΘΕΜΑ q Program Counter PC (Μετρητής Προγράµµατος) Ένα register το οποίο κρατάει την διεύθυνση της επόµενης εντολής που θα εκτελεστεί. q Instruction Register (IR) Το register που κρατάει την ίδια την εντολή. ΗΜΥ312 Δ01 Εισαγωγή.33 2014 q (vonneumann) Οργάνωση Επεξεργαστή Control (Μονάδα Ελέγχου) χρειάζεται o o o Να λάβει εντολές από την Μνήµη Να εκδώσει τα σήµατα που χρειάζονται για µεταφορά δεδοµένων µεταξύ συστηµάτων του επεξεργαστή και οδηγιών ελέγχου Να διατηρεί την σωστή σειρά οδηγιών ελέγχου. CPU Control Datapath Exec q Datapath (Πλοήγηση Δεδοµένων) χρειάζεται Memory Fetch Decode Devices Input Output o Τα συστήµατα τα εκτελεστικά και αριθµητικά συστήµατα καθώς και την απαιτούµενη µνήµη για να εκτελεί εντολές o Το σύστηµα επικοινωνίας ώστε τα δεδοµένα να µπορούν να ταξιδεύουν µεταξύ εκτελεστικών συστηµάτων και µνήµης ΗΜΥ312 Δ01 Εισαγωγή.34 2014
RISC - Reduced Instruction Set Computer q RISC φιλοσοφία fixed instruction lengths load-store instruction sets limited addressing modes limited operations q MIPS, Sun SPARC, HP PA-RISC, IBM PowerPC, Intel (Compaq) Alpha, q Το Instruction Set µετριέται µε το πόσο καλά οι µεταγλωττιστές (Compilers) χρησιµοποιούν τις εντολές, παρά κατά πόσο οι προγραµµατιστές γλώσσας assembly τις χρησιµοποιούν. Design goals: speed, cost (design, fabrication, test, packaging), size, power consumption, reliability, memory space (embedded systems) ΗΜΥ312 Δ01 Εισαγωγή.35 2014 CISC - Complex Instruction Set Computer q Complex Instruction Set Αυξηµένες ικανότητες κάθε οδηγίας εξυπακούουν πιο πολύπλοκο σύστηµα διευθύνσεων Motorola 68000 ----> 14 addressing modes Motorola 68020 ----> 25 addressing modes Οι Εντολές έχουν διαφορετικό µήκος Ο χρόνος εκτελέσεως τους είναι διαφορετικός q Τεχνικές Βελτίωσης Απόδοσης Prefetching Pipelining q Super-scalar operation ΗΜΥ312 Δ01 Εισαγωγή.36 2014
ΕΠΟΜΕΝΗ ΔΙΑΛΕΞΗ ΚΑΙ ΚΑΤ ΟΙΚΟΝ ΜΕΛΕΤΗ q ΕΠΟΜΕΝΗ ΔΙΑΛΕΞΗ ΙΣΤΟΡΙΚΗ ΑΝΑΔΡΟΜΗ! q ΚΑΤ ΟΙΚΟΝ ΜΕΛΕΤΗ o Εισαγωγή - Επανάληψη (οργάνωσης Η/Υ) o Κεφάλαιο 1 o Ιστορική Αναδροµή o Παράρτηµα Κ (στο CD) q ΠΑΡΑΡΤΗΜΑΤΑ Α, Β, & C (στο βιβλίο) o Επανάληψη οργάνωσης και βασικών αρχών αρχιτεκτονικής Η/Υ (ΗΜΥ212) o Pipelining (Α) o ISA Design (Β) o Memory Hierarchy (C) ΗΜΥ312 Δ01 Εισαγωγή.37 2014