Important Project Dates

Similar documents
Important Project Dates

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science

COMP 412, Fall 2018 Lab 1: A Front End for ILOC

CSE4305: Compilers for Algorithmic Languages CSE5317: Design and Construction of Compilers

Compilers. Computer Science 431

CSE4305: Compilers for Algorithmic Languages CSE5317: Design and Construction of Compilers

CSE4305: Compilers for Algorithmic Languages CSE5317: Design and Construction of Compilers

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square)

CMPE 152 Compiler Design

General Course Information. Catalogue Description. Objectives

CS4120/4121/5120/5121 Spring /6 Programming Assignment 4

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

CS 553 Compiler Construction Fall 2009 Project #1 Adding doubles to MiniJava Due September 8, 2009

ECE573 Introduction to Compilers & Translators

Programming Standards: You must conform to good programming/documentation standards. Some specifics:

CS 241 Data Organization using C

CS 4201 Compilers 2014/2015 Handout: Lab 1

CS164: Programming Assignment 2 Dlex Lexer Generator and Decaf Lexer

15-411/ Compiler Design

Compilers for Modern Architectures Course Syllabus, Spring 2015

CMPE 152 Compiler Design

CS 6353 Compiler Construction Project Assignments

Programming Project 4: COOL Code Generation

2018 Pummill Relay problem statement

COMP 181 Compilers. Administrative. Last time. Prelude. Compilation strategy. Translation strategy. Lecture 2 Overview

Full file at

ECE Introduction to Compilers and Translation Engineering

CS143 Handout 05 Summer 2011 June 22, 2011 Programming Project 1: Lexical Analysis

Assignment Tutorial.

The print queue was too long. The print queue is always too long shortly before assignments are due. Print your documentation

Programming Assignment IV Due Thursday, November 18th, 2010 at 11:59 PM

CS 432 Fall Mike Lam, Professor. Compilers. Advanced Systems Elective

CSC209. Software Tools and Systems Programming.

CS 6353 Compiler Construction Project Assignments

Introduction to Compiler Construction

Programming Assignment IV Due Monday, November 8 (with an automatic extension until Friday, November 12, noon)

Lexical Considerations

Assignment 3 ITCS-6010/8010: Cloud Computing for Data Analysis

CS164: Midterm I. Fall 2003

Programming Assignment I Due Thursday, October 7, 2010 at 11:59pm

CS31 Discussion 1E. Jie(Jay) Wang Week1 Sept. 30

CS164: Programming Assignment 5 Decaf Semantic Analysis and Code Generation

CS/SE 153 Concepts of Compiler Design

Ray Tracing Performance Derby Final Project

CS 536. Class Meets. Introduction to Programming Languages and Compilers. Instructor. Key Dates. Teaching Assistant. Charles N. Fischer.

Programming Assignment III

Additional Guidelines and Suggestions for Project Milestone 1 CS161 Computer Security, Spring 2008

CS 118 Project Phase 2 P2P Networking

TA hours and labs start today. First lab is out and due next Wednesday, 1/31. Getting started lab is also out

Hands on Assignment 1

6.035 Project 3: Unoptimized Code Generation. Jason Ansel MIT - CSAIL

New York University Computer Science Department Courant Institute of Mathematical Sciences

CSC 352, Fall 2015 Assignment 3 Due: Wednesday, September 16 at 23:59:59

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, Pilani Pilani Campus Instruction Division

CMPE 655 Fall 2016 Assignment 2: Parallel Implementation of a Ray Tracer

CS 415 Midterm Exam Spring 2002

Compiling Regular Expressions COMP360

Sardar Vallabhbhai Patel Institute of Technology (SVIT), Vasad M.C.A. Department COSMOS LECTURE SERIES ( ) (ODD) Code Optimization

Outline. Lecture 17: Putting it all together. Example (input program) How to make the computer understand? Example (Output assembly code) Fall 2002

CSC209. Software Tools and Systems Programming.

Programming Assignments

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

CS2112 Fall Assignment 4 Parsing and Fault Injection. Due: March 18, 2014 Overview draft due: March 14, 2014

CS350 : Operating Systems. General Assignment Information

CS 553 Compiler Construction Fall 2007 Project #1 Adding floats to MiniJava Due August 31, 2005

Project Compiler. CS031 TA Help Session November 28, 2011

Compiling Techniques


CS 406/534 Compiler Construction Putting It All Together

ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1

