Important Project Dates

Similar documents
Important Project Dates

Compilers. Computer Science 431

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science

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

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

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

General Course Information. Catalogue Description. Objectives

ECE573 Introduction to Compilers & Translators

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

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

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

Programming Project 4: COOL Code Generation

Compiling Regular Expressions COMP360

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

15-411/ Compiler Design

CS 6353 Compiler Construction Project Assignments

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

Lexical Scanning COMP360

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

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

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

Programming Assignment III

CS164: Programming Assignment 5 Decaf Semantic Analysis and Code Generation

CS 314 Principles of Programming Languages. Lecture 3

CS164: Programming Assignment 2 Dlex Lexer Generator and Decaf Lexer

ECE Introduction to Compilers and Translation Engineering

Programming Project II

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

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

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

CSE 504: Compiler Design

CS 6353 Compiler Construction Project Assignments

CS131 Compilers: Programming Assignment 2 Due Tuesday, April 4, 2017 at 11:59pm

CST-402(T): Language Processors

The Structure of a Syntax-Directed Compiler

CS2 Practical 2 CS2Ah

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS

Programming Assignment IV Due Thursday, June 1, 2017 at 11:59pm

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

The Structure of a Compiler


What do Compilers Produce?

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

Working of the Compilers

CS 426 Fall Machine Problem 1. Machine Problem 1. CS 426 Compiler Construction Fall Semester 2017

CS 406/534 Compiler Construction Putting It All Together

Structure of a compiler. More detailed overview of compiler front end. Today we ll take a quick look at typical parts of a compiler.

CS453 Compiler Construction

Introduction to Compilers and Language Design

CS164: Midterm I. Fall 2003

CS 241 Data Organization using C

Compilers for Modern Architectures Course Syllabus, Spring 2015

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

CS 4120 and 5120 are really the same course. CS 4121 (5121) is required! Outline CS 4120 / 4121 CS 5120/ = 5 & 0 = 1. Course Information

Compiling and Interpreting Programming. Overview of Compilers and Interpreters

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

Compilers. Prerequisites

CS 1653: Applied Cryptography and Network Security Fall Term Project, Phase 2

Announcements. My office hours are today in Gates 160 from 1PM-3PM. Programming Project 3 checkpoint due tomorrow night at 11:59PM.

9/5/17. The Design and Implementation of Programming Languages. Compilation. Interpretation. Compilation vs. Interpretation. Hybrid Implementation

History of Compilers The term

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

CS 314 Principles of Programming Languages

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

Project phase 1 Scanner front-end assigned Tuesday 2 September, due Tuesday 16 September

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

Formats of Translated Programs

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

CMSC 423 Fall 2009: Project Specification

COMP-202A: Introduction to Computing 1

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

CMPE 152 Compiler Design

CSC209. Software Tools and Systems Programming.

CS 337 Project 1: Minimum-Weight Binary Search Trees

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

L25: Modern Compiler Design Exercises

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

Welcome to CSE131b: Compiler Construction

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

Overview of the Class

CS ) PROGRAMMING ASSIGNMENT 11:00 PM 11:00 PM

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

CS/SE 153 Concepts of Compiler Design

EECE.2160: ECE Application Programming

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

CS426 Compiler Construction Fall 2006

Downloaded from Page 1. LR Parsing

CSCI544, Fall 2016: Assignment 1

Extending xcom. Chapter Overview of xcom

Course Syllabus. Course Information

Principles of Compiler Construction ( )

CS143 Handout 25 Summer 2012 August 6 th, 2011 Programming Project 4: TAC Generation

EDAN65: Compilers, Lecture 06 A LR parsing. Görel Hedin Revised:

COMPILER DESIGN. For COMPUTER SCIENCE

Introduction to Compiler Construction

CMSC 201 Fall 2016 Homework 6 Functions

Graduate-Credit Programming Project

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

CSE 401/M501 18au Midterm Exam 11/2/18. Name ID #

