Title : ILP equation generator using PERL
Name and Reg.No
Submitted by:
1) Aakanksha Sharma - 20MVD0006
In team with:
2) Konakalla Ankalarao -20MVD0028
Introduction:
An analytical method for floorplanning optimization is based on mixed integer
linear programming (ILP) formulation that considers various floorplanning
objectives including area, wirelength, and routability. This work can handle
both fixed and flexible modules and considers rotation of the fixed modules.
Various techniques were utilized to convert non-linear objectives and
constraints into linear equations. In order to handle large-scale problems, the
authors presented a heuristic called “successive augmentation”. In this
method, a subset of modules is first floor planned, and these modules are
merged to form bigger modules. We then floorplan these bigger modules
together with the next subset of modules. The goal is to keep the number of
modules to be floor planned (= number of variables in the ILP formulation) low
so that the computation time remains reasonable.The ILP formulation consists
of four parts: objective function, non-overlap constraints, variable type
constraints, and chip boundary constraints.
Objective function: The primary objective is the floorplan area minimization.
Since the area objective is non-linear (width × height), we set the width as a
constraint and minimize the height.
Non-overlap constraints: Given a pair of modules, we assign only one “relative
position relation” to this pair out of four possibilities: right of, left of,below, and
above. This can be done by utilizing all-pair binary variables xij and yij for
modules i and j as follows:
– xij = 0 and yij = 0: module i is to the left of module j.
– xij = 0 and yij = 1: module i is below module j.
– xij = 1 and yij = 0: module i is to the right of module j.
– xij = 1 and yij = 1: module i is above module j.
For each pair of blocks, we set up these four equations so that only one of
them becomes non-trivial based on the actual relative position. In case the
module rotation is desired, an integer variable zi for module i is used so that if
zi = 1, the non-overlap constraint equations utilize the width in place of the
height, vice versa. If we have a flexible module with fixed area and bounded
aspect ratio, we set the width as a continuous variable and obtain the linear
equation for the height. Since the width and height relation is non-linear, i.e.,
wi · hi = Ai, we utilize Taylor series to approximate the width-height relation.
Variable type constraints: We define the type and range of the continuous
and integer variables.
Chip boundary constraints: We make sure that the modules are located
within the chip boundary.
Algorithm (Pseudo code) :
1) In the start of the program the user is asked for the number of blocks,
by admitting one block at a time with width and height.
2) Now, the four basic equations in the algorithm are implemented in the
program.
3) Based on the number of blocks given by user variables are generated in
the program.
4) The Blocks are compared with each other on a scale of different height
and width.
5) The Comparison is used to generate the ILP equations.
Program:
$var =1;
$count=0;
@input_var=()
;
$width=0;
$height=
0;
while($v
ar)
print "enter block-$count \(width,height\) for finshing enter f\n";
$input
=<STDIN>;
chomp($input)
;
if ($input == f)
$var=0;
else
@local_array=split(",",$input);
push(@input_width,$local_array[0]);
push(@input_height,$local_array[1]);
$count=$count+1;
}
}
print
"@input_width\n";
print
"@input_height\n";
for ( $i = 0; $i<=$#input_width; $i=$i+1)
$height=$height+$input_height[$i];
$width=$width+$input_width[$i];
print "W=$width H=$height";
print "enter saving file name with extension \n
"; chomp($filename=<STDIN>);
open(DIR,">$filename");
sub
xleft {
#
body.
..
$sub_var =@_[0];
$sub_var2=@_[1];
$width1=@_[2];
$block_width=@_[3];
print DIR " x$sub_var \+ $block_width \<\= x$sub_var2 \+
$width1\( x$sub_var$sub_var2 \+ y$sub_var$sub_var2 \) \n";
sub
ytop {
#
body.
..
$sub_var =@_[0];
$sub_var2=@_[1];
$width1=@_[2];
$block_height=@
_[3]; # body...
print DIR " y$sub_var \+ $block_height \<\= y$sub_var2 \+
$width1\(1\- x$sub_var$sub_var2 \+ y$sub_var$sub_var2 \)
\n";
}
sub
xright {
#
body...
$sub_var =@_[0];
$sub_var2=@_[1];
$width1=@_[2];
$block_width=@_
[3]; # body...
print DIR " x$sub_var \- $block_width \>\= x$sub_var2 \-
$width1\(1 \- x$sub_var$sub_var2 \+ y$sub_var$sub_var2 \)
\n";
sub
ydown {
#
body...
$sub_var =@_[0];
$sub_var2=@_[1];
$width1=@_[2];
$block_height=@
_[3]; # body...
print DIR " y$sub_var \- $block_height \>\= y$sub_var2 \+
$width1\(2\- x$sub_var$sub_var2 \- y$sub_var$sub_var2 \) \n";
}
$initial_value=1;
$initial_value2=1;
while ($count >=
0) { # body...
for ( $i1 = 1; $i1 < $count;
$i1=$i1+1) { # body...
xleft($initial_value,($initial_value2+$i1),$width,$input_width[$in
itial
_value-1]);
xright($initial_value,($initial_value2+$i1),$width,$input_width[
$initi al_value2+$i1-1]);
ytop($initial_value,($initial_value2+$i1),$height,$input_height
[$initi al_value-1]);
ydown($initial_value,($initial_value2+$i1),$height,$input_heig
ht[$ini tial_value2+$i1-1]);
print DIR "\n\n";
}
$count=$count-1;
$initial_value=$initial_value+1;
$initial_value2=$initial_value2+1;
print "\n\n********************* $filename successfully create in
the current floder ****************************\n";
print "\n\n********************* ILP Equation are presented in
the above file-> $filename ****************************\n";
print "\n\n********************* THANK YOU !
****************************\n";
Result
ax1+ 1 <= x2 + 27( x12 + y12 ) x1 - 4 >= x2 - 27(1 - x12 + y12
) y1 + 2 <= y2 + 39(1- x12 + y12 ) y1 - 5 >= y2 + 39(2- x12 -
y12 )
x1 + 1 <= x3 + 27( x13 +
y13 ) x1 - 6 >= x3 - 27(1 -
x13 + y13 ) y1 + 2 <= y3 +
39(1- x13 + y13 ) y1 - 7 >=
y3 + 39(2- x13 - y13 )
x1 + 1 <= x4 + 27( x14 +
y14 ) x1 - 4 >= x4 - 27(1 -
x14 + y14 )
y1 + 2 <= y4 + 39(1- x14 +
y14 ) y1 - 6 >= y4 + 39(2-
x14 - y14 )
x1 + 1 <= x5 + 27( x15 +
y15 ) x1 - 8 >= x5 - 27(1 -
x15 + y15 ) y1 + 2 <= y5 +
39(1- x15 + y15 ) y1 - 9 >=
y5 + 39(2- x15 - y15 )
x1 + 1 <= x6 + 27( x16 +
y16 ) x1 - 4 >= x6 - 27(1 -
x16 + y16 ) y1 + 2 <= y6 +
39(1- x16 + y16 ) y1 - 10 >=
y6 + 39(2- x16 - y16 )
x2 + 4 <= x3 + 27( x23 +
y23 ) x2 - 6 >= x3 - 27(1 -
x23 + y23 ) y2 + 5 <= y3 +
39(1- x23 + y23 ) y2 - 7 >=
y3 + 39(2- x23 - y23 )
x2 + 4 <= x4 + 27( x24 +
y24 ) x2 - 4 >= x4 - 27(1 -
x24 + y24 )
y2 + 5 <= y4 + 39(1- x24 +
y24 ) y2 - 6 >= y4 + 39(2-
x24 - y24 )
x2 + 4 <= x5 + 27( x25 +
y25 ) x2 - 8 >= x5 - 27(1 -
x25 + y25 ) y2 + 5 <= y5 +
39(1- x25 + y25 ) y2 - 9 >=
y5 + 39(2- x25 - y25 )
x2 + 4 <= x6 + 27( x26 +
y26 ) x2 - 4 >= x6 - 27(1 -
x26 + y26 ) y2 + 5 <= y6 +
39(1- x26 + y26 ) y2 - 10 >=
y6 + 39(2- x26 - y26 )
x3 + 6 <= x4 + 27( x34 +
y34 ) x3 - 4 >= x4 - 27(1 -
x34 + y34 ) y3 + 7 <= y4 +
39(1- x34 + y34 ) y3 - 6 >=
y4 + 39(2- x34 - y34 )
x3 + 6 <= x5 + 27( x35 +
y35 ) x3 - 8 >= x5 - 27(1 -
x35 + y35 )
y3 + 7 <= y5 + 39(1- x35 +
y35 ) y3 - 9 >= y5 + 39(2-
x35 - y35 )
x3 + 6 <= x6 + 27( x36 +
y36 ) x3 - 4 >= x6 - 27(1 -
x36 + y36 ) y3 + 7 <= y6 +
39(1- x36 + y36 ) y3 - 10 >=
y6 + 39(2- x36 - y36 )
x4 + 4 <= x5 + 27( x45 +
y45 ) x4 - 8 >= x5 - 27(1 -
x45 + y45 ) y4 + 6 <= y5 +
39(1- x45 + y45 ) y4 - 9 >=
y5 + 39(2- x45 - y45 )
x4 + 4 <= x6 + 27( x46 +
y46 ) x4 - 4 >= x6 - 27(1 -
x46 + y46 ) y4 + 6 <= y6 +
39(1- x46 + y46 ) y4 - 10 >=
y6 + 39(2- x46 - y46 )
x5 + 8 <= x6 + 27( x56 +
y56 ) x5 - 4 >= x6 - 27(1 -
x56 + y56 )
y5 + 9 <= y6 + 39(1- x56 +
y56 ) y5 - 10 >= y6 + 39(2-
x56 - y56 )
Inference:
Implementation of ILP algorithm equation generator is successfully completed. ILP
Linear programming is a simple technique where we depict complex relationships
through linear functions and then find the optimum points.Integrated Linear
programming is used for obtaining the most optimal solution for a problem with
given constraints.Here we are converting blocks in mathematical equations which
will further help to reduce the complexity.The constraints specifying feasible floor
plan are described by a set of mathematical equations. For any 2 modules not to
overlap, it's enough if one of the constraints is satisfied.Verification of the same is
done using the generated code above.
Submitted By:
Aakanksha Sharma
20MVD0006