Announcements. 1. Forms to return today after class:

Programming Assignment I Due Thursday, October 9, 2008 at 11:59pm

CSSE 304 Assignment #13 (interpreter milestone #1) Updated for Fall, 2018

Bit Hacks Project 1. Last Updated: October 3, 2010

3. When you process a largest recent earthquake query, you should print out:

Compiler Design. Subject Code: 6CS63/06IS662. Part A UNIT 1. Chapter Introduction. 1.1 Language Processors

ECE Object-Oriented Programming using C++ and Java

CS164: Programming Assignment 4 includes Written Assignment 7! SkimDecaf Semantic Analysis and Code Generation

CSE 401 Final Exam. March 14, 2017 Happy π Day! (3/14) This exam is closed book, closed notes, closed electronics, closed neighbors, open mind,...

COMP90015: Distributed Systems Assignment 1 Multi-threaded Dictionary Server (15 marks)

CMSC 423 Fall 2009: Project Specification

Due: March 8, 11:59pm. Project 1

1 Lexical Considerations

Syntax Analysis. Chapter 4

CS415 Compilers Overview of the Course. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

CS3114 (Fall 2013) PROGRAMMING ASSIGNMENT #2 Due Tuesday, October 11:00 PM for 100 points Due Monday, October 11:00 PM for 10 point bonus

CSE 114, Computer Science 1 Course Information. Spring 2017 Stony Brook University Instructor: Dr. Paul Fodor

CSC 258 lab notes, Fall 2003


Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Worksheet #4. Foundations of Programming Languages, WS 2014/15. December 4, 2014

CST-402(T): Language Processors

Overview. Lab 2: Information Retrieval. Assignment Preparation. Data. .. Fall 2015 CSC 466: Knowledge Discovery from Data Alexander Dekhtyar..

CS2110 Assignment 2 Lists, Induction, Recursion and Parsing, Summer

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division

CS/SE 153 Concepts of Compiler Design

The Structure of a Syntax-Directed Compiler

Homework Assignment #3

CS453 Compiler Construction

