lect.07.ProcessorDesign.4up

lect.07.ProcessorDesign.4up - EE108b Lecture 7 C. Kozyrakis...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: EE108b Lecture 7 C. Kozyrakis 1 Lecture 7 Building A Simple Processor Christos Kozyrakis Stanford University http://eeclass.stanford.edu/ee108b EE108b Lecture 7 C. Kozyrakis 2 Announcements Upcoming deadlines Lab1 is due today Demo by 5pm, report by midnight HW2 due on Thursday 2/1 PA1 due on Thursday 2/8 Lab #2 is out Learn from previous lab: start early Quiz #1: Tue 2/6, 7pm9pm (location TBD) Catch-up with reading material EE108b Lecture 7 C. Kozyrakis 3 Review: Translation Hierarchy High-level Assembly Machine C Program Assembly Program Machine Object Executable Memory Compiler Assembler Linker Loader Module Object .c .s .o EE108b Lecture 7 C. Kozyrakis 4 Review: Code Optimization Goal: Improve performance by: Removing redundant work Unreachable code Common-subexpression elimination Induction variable elimination Creating simpler operations Dealing with constants in the compiler Strength reduction Managing registers well Time Cycle Clock CPI ns Instructio Time Execution = EE108b Lecture 7 C. Kozyrakis 5 Assembler Expands macros and pseudoinstructions as well as converts constants Primary purpose is to produce an object file Machine language instructions Application data Information for memory organization EE108b Lecture 7 C. Kozyrakis 6 Object File Includes Describes relationship between source code and machine instructions Debugging information Lit of labels that are not defined (e.g. external references) Symbol table Identifies instruction & data that depend on absolute address when the program is loaded Relocation information Static data (initialized) Data segment Machine code Text segment Describes file organization Object header EE108b Lecture 7 C. Kozyrakis 7 Linker Linker combines multiple object modules Identify where code/data will be placed in memory Resolve code/data cross references Produces executable if all references found Steps 1. Place code and data modules in memory 2. Determine the address of data and instruction labels 3. Patch both the internal and external references Separation between compiler and linker makes standard libraries an efficient solution to maintaining modular code EE108b Lecture 7 C. Kozyrakis 8 Loader Loader used at run-time 1. Reads executable file header for size of text/data segments 2. Create address space sufficiently large 3. Copy program from executable on disk into memory 4. Copy arguments to main programs stack 5. Initialize machine registers and set stack pointer 6. Jump to start-up routine 7. Terminate program when execution completes EE108b Lecture 7 C. Kozyrakis 9 What We Really Want?...
View Full Document

Page1 / 15

lect.07.ProcessorDesign.4up - EE108b Lecture 7 C. Kozyrakis...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online