ECE556 Project Part 1 Azadeh Davoodi Spring 2015.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

A C++ Crash Course Part II UW Association for Computing Machinery Questions & Feedback.
SYMBOL TABLES &CODE GENERATION FOR EXECUTABLES. SYMBOL TABLES Compilers that produce an executable (or the representation of an executable in object module.
C Structures What is a structure? A structure is a collection of related variables. It may contain variables of many different data types---in contrast.
C Language.
R4 Dynamically loading processes. Overview R4 is closely related to R3, much of what you have written for R3 applies to R4 In R3, we executed procedures.
CSI 3120, Implementing subprograms, page 1 Implementing subprograms The environment in block-structured languages The structure of the activation stack.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
CSCC69: Operating Systems
1 Software Engineering Lecture 11 Software Testing.
(1) ICS 313: Programming Language Theory Chapter 10: Implementing Subprograms.
Lecture 3 Feb 4 summary of last week’s topics and review questions (handout) Today’s goals: Chapter 1 overview (sections 1.4 to 1.6) c++ classes constructors,
Dynamic Data Structures H&K Chapter 14 Instructor – Gokcen Cilingir Cpt S 121 (July 26, 2011) Washington State University.
1 Chapter 7: Runtime Environments. int * larger (int a, int b) { if (a > b) return &a; //wrong else return &b; //wrong } int * larger (int *a, int *b)
1 11/8/06CS150 Introduction to Computer Science 1 Arrays Chapter 8 page 477 November 13, 2006.
CSE 451 Section 4 Project 2 Design Considerations.
Chapter 8 Arrays and Strings
Fork and Exec Unix Model Tutorial 3. Process Management Model The Unix process management model is split into two distinct operations : 1. The creation.
University of Washington CSE 351 : The Hardware/Software Interface Section 5 Structs as parameters, buffer overflows, and lab 3.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
1 Project 5: Median. 2 The median of a collection of numbers is the member for which there are an equal number less than or equal and greater than or.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 19 Clicker Questions November 3, 2009.
Pointers CS362. Pointers A Pointer is a variable that can hold a memory address Pointers can be used to: Indirectly reference existing variables (sometimes.
Confidentiality Preserving Integer Programming for Global Routing Hamid Shojaei, Azadeh Davoodi, Parmesh Ramanathan Department of Electrical and Computer.
Scott Marino MSMIS Kean University MSAS5104 Programming with Data Structures and Algorithms Week 10 Scott Marino.
ESMF Code Generation Rocky Dunlap Spencer Rugaber Leo Mark Georgia Tech College of Computing.
Chapter 8 Arrays and Strings
Object Oriented Programming Elhanan Borenstein copyrights © Elhanan Borenstein.
Chapter 0.2 – Pointers and Memory. Type Specifiers  const  may be initialised but not used in any subsequent assignment  common and useful  volatile.
ICS 145B -- L. Bic1 Project: Main Memory Management Textbook: pages ICS 145B L. Bic.
Game Programming in Java Dr. Jeyakesavan Veerasamy CS faculty, The University of Texas at Dallas Website:
Pointers OVERVIEW.
COP4020 Programming Languages Subroutines and Parameter Passing Prof. Xin Yuan.
Copyright 2005, The Ohio State University 1 Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation.
Implementing Subprograms What actions must take place when subprograms are called and when they terminate? –calling a subprogram has several associated.
Review Binary Numbers Bit : 0 or 1 Byte: 8 bites 256 different values 2 8 KB : 1024 bytes 2 10 bytes MB : 1024 * 1024 bytes 2 10 * 2 10 (2 20 ) bytes GB.
RUN-Time Organization Compiler phase— Before writing a code generator, we must decide how to marshal the resources of the target machine (instructions,
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Contextual Analysis (Chapter 5) 1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture.
Operating Systems Process Creation
Slides created by: Professor Ian G. Harris Hello World #include main() { printf(“Hello, world.\n”); }  #include is a compiler directive to include (concatenate)
More C++ Bryce Boe 2013/10/23 CS24, Fall Outline Project 1 Review Alignment and Padding Finish C++ Introduction.
Office of Housing Choice Voucher Program Voucher Management System – VMS Version Released October 2011.
HKOI Programming HKOI Training Team (Intermediate) Alan, Tam Siu Lung Unu, Tse Chi Yung.
1 CSCD 326 Data Structures I Hashing. 2 Hashing Background Goal: provide a constant time complexity method of searching for stored data The best traditional.
Functions, Scope, and The Free Store Functions Functions must be declared by a function prototype before they are invoked, return_type Function_name(type,
PROGRAM ESSENTIALS. TOKENS  SMALLEST UNITS OF A PROGRAM LANGUAGE  Special Symbols  Mathematical Operators  Punctuation  Word Symbols  Key Words.
Variables and memory addresses
EEL 3801 C++ as an Enhancement of C. EEL 3801 – Lotzi Bölöni Comments  Can be done with // at the start of the commented line.  The end-of-line terminates.
Introduction to Computers and Programming Class 24 Structures (structs) Professor Avi Rosenfeld.
CSE 332: C++ STL iterators What is an Iterator? An iterator must be able to do 2 main things –Point to the start of a range of elements (in a container)
Subprograms - implementation. Calling a subprogram  transferring control to a subprogram: save conditions in calling program pass parameters allocate.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
CPS120 Introduction to Computer Science Exam Review Lecture 18.
Array and Pointers An Introduction Unit Unit Introduction This unit covers the usage of pointers and arrays in C++
COMP 1402 Winter 2008/Summer 2008 Tutorial #10 Enumerations, Unions, Linked Lists.
Chapter 10 Chapter 10 Implementing Subprograms. Implementing Subprograms  The subprogram call and return operations are together called subprogram linkage.
Revisiting building. Preprocessing + Compiling 2 Creates an object file for each code file (.c ->.o) Each.o file contains code of the functions and structs.
Prof. Amr Goneid, AUC1 CSCE 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part R2. Elementary Data Structures.
CSE 332: C++ Exceptions Motivation for C++ Exceptions Void Number:: operator/= (const double denom) { if (denom == 0.0) { // what to do here? } m_value.
Variables Bryce Boe 2012/09/05 CS32, Summer 2012 B.
APPENDIX a WRITING SUBROUTINES IN C
Student Book An Introduction
Stack Data Structure, Reverse Polish Notation, Homework 7
Code Generation.
SIS: A System for Sequential Circuit Synthesis
Course Overview PART I: overview material PART II: inside a compiler
EECE.2160 ECE Application Programming
SPL – PS1 Introduction to C++.
Presentation transcript:

ECE556 Project Part 1 Azadeh Davoodi Spring 2015

Part 1: Overview In this part you implement a very simple router and the main goal is to become familiar with the data structures and the input/output formats You should fill in the template source code and create an executable called “ROUTE.exe” with the exact format and input arguments given below:./ROUTE.exe Your output file should then pass the evaluation script posted on the project website (when eval_mode=0) which checks the validity of your generated routing solution

Template Source Code Contains 4 files 1.main.cpp 2.ece556.h 3.ece556.cpp 4.Makefile You only need to implement some functions (explained in the next few slides) which are all located inside ece556.cpp Can use either C++ or C Use of existing data structures (described in ece556.h) strongly recommended – OK to change data structures, but any problems occurred (e.g., running out of memory or runtime getting too slow) in this part or future parts will be your responsibility

main.cpp // Read input benchmark status = readBenchmark(inputFileName, rst); if(status==0){ printf("ERROR: reading input file \n");return 1; } // run actual routing status = solveRouting(rst); if(status==0){ printf("ERROR: running routing \n");release(rst);return 1; } // write output routing file status = writeOutput(outputFileName, rst); if(status==0){ printf("ERROR: writing the result \n");release(rst);return 1; } // release memory release(rst);

Part 1: Tasks Fill in the following functions in the template source code (ece556.cpp) 1.int readBenchmark(const char *fileName, routingInst *rst); 2.int solveRouting(routingInst *rst); 3. int writeOutput (const char *outRouteFile, routingInst *rst); 4.int release(routingInst *rst); Your source code should compile and run on any of the CAE tux machines Your output file should pass the evaluation script posted on the project website – Output file checked using an evaluation script with input argument eval_mode=0 indicating a longer evaluation mode checking the validity of the solution

1.int readBenchmark (const char *fileName, routingInst *rst); Reads in the benchmark file and initializes the routing instance – This function needs to populate some fields in the routingInst structure – Refer to the project website linked from the Moodle page for description of the input format – input1: fileName: Name of the benchmark input file – input2: pointer to the routing instance – output: 1 if successful

int solveRouting(routingInst *rst) This function creates a routing solution – input: pointer to the routing instance – output: 1 if successful, 0 otherwise (e.g. if the data structures are not populated) Simple ideas on implementing this function for part 1 given in the future slides

int writeOutput (const char *outRouteFile, routingInst *rst); Write the routing solution obtained from solveRouting(). – input1: name of the output file – input2: pointer to the routing instance – output: 1 if successful, 0 otherwise (e.g. the output file is not valid) Refer to the project website for the required output format. Make sure your generated output file passes the evaluation script to verify it is in the correct format and the nets have been correctly routed. The script also reports two quality metrics: (1) total wirelength and (2) total edge overflow, for your routing solution.

int release(routingInst *rst); Releases the memory for all the allocated data structures – input: pointer to the routing instance – output: 1 if successful, 0 otherwise Failure to release may cause memory problems after multiple runs of your program Need to recursively delete all memory allocations from bottom to top (e.g., starting from segments then routes then individual fields within a net struct, then the nets, then the fields in a routing instance, and finally the routing instance)

Overview of Data Structures point: A structure to represent a 2D Point typedef struct { int x ; /* x coordinate ( >=0 in the routing grid)*/ int y ; /* y coordinate ( >=0 in the routing grid)*/ } point ; segment: A structure to represent a segment typedef struct { point p1 ; /* start point of a segment */ point p2 ; /* end point of a segment */ int numEdges ; /* number of edges in the segment*/ int *edges ; /* array of edge indexes representing a (continuous) path*/ } segment ; route: A structure to represent a route typedef struct { int numSegs ; /* number of segments in a route*/ segment *segments ; /* an array of segments (note, a segment may have any shape, for example flat, L-shaped, etc.) } route ;

Overview of Data Structures Net: A structure to represent the connectivity and route of an interconnect typedef struct { int id ; /* ID of the net */ int numPins ; /* number of pins (or terminals) of the net */ point *pins ; /* array of pins (or terminals) of the net. */ route nroute ;/* stored route for the net. */ } net ; routingInst: A structure to represent the routing instance typedef struct { int gx ;/* x dimension of the global routing grid */ int gy ;/* y dimension of the global routing grid */ int cap ;/* default capacity of the edges */ int numNets ;/* number of nets */ net *nets ;/* array of nets */ int numEdges ; /* number of edges of the grid */ int *edgeCaps; /* array of the actual edge capacities after adjustment for blockages */ int *edgeUtils;/* array of edge utilizations */ } routingInst ;

int solveRouting(routingInst *rst) Simple ideas on implementing this function using the provided data structures 1.View the array of pins stored for a net as a “net decomposition” into union of two-terminal sub-nets For example: net->pins: p1  p2  p3  p5 is viewed as the union of the following two-terminal sub-nets: p1  p2, p2  p3, p3  p5 2.Create a “segment” for each two-terminal sub-net of a multi- terminal net following these rules If the sub-net is flat (i.e., the two pins have same x or same y), route as a flat line If the sub-net is not flat, route the sub-net as a pattern of your choice, for example an L-shaped pattern In the above cases, “routing” means storing the integer edge IDs composing the segment (segment->edges) The above rules are used to create a simple routing solution for the first part of the project which can be used as initial solution to the second part of the project.

On Storing Edge IDs Can use simple formula of your choice which maps two given end points of an edge to a unique ID edgeID = f(p1, p2) Note, also need the reverse of the function (f -1 ) to map edgeID to p1 and p2 in order to describe the route in the required format in the output file Some ideas are reflected in an example on the project website