CS6135 HW3 Spec
CS6135 HW3 Spec
2. Problem Description
(1) Input:
⚫ A set 𝐵 of hard blocks, where each block 𝑏𝑖 in 𝐵 has a rectangular
shape specified by 4 corners.
⚫ A netlist 𝐸
⚫ The dead space ratio, which is predefined and passed by the argument.
The aspect ratio of the floorplan region is 1, so you can calculate the
width 𝑤𝑓𝑙 and height ℎ𝑓𝑙 of the floorplan region as follows:
For example, if the total block area is 1100000 and the dead space ratio
is 0.1, the width 𝑤𝑓𝑙 and height ℎ𝑓𝑙 of the floorplanning region are as
follows:
𝑤𝑓𝑙 = ℎ𝑓𝑙 = √1100000 ∗ 1.1 = 1100
Then, the coordinates of the lower-left corner and upper-right corner of
the floorplan region are (0, 0) and (𝑤𝑓𝑙 , ℎ𝑓𝑙 ), respectively.
(2) Output:
⚫ The total wirelength of all nets, where the wirelength for each net is
defined as the half-perimeter wirelength (HPWL) of the minimum
bounding box of pins of the net. Each pin of block 𝑏𝑖 is located at the
center of 𝑏𝑖 . Note that the x- or y- coordinate, say 𝑖 , of each block
center is rounded down to an integer 𝑘 such that 𝑘 ≤ 𝑖 ≤ 𝑘 + 1.
⚫ The coordinates (𝑥𝑖 , 𝑦𝑖 ) of the lower-left corner of each block 𝑏𝑖 , as
well as the rotation status (1 for rotated, and 0 for un-rotated).
1
(3) Objective:
By assuming each block can be rotated by 90 degrees, the total wirelength of
the floorplanning result and the runtime of your program are minimized
subject to the following constraints.
1. Fixed-outline constraint: Each block must be entirely inside the
floorplan region.
2. Non-overlapping constraint: No two blocks overlap with each other.
3. Input File
(1) The .hardblocks file:
The .hardblocks file specifies the name and the other information about each
block/terminal node in the floorplan. Each line specifies a single
block/terminal node. Here is an example:
NumHardRectilinearBlocks : 10
//NumHardRectilinearBlocks : number of hard rectilinear block nodes
NumTerminals : 69
//NumTerminals : number of terminal (pad etc.) nodes
sb0 hardrectilinear 4 (0, 0) (0, 82) (199, 82) (199, 0)
//nodeName hardrectilinear vertexNumber vertex1, vertex2, ..., vertexN
⋮
p1 terminal
//nodeName terminal
⋮
2
(2) The .nets file:
The .nets file specifies the netlist. Here is an example:
NumNets : 118
//NumNets : number of nets
NumPins : 248
//NumPins : number of pins
NetDegree : 2
//NetDegree : number of pins on the net
p1
sb6
//nodeName
⋮
p1 0 0
//nodeName XY-coordinate
⋮
4. Output File
(1) The .floorplan file:
The .floorplan file specifies the floorplanning result including the total
wirelength of all nets and the coordinates of the lower-left corner of each
block with/without rotation.
Wirelength 75563
Blocks
sb0 152 284 1
//nodeName lower-left corner coordinates (x,y) Rotated
sb1 126 179 0
//nodeName lower-left corner coordinates (x,y) Unrotated
5. Language/Platform
(1) Language: C/C++
(2) Platform: Unix/Linux
3
6. Report
Your report must contain the following contents, and you can add more as you wish.
(1) Your name and student ID
(2) How to compile and execute your program and give an execution example.
(3) The wirelength and the runtime of each testcase with the dead space ratios
0.1 and 0.15, respectively.
Notice that the runtime contains I/O, constructing data structures, initial
floorplanning, computing (perturbation) parts, etc. The more details your
experiments have, the more clearly you will know where the runtime
bottlenecks are. You can plot your results like the one shown below.
35
30
25
runtime(s)
20
15
10
5
0
tc1 tc2 tc3
testcases
time1 time2 time3 time4
(4) Please show that how small the dead space ratio could be for your program
to produce a legal result in 20 minutes.
(5) The details of your algorithm. You could use flow chart(s) and/or pseudo code
to help elaborate your algorithm. If your method is similar to some previous
work/papers, please cite the papers and reveal your difference(s).
(6) What tricks did you do to speed up your program or to enhance your solution
quality? Also plot the effects of those different settings like the ones shown
below.
50 runtime(s) 3000 WL
40 2500
w/o. method A
2000
30 w/o. method B
1500
20 w/o. method C
1000
10 Full
500
0 0
(7) Please compare your results with the top 5 students’ results last year for the
case where the dead space ratio is set to 0.15, and show your advantage either
in runtime or in solution quality. Are your results better than theirs?
4
✓ If so, please express your advantages to beat them.
✓ If not, it’s fine. If your program is too slow, then what could be the
bottleneck of your program? If your solution quality is inferior, what do
you think that you could do to improve the result in the future?
Top 5 students’ results last year (dead space ratio = 0.15)
Wirelength Runtime(s)
Ranks n100 n200 n300 n100 n200 n300
1 200956 372143 516906 24.63 47.29 65.81
2 198593 368731 535257 200.25 308.06 226.42
3 194369 354107 491069 385.75 709.61 926.55
4 204001 367298 499733 330.42 576.15 793.26
5 208575 378187 567794 26.72 120.73 247.22
(8) What have you learned from this homework? What problem(s) have you
encountered in this homework?
7. Required Items
Please compress HW3/ (using tar) into one with the name
CS6135_HW3_${StudentID}.tar.gz before uploading it to eeclass.
(1) src/ contains all your source code, your Makefile and README.
➢ README must contain how to compile and execute your program. An
example is like the one shown in HW2.
(2) output/ contains all your outputs of testcases for the TA to verify.
(3) bin/ contains your executable file.
(4) CS6135_HW3_${StudentID}_report.pdf contains your report.
You can use the following command to compress your directory on a workstation:
$ tar -zcvf CS6135_HW3_${StudentID}.tar.gz <directory>
For example:
$ tar -zcvf CS6135_HW3_110062501.tar.gz HW3/
8. Grading
✓ 80%: The solution quality (wirelength) (primary) and the runtime (secondary)
of each testcase, hidden testcases included. This part will be evaluated with
single thread version.
✓ 20%: The completeness of your report.
✓ 5% Bonus: Parallelization. Please specify your system specification.
5
Notes:
⚫ Make sure the following commands can be executed.
◼ Go into directory “src/”, enter “make” to compile your program and
generate the executable file, called “hw3”, which will be in directory “bin/”.
◼ Go into directory “src/”, enter “make clean” to delete your executable
file.
⚫ Please use the following command format to run your program.
$ ./hw3 *.hardblocks *.nets *.pl *.floorplan dead_space_ratio
E.g.:
$ ./hw3 ../testcases/n100.hardblocks ../testcases/n100.nets ../
testcases/n100.pl ../output/n100.floorplan 0.1
⚫ If you implement parallelization, please name your parallel version executable file
as “hw3_parallel” and name your sequential version executable file as “hw3”.
⚫ Use arguments to read the file path. Do not write file path in your code.
⚫ Program must be terminated within 20 minutes for each testcase.
⚫ We will test your program by shell script with GCC 9.3.0 on ic51. Please make
sure your program can be executed by HW3_grading.sh.
⚫ For each testcase, you could use HW3_printer to draw your result like the
following figure.