Algorithmadvanced
Linear programming fill synthesis
Also called Kahng-Robins-Singh-Zelikovsky fill, LP-based dummy fill.
Kahng, Robins, Singh and Zelikovsky's fill method that solves a linear program over fixed dissections to minimize the largest window density variation.
- Time
- O(m^2 r^2) build
- Space
- O(m^4) extra
- Where
- m = the number of tiles on a side; r = the number of tiles on a side of a window
- Model
- Word RAM
- Properties
- deterministicexactofflineiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Andrew B. Kahng, Gabriel Robins, Anish Singh, Alexander Zelikovsky, 1999
Linear programming fill synthesis solves the dummy fill problem on a fixed grid of tiles. Kahng, Robins, Singh and Zelikovsky observed that once the layout is cut into tiles and the windows are blocks of tiles, the density of a window is a sum of tile amounts, so the min-variation objective becomes a linear program with one fill variable per tile. The linear program gives the exact optimum for the tiled problem. A geometric lemma from their 1998 paper bounds how far the true sliding windows can then be from the tiled ones, which this page proves.
In plain words
The chip is cut into a grid of equal tiles, and a window is a square block of tiles. For each tile we know how much metal it already has and how much free space can take fill.
We choose how much fill to put in each tile. A window's metal is the sum over its tiles, so every rule is a sum: no window may go above the upper limit, and we want the emptiest window as full as possible.
Such a set of sums and limits is a linear program, and a standard solver finds the best amounts exactly. Then fill shapes are drawn in each tile to match its amount.
Windows that slide between grid lines are not checked, but their density can differ only by a known small amount, which shrinks as the tiles get finer.
The problem
Input. An grid of tiles of side , with the feature area and the slack , the area in where fill may go. An integer ; the windows are the blocks of tiles, of side and area . An upper density bound .
Assumption. Any amount of fill can be drawn in the slack of . This is the continuous model; it holds approximately when fill shapes are small against the tile.
Output. Fill amounts that maximize the minimum window density
or a report that no fill meets the upper bound.
The algorithm
Write and . The variable stands for the area of the emptiest window.
LP-DENSITY-FILL(a, s, r, U, w)- 1
if a(W) > U·w² for some window W then return infeasible - 2
variables: p_ij for every tile, and M - 3
objective: maximize M - 4
for every tile T_ij: p_ij ≤ s_ij - 5
for every window W: p(W) ≤ U·w² − a(W) - 6
for every window W: M − p(W) ≤ a(W) - 7
solve with the simplex method from the origin (all p_ij = 0, M = 0) - 8
return M / w², and the amounts p_ij
All variables are nonnegative. Line L1 makes every right-hand side nonnegative, so the origin is a feasible start and the simplex method needs no first phase. Line L6 says , so at the optimum equals the smallest window area. After line L8, fill shapes of total area are drawn in the slack of each tile, for example as a regular array of squares.
The implementation is a dense simplex method in exact rational arithmetic with Bland's rule, which prevents cycling. It also returns the dual solution, so the tests can check strong duality as a certificate of optimality without trusting the pivots.
Example
Take a grid of unit tiles, windows of tiles (, , ) and . Rows are listed from the top:
| feature area | slack | |
|---|---|---|
| row 0 | 0.6, 0.2, 0.1 | 0.1, 0.4, 0.5 |
| row 1 | 0.5, 0.3, 0.0 | 0.2, 0.3, 0.6 |
| row 2 | 0.4, 0.1, 0.0 | 0.3, 0.5, 0.2 |
There are four windows. Name them by their top-left tile: , , and . Their feature areas are , , and , densities , , and . The upper bound allows each window an area of .
The solver returns . One optimal fill, row by row, is , , , which gives window densities , , and .
Why not ? Window has feature area and needs fill from tiles , , and . Tiles and give at most , so . But tiles and also lie in , which has room for only more, so . Hence and . This chain of inequalities is a dual solution of the linear program, and it is what the dual certificate in the tests checks in general.
With line L1 reports infeasible, since already has density .
Correctness
The full proof shows the following.
The linear program is the tiled problem. Every feasible fill gives a feasible point with the smallest window area, and every feasible point gives a feasible fill whose smallest window area is at least . So the optimum of the linear program, divided by , is the best minimum density on the fixed dissection, and the optimal is an optimal fill. The program is feasible after line L1 and bounded, so the simplex method returns an optimum.
Fixed windows against floating windows. If every window of the fixed -dissection has density in , then every window, at any position, has density in with
The proof moves a floating window to the nearest fixed window, which is at most away in each coordinate, and bounds the area they do not share. This is Theorem 8 of Kahng et al. (1998). A square of features placed at offset shows the bound is attained.
What the fill achieves for floating windows. The fixed problem is a relaxation of the floating one, so its optimum is at least the best floating minimum. With the LP fill, every floating window has density at least and at most . So the LP fill is within of the floating optimum, and it exceeds the floating upper bound by at most .
What is not proved here. The correctness and termination of the simplex method with Bland's rule are cited from the simplex method page; the tests confirm each returned optimum with a dual certificate. The claim that the slack can be filled by any amount is a modeling assumption, not a theorem.
Proof: The fixed-dissection linear program gives min-variation fill, and fixed windows bound floating windowsfull
Setting. The layout is with features , a finite union of rectangles. A tile side divides , so is cut into an grid of tiles with . For an integer with , let . A fixed window is a block of tiles; a floating window is any square . Tile has feature area and slack . For a fill amount and a fixed window , write , , and .
Continuous model. A fill is a choice of for every tile, and its fill shapes in have total area and lie in . The fixed problem is: maximize over fills with , the minimum and maximum over fixed windows.
Lemma 1 (density of a fixed window). For any fill, the density of a fixed window is .
Proof. is the union of its tiles, which meet only on their boundaries, of area zero. Fill shapes in a tile lie in that tile and do not overlap features, since they lie in the slack. So the area of features and fill in is .
Theorem 1 (the linear program is the fixed problem). Consider the program of lines L3 to L6: variables and , maximize subject to , and for every fixed window . If for every , the program has an optimal solution , the optimum of the fixed problem is , and is an optimal fill. If for some , the fixed problem has no feasible fill.
Proof. Infeasible case: every fill has , so .
Feasible case. Feasibility. The origin , satisfies all constraints, since the right-hand sides , and are all nonnegative. Boundedness. For any window , . A feasible bounded linear program has an optimal solution, by the fundamental theorem of linear programming.
From fills to program points. Let be a fill feasible for the fixed problem and let . Then , by Lemma 1, and for every , with . So is feasible with objective . Hence the program optimum is at least times the fixed optimum.
From program points to fills. Let be feasible. Then is a fill with for all , and for all gives . So the fixed optimum is at least , and attains it.
Lemma 2 (overlap of shifted squares). Let and with and , where . Then .
Proof. is the rectangle of sides and , both at least . So , and both differences have area .
Theorem 2 (floating windows, Kahng et al. 1998, Theorem 8). Let be any measurable set (features and fill together), and suppose every fixed window has . Then every floating window has
Proof. Let , so . Let be a multiple of nearest to , and likewise. Since and are multiples of , the rounding stays in , so is a fixed window, and . By Lemma 2 with ,
Then , and . Divide by .
Proposition 3 (the bounds are attained). Suppose . Let . The floating window has density , and every fixed window has density at most . For the complement , the window has density and every fixed window has density at least .
Proof. A fixed window meets in a rectangle whose sides are and (or zero). Since is an integer, , so each side is at most , and the density is at most . For the bound holds with equality. For the complement, the density of each fixed window is minus its density for , so it is at least .
So with the upper bound of Theorem 2 is reached, and with the lower bound is. Kahng et al. state that the bounds are tight; this proposition shows it for one value of and one of for every .
Corollary 4 (quality of the LP fill for floating windows). Let be the program optimum and the LP fill. Let be the largest minimum floating-window density over fills with every floating-window density at most . Then with every floating window has density in , and .
Proof. With , every fixed window has density in by Theorem 1, and Theorem 2 gives the first claim. Fixed windows are floating windows, so a fill that meets on all floating windows meets it on all fixed windows, and its minimum over fixed windows is at least its minimum over floating windows. So it is feasible for the fixed problem with value at least its floating value, and Theorem 1 gives .
So the LP fill reaches a floating minimum within of the floating optimum, and exceeds the floating bound by at most . Running the program with in place of removes the excess, at the cost of a lower optimum.
About the solver. Line L7 uses the simplex method with Bland's rule, which terminates with an optimal basic solution on a feasible bounded program (Bland, 1977); this is cited, not proved here. The implementation also returns the dual vector from the final tableau. For any with and with , weak duality gives , so equality proves that is optimal. The tests check exactly these conditions in exact arithmetic, so each tested optimum is certified independently of the pivoting.
Complexity
The program has variables and constraints. Each window constraint has nonzero entries, so building it costs . A dense tableau has entries.
The time to solve depends on the solver. The simplex method takes few pivots in practice but an exponential number on some inputs. Interior point methods such as Karmarkar's algorithm solve it in time polynomial in its size and the bit length of the data. On the test instances, with up to , the exact solver takes well under a second.
The size grows with for a fixed window: halving needs about twice the and four times the variables. For large layouts this growth is the reason for the Monte Carlo, greedy and hierarchical methods below, which Kahng and Samadi survey; they note that the Monte Carlo and greedy methods can end with a minimum density well below the optimum.
Properties
- Exact for the tiled problem. With rational data the implementation returns the exact optimum and an optimal dual, so the result is certified.
- Not unique. Many fills reach the optimum. In the example, any fill within the slacks that keeps every window area between and is optimal.
- Ignores coupling. The objective sees only density. Where fill goes inside a tile, and how it couples to signal wires, is left to the placement step.
- Error from the grid. Densities of floating windows can differ from the fixed ones by up to , which is , , and for , , and .
Variants and improvements
- Min-Fill. Minimize subject to for every window. Kahng and Samadi credit this linear program to Tian et al.
- Variation budget. Given a target density, minimize a budget such that every window lies within of the target, again a linear program (Tian et al., as surveyed by Kahng and Samadi).
- Integer fill. When fill comes in fixed squares, the amounts are integers and the problem is an integer program. Rounding the LP amounts down keeps every upper bound and loses less than one square per tile, so less than squares per window.
- Monte Carlo and greedy. Chen, Kahng, Robins and Zelikovsky (ASP-DAC 2000) add fill one unit at a time to a tile chosen at random with priority proportional to minus the smallest density of the windows that contain it, or to the tile of highest priority. These scale far better and give no optimality guarantee.
- Model-based. Replace window density by an effective density, a weighted sum over nearby tiles. The constraints stay linear, so the method still applies.
When to use it
Use it when the grid is small enough for an LP solver, for example inside one block or as the exact core of a hierarchical method, and the density rule is the target. Use Monte Carlo or greedy fill for full chips, and a performance-aware method when the added coupling capacitance on critical nets matters.
Pitfalls
- Coarse grid. With the fixed windows can all meet the rule while a sliding window has density higher. Choose so that is below the tolerance, or tighten by .
- Slack is not free area. The slack must exclude the buffer around signal wires and the space lost to fill design rules, or the amounts cannot be drawn.
- Windows at the edge. The grid must cover the layout so that every window lies inside; partial windows at the edge need their own rule.
- Infeasible inputs. If a window already exceeds , no fill helps; the layout must change or wide wires must be slotted.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/lp-density-fill/. The authors are listed in prov/6QQEE4.jsonl.
"""Min-variation dummy fill on a fixed r-dissection, solved exactly as a linear program.
The layout is cut into an m by m grid of tiles. area[i][j] is the feature area in tile
(i, j) and slack[i][j] is the area in which fill may go. A window is an r by r block of
tiles, of area w2. The linear program is
maximize M
subject to 0 <= p[i][j] <= slack[i][j] for every tile,
sum over W of p <= U * w2 - area(W) for every window W,
M - sum over W of p <= area(W) for every window W.
It is solved by a dense simplex method in exact rational arithmetic with Bland's rule.
All inputs may be ints or Fractions; outputs are Fractions.
"""
from fractions import Fraction
def windows(m, r):
"""The top-left tiles of all r by r blocks of an m by m grid."""
return [(i, j) for i in range(m - r + 1) for j in range(m - r + 1)]
def window_tiles(i0, j0, r):
return [(i, j) for i in range(i0, i0 + r) for j in range(j0, j0 + r)]
def simplex_max(c, A, b):
"""Maximize c.x subject to A x <= b and x >= 0, where every b_i >= 0.
The origin is feasible, so the slack basis starts the method. Bland's rule
(smallest index enters, smallest basic index leaves among ties) prevents cycling.
Returns (value, x, y) where y is an optimal dual solution, or None if unbounded.
"""
n, k = len(c), len(A)
width = n + k + 1
rows = []
for i in range(k):
row = [Fraction(v) for v in A[i]] + [Fraction(0)] * k + [Fraction(b[i])]
row[n + i] = Fraction(1)
rows.append(row)
obj = [-Fraction(v) for v in c] + [Fraction(0)] * (k + 1)
basis = [n + i for i in range(k)]
while True:
enter = next((j for j in range(n + k) if obj[j] < 0), None)
if enter is None:
break
leave, best = None, None
for i in range(k):
a = rows[i][enter]
if a > 0:
ratio = rows[i][-1] / a
if best is None or ratio < best or (ratio == best and basis[i] < basis[leave]):
leave, best = i, ratio
if leave is None:
return None
piv = rows[leave]
a = piv[enter]
piv = [v / a for v in piv]
rows[leave] = piv
nz = [j for j in range(width) if piv[j] != 0]
for i in range(k):
if i != leave and rows[i][enter] != 0:
f = rows[i][enter]
row = rows[i]
for j in nz:
row[j] -= f * piv[j]
f = obj[enter]
for j in nz:
obj[j] -= f * piv[j]
basis[leave] = enter
x = [Fraction(0)] * n
for i, v in enumerate(basis):
if v < n:
x[v] = rows[i][-1]
y = [obj[n + i] for i in range(k)]
return obj[-1], x, y
def build_lp(area, slack, r, U, w2):
"""The constraint matrix of the Min-Var program; variables are the tiles row by row, then M."""
m = len(area)
n = m * m + 1
A, b = [], []
for i in range(m):
for j in range(m):
row = [0] * n
row[i * m + j] = 1
A.append(row)
b.append(Fraction(slack[i][j])) # @line L4
wins = windows(m, r)
for i0, j0 in wins:
tiles = window_tiles(i0, j0, r)
feat = sum(Fraction(area[i][j]) for i, j in tiles)
row = [0] * n
for i, j in tiles:
row[i * m + j] = 1
A.append(row)
b.append(Fraction(U) * w2 - feat) # @line L5
for i0, j0 in wins:
tiles = window_tiles(i0, j0, r)
feat = sum(Fraction(area[i][j]) for i, j in tiles)
row = [0] * n
for i, j in tiles:
row[i * m + j] = -1
row[-1] = 1
A.append(row)
b.append(feat) # @line L6
c = [0] * (n - 1) + [1] # @line L3
return c, A, b
def lp_density_fill(area, slack, r, U, w2):
"""Optimal min-variation fill on the fixed r-dissection.
Returns (density, p) where density is the largest possible minimum window
density and p[i][j] the fill area of each tile, or None if some window already
has feature density above U.
"""
m = len(area)
for i0, j0 in windows(m, r):
if sum(Fraction(area[i][j]) for i, j in window_tiles(i0, j0, r)) > Fraction(U) * w2: # @line L1
return None
c, A, b = build_lp(area, slack, r, U, w2) # @line L2
value, x, _ = simplex_max(c, A, b) # @line L7
p = [[x[i * m + j] for j in range(m)] for i in range(m)]
return value / Fraction(w2), p # @line L8
def window_densities(area, p, r, w2):
"""The density of every fixed window under fill p."""
m = len(area)
return [sum(Fraction(area[i][j]) + p[i][j] for i, j in window_tiles(i0, j0, r)) / Fraction(w2) for i0, j0 in windows(m, r)]
def floating_error(r):
"""The largest density difference between a floating window and every fixed window (Theorem 8)."""
return Fraction(1, r) - Fraction(1, 4 * r * r)
test_lp_density_fill.py 216 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/lp-density-fill/. The authors are listed in prov/6QQEE4.jsonl.
import itertools
import random
from fractions import Fraction
from lp_density_fill import (
build_lp,
floating_error,
lp_density_fill,
simplex_max,
window_densities,
window_tiles,
windows,
)
def random_instance(rng, m, tile_area, denom):
"""Feature area and slack per tile, with area + slack <= tile area."""
area, slack = [], []
for i in range(m):
ra, rs = [], []
for j in range(m):
a = Fraction(rng.randint(0, denom), denom) * tile_area
s = Fraction(rng.randint(0, denom), denom) * (tile_area - a)
ra.append(a)
rs.append(s)
area.append(ra)
slack.append(rs)
return area, slack
def solve_linear(M, v):
"""Solve M x = v exactly; None if M is singular."""
n = len(M)
a = [list(map(Fraction, row)) + [Fraction(v[i])] for i, row in enumerate(M)]
for col in range(n):
piv = next((i for i in range(col, n) if a[i][col] != 0), None)
if piv is None:
return None
a[col], a[piv] = a[piv], a[col]
for i in range(n):
if i != col and a[i][col] != 0:
f = a[i][col] / a[col][col]
a[i] = [x - f * y for x, y in zip(a[i], a[col])]
return [a[i][n] / a[i][i] for i in range(n)]
def vertex_enumeration(c, A, b):
"""Maximum of c.x over {A x <= b, x >= 0} by trying every basis of tight constraints."""
n = len(c)
rows = [(list(A[i]), Fraction(b[i])) for i in range(len(A))]
rows += [([-1 if k == j else 0 for k in range(n)], Fraction(0)) for j in range(n)]
best = None
for subset in itertools.combinations(range(len(rows)), n):
x = solve_linear([rows[i][0] for i in subset], [rows[i][1] for i in subset])
if x is None:
continue
if all(sum(g * xi for g, xi in zip(row, x)) <= h for row, h in rows):
val = sum(ci * xi for ci, xi in zip(c, x))
if best is None or val > best:
best = val
return best
def feasible(area, slack, p, r, U, w2):
m = len(area)
if any(not (0 <= p[i][j] <= slack[i][j]) for i in range(m) for j in range(m)):
return False
return max(window_densities(area, p, r, w2)) <= U
def test_one_tile_windows_closed_form():
# With r = 1 every tile is a window, so each tile is filled as far as its slack and U allow.
rng = random.Random(1)
for trial in range(20):
area, slack = random_instance(rng, 4, 9, 9)
U = Fraction(rng.randint(5, 9), 9)
if trial % 4:
U = max(U, max(a for row in area for a in row) / 9)
if any(a > 9 * U for row in area for a in row):
assert lp_density_fill(area, slack, 1, U, 9) is None
continue
d, p = lp_density_fill(area, slack, 1, U, 9)
expected = min(a + min(s, 9 * U - a) for ra, rs in zip(area, slack) for a, s in zip(ra, rs)) / 9
assert d == expected
assert feasible(area, slack, p, 1, U, 9)
assert min(window_densities(area, p, 1, 9)) == d
def test_matches_vertex_enumeration():
rng = random.Random(2)
for trial in range(12):
r = 1 + trial % 2
area, slack = random_instance(rng, 2, 4, 8)
U = Fraction(rng.randint(4, 8), 8)
if lp_density_fill(area, slack, r, U, 4 * r * r) is None:
continue
c, A, b = build_lp(area, slack, r, U, 4 * r * r)
value, x, _ = simplex_max(c, A, b)
assert value == vertex_enumeration(c, A, b)
def test_dual_certificate_on_larger_grids():
# A feasible x, a feasible dual y and equal objective values prove optimality,
# independent of the pivoting that produced them.
rng = random.Random(3)
for m, r in [(5, 2), (5, 3), (6, 2)]:
area, slack = random_instance(rng, m, 1, 10)
U = Fraction(3, 4)
w2 = r * r
if lp_density_fill(area, slack, r, U, w2) is None:
U = Fraction(1)
c, A, b = build_lp(area, slack, r, U, w2)
value, x, y = simplex_max(c, A, b)
assert all(v >= 0 for v in x) and all(v >= 0 for v in y)
for row, bi in zip(A, b):
assert sum(a * v for a, v in zip(row, x)) <= bi
for j in range(len(c)):
assert sum(A[i][j] * y[i] for i in range(len(A))) >= c[j]
assert sum(bi * yi for bi, yi in zip(b, y)) == value == sum(ci * xi for ci, xi in zip(c, x))
d, p = lp_density_fill(area, slack, r, U, w2)
assert feasible(area, slack, p, r, U, w2)
assert min(window_densities(area, p, r, w2)) == d
def test_integer_fills_bracket_the_lp():
# Brute force over integer fill amounts. The integer optimum is at most the LP
# optimum, and rounding the LP fill down loses less than one unit per tile.
rng = random.Random(4)
for trial in range(6):
m, r = 3, 2
area = [[rng.randint(0, 3) for _ in range(m)] for _ in range(m)]
slack = [[rng.randint(0, min(2, 4 - area[i][j])) for j in range(m)] for i in range(m)]
U = Fraction(rng.randint(10, 14), 16)
w2 = 16
res = lp_density_fill(area, slack, r, U, w2)
if res is None:
continue
d, p = res
best = None
for fill in itertools.product(*[range(slack[i][j] + 1) for i in range(m) for j in range(m)]):
q = [[Fraction(fill[i * m + j]) for j in range(m)] for i in range(m)]
dens = window_densities(area, q, r, w2)
if max(dens) <= U and (best is None or min(dens) > best):
best = min(dens)
assert best <= d
assert d - best < Fraction(r * r, w2)
down = [[Fraction(int(v)) for v in row] for row in p]
assert feasible(area, slack, down, r, U, w2)
def overlap(cell, x, y, w):
cx, cy, h = cell
dx = min(cx + h, x + w) - max(cx, x)
dy = min(cy + h, y + w) - max(cy, y)
return dx * dy if dx > 0 and dy > 0 else 0
def density(cells, x, y, w):
return sum(overlap(c, x, y, w) for c in cells) / Fraction(w * w)
def test_floating_windows_within_fixed_bound():
rng = random.Random(5)
n, w = 8, 4
h = Fraction(1, 2)
for r in [1, 2, 4]:
t = Fraction(w, r)
cells = [(i * h, j * h, h) for i in range(16) for j in range(16) if rng.random() < 0.3]
grid = [k * t for k in range(int((n - w) / t) + 1)]
fixed = [density(cells, x, y, w) for x in grid for y in grid]
lo, hi = min(fixed), max(fixed)
e = floating_error(r)
offsets = [Fraction(k, 4) for k in range(0, 17, 2)] + [Fraction(rng.randint(0, 400), 100) for _ in range(5)]
for x in offsets:
for y in offsets:
d = density(cells, x, y, w)
assert lo - e <= d <= hi + e
def test_floating_bound_is_attained():
# Features fill the window at offset (t/2, t/2): every fixed window has density at
# most (1 - 1/(2r))^2, while that floating window has density 1. The complement
# layout attains the lower bound.
for r in [1, 2, 3, 4]:
w = 2 * r
t = Fraction(w, r)
n = 2 * w
square = [(t / 2 + i, t / 2 + j, 1) for i in range(w) for j in range(w)]
grid = [k * t for k in range(int((n - w) / t) + 1)]
fixed = [density(square, x, y, w) for x in grid for y in grid]
assert max(fixed) + floating_error(r) == 1 == density(square, t / 2, t / 2, w)
half = [(i * Fraction(1, 2), j * Fraction(1, 2), Fraction(1, 2)) for i in range(2 * n) for j in range(2 * n)]
hole = [c for c in half if overlap(c, t / 2, t / 2, w) == 0]
fixed = [density(hole, x, y, w) for x in grid for y in grid]
assert min(fixed) - floating_error(r) == 0 == density(hole, t / 2, t / 2, w)
def test_page_example():
area = [[Fraction(k, 10) for k in row] for row in [[6, 2, 1], [5, 3, 0], [4, 1, 0]]]
slack = [[Fraction(k, 10) for k in row] for row in [[1, 4, 5], [2, 3, 6], [3, 5, 2]]]
assert window_densities(area, [[0] * 3] * 3, 2, 4) == [Fraction(2, 5), Fraction(3, 20), Fraction(13, 40), Fraction(1, 10)]
d, p = lp_density_fill(area, slack, 2, Fraction(1, 2), 4)
assert d == Fraction(19, 40)
assert feasible(area, slack, p, 2, Fraction(1, 2), 4)
mine = [[Fraction(k, 10) for k in row] for row in [[0, 1, 3], [0, 3, 6], [0, 4, 2]]]
assert window_densities(area, mine, 2, 4) == [Fraction(1, 2), Fraction(19, 40), Fraction(1, 2), Fraction(19, 40)]
assert lp_density_fill(area, slack, 2, Fraction(3, 10), 4) is None
def test_window_helpers():
assert windows(3, 2) == [(0, 0), (0, 1), (1, 0), (1, 1)]
assert window_tiles(1, 0, 2) == [(1, 0), (1, 1), (2, 0), (2, 1)]
assert floating_error(1) == Fraction(3, 4)
History
Kahng, Robins, Singh, Wang and Zelikovsky stated the Filling and Slotting Problem in 1998 and proved the bound on the error of fixed dissections. In 1999 Kahng, Robins, Singh and Zelikovsky gave the min-variation linear program on a fixed dissection. Chen, Kahng, Robins and Zelikovsky followed with Monte Carlo, iterated and hierarchical methods from 2000 to scale to full chips, and Tian et al. gave min-fill and model-based linear programs.
References
- Andrew B. Kahng, Gabriel Robins, Anish Singh and Alexander Zelikovsky, Filling algorithms and analyses for layout density control, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 18(4), 445 to 462, April 1999, the filling problem for a fixed r-dissection, with a fill variable per tile bounded by the tile slack and the linear program that maximizes the minimum window density under the upper bound U
- Andrew B. Kahng, Gabriel Robins, Anish Singh, Huijuan Wang and Alexander Zelikovsky, Filling and slotting, analysis and algorithms, Proceedings of the International Symposium on Physical Design (ISPD), 95 to 102, 1998, Theorem 8, the bounds L - 1/r + 1/(4r^2) and U + 1/r - 1/(4r^2) on the density of any window when all windows of the fixed r-dissection satisfy [L, U], and their tightness
- Andrew B. Kahng and Kambiz Samadi, CMP fill synthesis, a survey of recent studies, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 27(1), 3 to 19, January 2008, Section IV-B, part 1 on LP-based and Monte Carlo methods, which restates the min-variation LP, the min-fill LP of Tian et al., and the Monte Carlo and greedy fill of Chen, Kahng, Robins and Zelikovsky
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 6QQEE4 Edit this page History Report an error Markdown