DOC PREVIEW
Berkeley COMPSCI 61C - Lecture Notes

This preview shows page 1-2-3-4-25-26-27-52-53-54-55 out of 55 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 55 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1New-School Machine Structures (It’s a bit more complicated!)Levels of Representation/InterpretationReviewAgendaWhat’s a Compiler?Compiled Languages: Edit-Compile-Link-RunCompiler OptimizationWhat is Typical Benefit of Compiler Optimization?Unoptimized MIPS Code-O2 optimized MIPS CodeWhat’s an Interpreter?Interpreted Languages: Edit-RunCompiler vs. Interpreter AdvantagesCompiler vs. Interpreter DisadvantagesJava’s Hybrid Approach: Compiler + InterpreterJava’s Compiler + InterpreterWhy Bytecodes?JVM uses Stack vs. RegistersJava Bytecodes (Stack) vs. MIPS (Reg.)Starting Java ApplicationsAgendaAdministriviaProjectsEC2 instances over 2 weeksEC2 usage: $/student Avg $40, 25th $30, 75th $55Computers In The NewsDynamic LinkingDynamic Linking IdeaDynamic LinkageDynamic LinkageSlide 33Technology Cost over Time Successive GenerationsMoore’s LawMoore’s LawMemory Chip SizeEnd of Moore’s Law?Technology Trends: Uniprocessor Performance (SPECint)Limits to Performance: Faster Means More PowerP = C V2 fDoing Nothing Well—NOT!Computer Technology: Growing, But More SlowlyFive Components of a ComputerReality Check: Typical MIPS Chip Die PhotographThe ProcessorStages of the Datapath : OverviewInstruction Level ParallelismProject 2 WarningPhases of the Datapath (1/5)Phases of the Datapath (2/5)Simulator for Decode PhasePhases of the Datapath (3/5)Phases of the Datapath (4/5)Phases of the Datapath (5/5)SummaryCS 61C: Great Ideas in Computer Architecture (Machine Structures)Instructors:Randy H. KatzDavid A. Pattersonhttp://inst.eecs.Berkeley.edu/~cs61c/fa101Spring 2010 -- Lecture #901/14/2019New-School Machine Structures(It’s a bit more complicated!)•Parallel RequestsAssigned to computere.g., Search “Katz”•Parallel ThreadsAssigned to coree.g., Lookup, Ads•Parallel Instructions>1 instruction @ one timee.g., 5 pipelined instructions•Parallel Data>1 data item @ one timee.g., Add of 4 pairs of words•Hardware descriptionsAll gates @ one time01/14/2019 Spring 2010 -- Lecture #9 3SmartPhoneWarehouse Scale ComputerSoftware HardwareHarnessParallelism &Achieve HighPerformanceLogic Gates CoreCoreCoreCore… Memory (Cache) Memory (Cache)Input/OutputInput/OutputComputerMain MemoryMain MemoryCore Instruction Unit(s) Instruction Unit(s) FunctionalUnit(s) FunctionalUnit(s)A3+B3A2+B2A1+B1A0+B0Today’s LectureLevels of Representation/Interpretationlw $t0, 0($2)lw $t1, 4($2)sw $t1, 0($2)sw $t0, 4($2)High Level LanguageProgram (e.g., C)Assembly Language Program (e.g., MIPS)Machine Language Program (MIPS)Hardware Architecture Description(e.g., block diagrams) CompilerAssemblerMachine Interpretationtemp = v[k];v[k] = v[k+1];v[k+1] = temp;0000 1001 1100 0110 1010 1111 0101 10001010 1111 0101 1000 0000 1001 1100 0110 1100 0110 1010 1111 0101 1000 0000 1001 0101 1000 0000 1001 1100 0110 1010 1111 Logic Circuit Description(Circuit Schematic Diagrams)Architecture ImplementationAnything can be representedas a number, i.e., data or instructions01/14/2019 4Spring 2010 -- Lecture #9Today’s LectureReview•Everything is a (binary) number in a computer–Instructions and data; stored program concept•Assemblers can enhance machine instruction set to help assembly-language programmer•Translate from text that easy for programmers to understand into code that machine executes efficiently: Compilers, Assemblers•Linkers allow separate translation of modules01/14/2019 Spring 2010 -- Lecture #9 5Agenda•Compilers, Optimization, Interpreters, Just-In-Time Compiler•Administrivia•Dynamic Linking•Technology Trends Revisited•Technology Break•Components of a Computer01/14/2019 Spring 2010 -- Lecture #9 67What’s a Compiler?•Compiler: a program that accepts as input a program text in a certain language and produces as output a program text in another language, while preserving the meaning of that text.•The text must comply with the syntax rules of whichever programming language it is written in. •A compiler's complexity depends on the syntax of the language and how much abstraction that programming language provides. –A C compiler is much simpler than C++ Compiler•Compiler executes before compiled program runs01/14/2019 Spring 2010 -- Lecture #92-8Compiled Languages:Edit-Compile-Link-RunEditor SourcecodeCompiler ObjectcodeLinker ExecutableprogramEditor SourcecodeCompiler ObjectcodeEditor SourcecodeCompiler Objectcode01/14/2019 Spring 2010 -- Lecture #9Compiler Optimization•gcc compiler options-O1: the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time-O2: Optimize even more. GCC performs nearly all supported optimizations that do not involve a space-speed tradeoff. As compared to -O, this option increases both compilation time and the performance of the generated code-O3: Optimize yet more. All -O2 optimizations and also turns on the -finline-functions, …01/14/2019 Spring 2010 -- Lecture #9 9What is Typical Benefit of Compiler Optimization?•What is a typical program?•For now, try a toy program: BubbleSort.c#define ARRAY_SIZE 20000int main() { int iarray[ARRAY_SIZE], x, y, holder;for(x = 0; x < ARRAY_SIZE; x++) for(y = 0; y < ARRAY_SIZE-1; y++) if(iarray[y] > iarray[y+1]) { holder = iarray[y+1]; iarray[y+1] = iarray[y]; iarray[y] = holder; }}01/14/2019 Spring 2010 -- Lecture #9 10Unoptimized MIPS Code$L3: lw $2,80016($sp) slt $3,$2,20000 bne $3,$0,$L6 j $L4$L6: .set noreorder nop .set reorder sw $0,80020($sp)$L7: lw $2,80020($sp) slt $3,$2,19999 bne $3,$0,$L10 j $L5$L10: lw $2,80020($sp) move $3,$2 sll $2,$3,2 addu $3,$sp,1601/14/2019 Spring 2010 -- Lecture #9 11 addu $2,$3,$2 lw $4,80020($sp) addu $3,$4,1 move $4,$3 sll $3,$4,2 addu $4,$sp,16 addu $3,$4,$3 lw $2,0($2) lw $3,0($3) slt $2,$3,$2 beq $2,$0,$L9 lw $3,80020($sp) addu $2,$3,1 move $3,$2 sll $2,$3,2 addu $3,$sp,16 addu $2,$3,$2 lw $3,0($2) sw $3,80024($sp lw $3,80020($sp) addu $2,$3,1 move $3,$2 sll $2,$3,2 addu $3,$sp,16 addu $2,$3,$2 lw $3,80020($sp) move $4,$3 sll $3,$4,2 addu $4,$sp,16


View Full Document

Berkeley COMPSCI 61C - Lecture Notes

Documents in this Course
SIMD II

SIMD II

8 pages

Midterm

Midterm

7 pages

Lecture 7

Lecture 7

31 pages

Caches

Caches

7 pages

Lecture 9

Lecture 9

24 pages

Lecture 1

Lecture 1

28 pages

Lecture 2

Lecture 2

25 pages

VM II

VM II

4 pages

Midterm

Midterm

10 pages

Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?