Sie sind auf Seite 1von 4

Senior Project Assignment I - Practice of GNU Debugger

Professor Shih-Chieh Chang Organized by Cody Yu


I. Introduction To attend to CAD contest, SC lab has to tech you many technology backgrounds about VLSI design flow, useful optimal and heuristic algorithms. Meanwhile, SC lab also has to confirm that you can solve bugs in programs very effectively. As the result, we planned this assignment to let you be familiar with a common debugger named GNU debugger for C/C++ language.

II. Introduction to Given Program In this assignment, you have to trace a give program, and then find the bugs in the program which cause program Segmentation Fault and Function Error. Program usage: ./listSche <Input file> A. Introduction This program is a time-constrained scheduler to minimize the resource cost. Assume there are only two types of operations: addition and multiplication. An addition takes 1 time units, and a multiplication takes 3 time units. Assume that the resource cost is equal to X+4Y where X is the number of adders used and Y is the number of multipliers used. B. Input and output For input files, the first three lines list the total number of nodes, the number of edges, and the deadline, respectively. The next n (n = total number of nodes) lines list the node information. Each of these n lines contains a unique node number followed by a symbol. There are 4 kinds of symbol: i represents an input node, o represents an output node, + represents an addition node, and * represents a multiplication node. After that, there are m (m=number of edges) lines listing the edge information. Each of these m lines contains a node number u followed by another node number v which represents a directed edge from u to v. On the other hand, for output files, the first line lists the resource cost. The second line lists the number of adders and the number of multipliers used. The (i+2)-th line lists the node(s) executed during the i-th time unit.

C. Sample Input 13 // total number of nodes 17 // number of edges 7 // deadline 1i // node 1~3 are inputs 2i 3i 4+ // node 4, 5 are Add operators 5+ 6* // node 6 is a Multiply operator 7+ 8+ 9* 10 + 11 o // node 11~13 are outputs 12 o 13 o 15 // an edge from node 1 to node 5 25 // an edge from node 2 to node 5 24 5 26 34 1 37 46 6 47 2 58 4 68 69 6 10 3 79 7 10 7 8 11 Fig. 1 9 12 10 13

8 11 9 12 10 13

D. Sample Output 5 // resource cost = 5 11 // 1 adder and 1 multiplier used 4 // execute the operation of node 4 at time t0 67 65 6 98 9 10 9 E. Verify Tool We also provide another program to verify the results of main program. The usage of verify program is: ./Verify <Original input file> <Output file from listSche> After executing this program, you will obtain a report shown on the screen to tell you if the output file from listSche is correct or not. The format of report is: MinCycleTime: <Minimum cycle in need> Success: Primary output <Primary output 1> Success: Primary output <Primary output N> <Pass or Fail> F. Auto Run We provide a simple script file run.pl, written by Perl language, to help you to verify 10 test cases efficiently. Just execute ./run.pl, and you will get two result files, ans.log and rpt.log. The first file, ans.log, is composed by all output files from listSche while rpt.log is made from the results of Verify program. You have to confirm that ans.log is same as golden solution golden/golden_ans.txt and rpt.log is same as golden/golden_rpt.txt. You can use the instruction vimdiff from Unix shell to compare two files. III. Requirement We have set some bug in the program listSche. All bugs can be categorized to two types. The first type of them will cause program Segmentation Fault. It has

totally three bugs of this type in the program. On the other hands, the second type will cause wrong answer of program. We only put one bug of this type in the program. Please write a report about your debug experience. For each bug in the program, please describe its characteristic and debug process by using GDB. IV. Notice 1. Due day: 2012.02.10 (Fri.) 23:59 2. Please send you report (PDF format) to comaniac0422@gmail.com 3. This assignment has no grading system, so you can do this in free. But we hope that you can find at least three bugs of type one (segmentation fault). 4. If you have any problem about this assignment, please leave a message on iLMS system. All of you including me can support you to solve it.

Das könnte Ihnen auch gefallen