COP 3402 Systems Software. Lecture 4: Compilers. Interpreters

Transcription:

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2002 Handout 4 Project Overview Wednesday, September 4 This is an overview of the course project and how we will grade it. You should not expect to understand all of the technical terms, since we have not yet covered them in class. We are handing it out today to give you some idea of the kind of project we are assigning, and to let you know when the various due dates are. Handout 6 - Decaf Language Definition and Handout 7 Espresso Language Definition describes the technical details of the project. The class will be partitioned into groups of three or four people. You will be allowed to choose your own partners as much as possible. Each group is to write, in Java, a compiler for a simple programming language. Each group has a choice between a simple and a complex language; however, the logistics of the project are the same for each. We expect all groups to compete all phases successfully. In the event that your group does not fully complete an earlier phase (scanner or parser), you may use a staff-supplied implementation instead to build the later phases of your compiler. Important Project Dates Wednesday, September 4 Wednesday, September 18 Scanner-Parser Project assigned Scanner-Parser Project due Semantic Checker assigned Thursday, October 3 Semantic Checker Project due Code Generation assigned Tuesday, October 22 Code Generation Checkpoint due Monday, October 28 Code Generation Project due Data-flow Optimizations assigned Thursday, November 14 Data-flow Optimizations Checkpoint due Wednesday, November 20 Data-flow Optimizations Project due Instruction Optimizations assigned Monday, December 9 Instruction Optimizations Project due The Project Segments Descriptions of the six parts of the compiler follow in the order that you will build them. 1. Scanner This part scans the input stream (the program), and encodes it in a form suitable for the remainder of the compiler. You will need to decide exactly what you want the set of 1

tokens to be, and create the regular expressions for the scanner generator. The convention for this partitioning is quite standard in practice. We will supply a scanner generator. This will consist of a program that takes a specification of the set of token types and outputs a Java program, the scanner. This specification uses regular definitions to describe which lexical tokens, i.e., character sequences, are mapped to which token types. The resulting scanner processes the input source code by interpreting the DFA (Deterministic Finite Automaton) that corresponds to the regular definition. Your scanner should work with both Decaf and Espresso languages. 2. Parser The parser checks the syntactic correctness of the token stream generated by the scanner, and creates an intermediate representation of the program that is used in the code generation. You will also need to build the symbol table, since you will not be able to build the code generator without it. We will supply a parser generator. This will consist of a primitive table-driven parser and a program that converts an LALR(1) grammar into a parse table suitable for use by that parser. You will have to transform the reference grammar into a LALR(1) grammar. We will also supply a Java based framework for the intermediate format representation. You are free to modify the IF representation to suite your needs. The assignment (along with the scanner) is due on Wednesday, September 18. 3. Semantic Checker This part checks that various non-context free constraints, e.g., type compatibility, are observed. We will supply you with 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 will not 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. The static semantic checker is due on Thursday, October 3. 4. Code Generation THIS IS A VERY TIME-CONSUMING PROJECT. For example, last year, it was done in two parts. YOU NEED TO START EARLY! 2

In this assignment you will create a working compiler by generating unoptimized MIPS assembly code from the intermediate format you generated in the previous assignment. First, the rich semantics of the Decaf and Espresso programs are broken-down into a simple intermediate representation. For example, constructs such as loops and conditionals are expanded to code segments with simple goto or jmp instructions. Next, the intermediate representation is matched with the Application Binary Interface, i.e. the calling convention and register usage. Then, the corresponding MIPS machine code is generated. Finally, the code, data structures and storage are laid-out in the assembly format. We will provide you with a description of the object language as well as a Java interface. The object code created using this interface can either be simulated using the SPIM simulator or assembled and executed on a native MIPS machine (e.g. SGIs if you can find one). This assignment has a checkpoint. At the checkpoint date, the group has to submit the code they have written so far. The checkpoint is there to strongly encourage you to start working on the project early. If you get your project working at the end, the checkpoint will have no effect. However, if your group is unable to complete the project then 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, i.e. waited till the last minute, you will be severely penalized. The code generation checkpoint is due on Tuesday, October 22. The assignment is due on Monday, October 28. 5. Data-flow Optimizations This assignment will focus on optimizing the code generated by your compiler. You will implement few traditional data-flow optimization algorithms to improve the quality of the code generated. We will provide you with a description of the optimizations that should be implemented. The object code created after this phase can either be simulated using the SPIM simulator or assembled and executed on a native MIPS machine (e.g. SGIs if you can find one). This assignment also has a checkpoint. The checkpoint is due on Thursday, November 14. Data-flow optimizations project is due on Wednesday, November 20. 6. Instruction Optimizations Modern architectures provide many opportunities for getting good performance. In this assignment you will implement a register allocater and an instruction scheduler to take advantage of a modern microprocessors. The assignment is due on Monday, December 9. 3