Compilers. Lecture 2 Overview. (original slides by Sam

Transcription:

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2010 Handout Project Overview Tuesday, Feb 2 This is an overview of the course project and how we ll grade it. You should not expect to understand all the technical terms, since we haven t yet covered them in class. We re handing it out today to give you some idea of the kind of project we re assigning, and to let you know the various due dates. Additional handouts will provide the technical details of the project. The first project (Scanner and Parser) will be done individually. Each students is expected to submit their own code and write-ups. For subsequent projects, the class will be partitioned into groups of three or four students. You will be allowed to choose your own partners as much as possible. Each group will write, in Java, a compiler for a simple programming language. We expect all groups to complete all phases successfully. The start of the class is very fast-paced: do not fall behind! Important Project Dates Project Name Assigned/Due Day Scanner and Parser assigned: Wednesday, Feb 3 Tuesday, Feb 16 Semantic Checker assigned: Tuesday, Feb 16 Monday, Mar 1 Code Generator assigned: design due: Monday, Mar 1 Wednesday, Mar 10 Tuesday, Mar 16 Data-flow Analysis assigned: Tuesday, Mar 16 Thursday, Apr 1 Optimizer assigned: design due: checkpoint due: Thursday, Apr 1 Thursday, Apr 15 Wednesday, Apr 28 Wednesday, May 12 Compiler Derby held on: Thursday, May 13 The Project Segments Descriptions of the five parts of the compiler follow in the order that you will build them. Scanner and Parser A Scanner takes a Decaf source file as an input and scans it looking for tokens. A token can be an operator (ex: * or [ ), a keyword (if or class), a literal (14 or c ) a string ( abc ) or an identifier. Non-tokens (such as white spaces or comments) are discarded. Bad tokens must be reported. 1

A Parser reads a stream of tokens and checks to make sure that they conform to the language specification. In order to pass this check, the input must have all the matching braces, semicolons, etc. Types, variable names and function names are not verified. The output can be either a usergenerated structure or a simple parse-tree that then needs to be converted to a easier-to-process structure. We will provide you with a grammar of the language, which you will need to separate into a scanner specification and a parser specification. While the grammar given should be pretty close to the final grammar you use, you will need to make some changes. You will use a tool called ANTLR to generate a scanner and a parser. The generated code will automatically perform most error checking and reporting for you. Semantic Checker This part checks that various non-context free constraints, e.g., type compatibility, are observed. We ll supply a complete list of the checks. It also builds a symbol table in which the type and location of each identifier is kept. The experience from past years suggests that many groups underestimate the time required to complete the static semantic checker, so you should pay special attention to this deadline. It is important that you build the symbol table, since you won t be able to build the code generator without it. However, the completeness of the checking will not have a major impact on subsequent stages of the project. At the end of this project the front-end of your compiler is complete and you have designed the intermediate representation (IR) that will be used by the rest of the compiler. Code Generation In this assignment you will create a working compiler by generating unoptimized x86-64 assembly code from the intermediate format you generated in the previous assignment. Because you have relatively little time for this project you should concentrate on correctness and leave any optimization hacks out, no matter how simple. The steps of code generation are as follows: first, the rich semantics of Decaf are broken-down into a simple intermediate representation. For example, constructs such as loops and conditionals are expandedto code segments with simple comparison andbranchinstructions. Next, theintermediate representation is matched with the Application Binary Interface, i.e., the calling convention and register usage. Then, the corresponding x86-64 machine code is generated. Finally, the code, data structures, and storage are laid-out in the assembly format. We will provide a description of the object language. The object code created using this interface will then be run on a testing machine (more on the testing machines soon). This phase requires a Project Design Document and a Project Checkpoint, which is due on the Thursday prior to thedeadline(see theimportantprojectdatessection). Thegrouphas toprovide two parts. First, a design document describing your design. This will be reviewed by the TA and feedback will be provided. This document will also count towards the project grade. Second, the group has to submit a checkpoint of the implementation. The checkpoint exists to strongly encourage you to start working on the project early. If you get your project working at the end, the checkpoint will have little effect. However, if your group is unable to complete the project, the checkpoint submission has a critical role in your grade. If we determine that your group did not do a substantial amount of work before the checkpoint, you will be severely penalized. 2

Data Flow Analysis This assignment phase consists of building a data-flow framework to help optimize the code generated by your compiler. For this phase, you are required to implement the data-flow framework and a single data-flow optimization pass to test the framework. This framework will be used in the Optimizer project to build data-flow optimization passes. We will provide a description of the framework and the required optimization be implemented in a later handout. Optimizer The final project is a substantial open-ended project. In this project your team s task is to generate optimized code for programs so that they will be correctly executed in the shortest possible time. There are multitude of different optimizations you can implement to improve the generated code. You can perform data-flow optimizations such as constant propagation, common sub-expression elimination, copy propagation, loop invariant code motion, unreachable code elimination, dead code elimination and many others using the framework created in the previous segment. You can also implement instruction scheduling, register allocation, peephole optimizations and even parallelization across the cores of the target architecture. In order to identify and prioritize optimizations, you will be provided with a benchmark suite of three simple applications. Your task is to analyze these programs, perhaps hand optimizing these programs, to identify which optimizations will have the highest performance impact. Your write-up needs to clearly describe the process you went through to identify the optimizations you implemented and justify them. The last class will be the Compiler Derby at which your group will compete against other groups to identify the compiler that produces the fastest code. The application used for the Derby will be provided to the groups one day before the Derby. This is done in order for your group to debug the compiler and get it working on this program. However, you are forbidden from adding any application-specific hacks to make this specific program run faster. Grading Make sure you understand this section so you won t be penalized for trivial oversights. The entire project is worth 60% of your 6.035 grade. The grade is divided between the segments in the following breakdown: Scanner-Parser 5% Semantic Checker 7.5% Code Generator 10% Data-flow Analyzer 7.5% Optimizer 30% The remaining40%comesfrom threequizzes, each worth10%, and20 mini-quizzes at thebeginning of every lecture, each worth 0.5%. The first 4 phases of the project (Scanner-Parser, Semantic Checking, Code Generation, and Dataflow Analysis) will be graded as follows: 3

(25%) Design and Documentation (subjective). Your score will be based on the quality of your design, clarity of your design documentation, and incisiveness of your discussion on design alternatives and issues. Some parts of the project require additional documentation. Always read the What to Hand In section. For the segments that require a Project Design Document, 10% will be assigned to the design document and 15% to the final write-up. (75%) Implementation (objective). Points will be awarded for passing specific test cases. Each project will include specific instructions for how your program should execute and what the output should be. If you have good reasons for doing something differently, consult your TA first. Public Tests (25%) Hidden Tests (50%) The Optimizer project phase will be graded differently: (20%) Design and Documentation, with particular attention given to your description of the optimization selection process. (40%)Implementation. Aseachgroupimplementsdifferentoptimizations, theonlypublictest is the generation of correct results for the benchmark suite and the Derby program (10%). The hidden tests will check for overtly optimistic optimizations and incorrect handling of programs (30%). (40%) Derby Performance. The formula for translating the running time of the program compiled by your compiler into a grade will be announced later. All members of a group will receive the same grade on each part of the project unless a problem arises, in which case you should contact your TA as soon as possible. What To Hand In For each phase, you are required to submit your project write-up, complete sources (including all files needed to build your project), and a compiled.jar file that the TA can use to run the various tests. These sources should be places in a.tar.gz archive. The first project (scanner/parser) should be completed and submitted individually through stellar. Projects 2 through 5 will be done in groups. Each group will be given access to shared storage space in the 6.035 course locker on * athena. More information about submitting group projects will be provided when the second project is assigned. Command-line Interface Your compiler should have the following command line interface. javac -jar Compiler.jar [option filename...] 4 *Athena is MIT's UNIX-based computing environment. OCW does not provide access to it.

-o <outname> Write output to <outname> -target <stage> -opt [optimization...] -debug <stage> is one of scan, parse, inter, or assembly. Compilation should proceed to the given stage. Perform the listed optimizations. all stands for all supported optimizations. -<optimization> removes optimizations from the list. Print debugging information. If this option is not given, there should be no output to the screen on successful compilation. Table 1: Compiler Command-line Arguments The command line arguments you must implement are listed in Table 1. Exactly one filename should be provided, and it should not begin with a -. The filename must not be listed after the -opt flag, since it will be assumed to be an optimization. The default behavior is to compile as far as the current assignment of the project and produce a file with the extension changed based on either the target or.out if the target is unspecified. By default, no optimizations are performed. The list of optimization names will be provided in the optimization assignments. We have provided a class, CLI, which is sufficient to implement this interface. It also returns a Vector of arguments it did not understand which can be used to add features. The TAs will not use any extra features you add for grading. However, you can tell us which, if any, to use for the compiler derby. You may wish to provide a -O flag, which turns on the optimizations you like. Documentation / Write-up Documentation should included in your source archive. It should be clear, concise and readable. Fancy formatting is not necessary; plain text is perfectly acceptable. You are welcome to do something more extravagant, but it will not help your grade. Your documentation must include the following parts: 1. A brief description of how your group divided the work. This will not affect your grade; it will be used to alert the TAs to any possible problems. (Projects 2 through 5 only.) 2. A list of any clarifications, assumptions, or additions to the problem assigned. The project specifications are fairly broad and leave many of the decisions to you. This is an aspect of real software engineering. If you think major clarifications are necessary, consult your TA. 3. An overview of your design, an analysis of design alternatives you considered, and key design decisions. Be sure to document and justify all design decisions you make. Any decision 5

accompanied by a convincing argument will be accepted. If you realize there are flaws or deficiencies in your design late in the implementation process, discuss those flaws and how you would have done things differently. Also include any changes you made to previous parts and why they were necessary. 4. A brief description of interesting implementation issues. This should include any non-trivial algorithms, techniques, and data structures. It should alsoinclude any insights you discovered during this phase of the project. 5. Only for scanner and parser: A listing of commented source code relevant to this part of the project. For later stages, the TAs can print out source code if needed. Do not resubmit source code from other parts of the project, even if minor changes have been made. 6. A list of known problems with your project, and as much as you know about the cause. If your project fails a provided test case, but you are unable to fix the problem, describe your understanding of the problem. If you discover problems in your project in your own testing that you are unable to fix, but are not exposed by the provided test cases, describe the problem as specifically as possible and as much as you can about its cause. If this causes your project to fail hidden test cases, you may still be able to receive some credit for considering the problem. If this problem is not revealed by the hidden test cases, then you will not be penalized for it. It is to your advantage to describe any known problems with your project; of course, it is even better to fix them. It is entirely up to you to determine how to test your project. The thoroughness of you testing will be reflected in your performance on the hidden test cases. 6

MIT OpenCourseWare http://ocw.mit.edu 6.035 Computer Language Engineering Spring 2010 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.