Grading Make sure you understand this section so that you will not be penalized for trivial oversights. The entire project is worth 54% of your 6.035 grade (and will solely determine your grade for the additional 6 extra units if you wish to implement Espresso, the more complex programming language). This breaks down to the individual parts as follows: 1 2 3 4 5 Scanner and Parser Semantic Checker Code Generator Data-flow Optimizer Instruction Optimizer 6.035 6.907 8% 12% 10% 18% 14% 28% 12% 24% 10% 18% 54% 100% Each project in 6.035 will be graded on a 40 point scale, divided as follows: 10 points 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. For some parts of the project we will require additional documentation. Always read the What to Hand In section. 30 points 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. 10 points Public test cases. Points will be divided among test cases that we will make available. The public test cases demonstrate basic functionality of this phase of the project: in no way will they constitute comprehensive testing. 20 points Hidden test cases. Points will be divided among test cases that we will not reveal until all of the projects have been handed in. 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 part of the project, you will have to provide us with two things: 4

Online Source online sources hardcopy documentation Create a new directory called project name (e.g., scanner) at the top-level of your group locker. Copy all relevant source files to this directory. You are required to provide a Makefile which can generate your executable when your TA types make. (See Handout 4 for details on using make.) Remove all of the object files and try make to be sure it will work for your TA. This directory should contain class files that can be run by the TAs for testing purposes. Files in your submission directory should not be modified after the deadline for submitting the project (5:00 p.m. on the due date). Please consult additional project handouts for phase-specific requirements. Command-line Interface Your compiler should have the following command line interface. javac Compiler [option filename...] where options are: -o <outname> write the output to <outname> -target <stage> <stage> is one of scan, parse, inter, assembly; compilation should proceed to the given stage. -opt [optimization...] preform the listed optimizations. "all" stands for all supported optimizations; "-<optimization>" removes optimizations from the list. -debug print debugging information. If this option is not given, there should be no output to the screen on successful compilation. 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 then 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 left unspecified. By defualt, no optimizations are preformed. The lists of names of optimizations will be provided in the optimization assignments; any which are requested but not supported will be mentioned. 5

You are provided with a class to handle this interface, CLI, which is sufficient to implement this interface and parse the command line. 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, but you can tell us which, if any, to use for the compiler derby. You may want to implement a "-O" mode, which turns on the optimizations you like. For each assignment, your compiler should add support for the target of that assignment. The assignments will specify what should go in files output by each stage. Documentation Hardcopy documentation should be turned in to the course secretary or your TA by 5:00 p.m. on the due date. 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. 2. A list of any clarifications, assumptions, or additions to the problem assigned. The project specifications are fairly broad: they leave many decisions up to you, which is an aspect of real software engineering. If you think major clarifications are necessary, consult your TA. 3. An overview of your design. A description of your top-level design, analysis of design alternatives you considered, and key design decisions. Be sure to document and justify all design decisions you make. Any decision 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. A description on the design for non-trivial modules. Any changes that 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 also include 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 6

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. Recent graduates of 6.170 might be disappointed to know we don t require any documentation of evidence of your test cases or testing strategy. 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. 7