Algorithmresearch
Shrunk-2D
Also called Shrunk-2D flow, pseudo-3D placement.
Panth, Samadi, Du and Lim's two-tier monolithic 3D flow that places and routes cells shrunk by 0.707 on a 2D die of half the area, then splits each bin between tiers.
- Solves
- 3D IC tier partitioning
- Time
- O(p) MIV countO(n + p) shrinkingO(P p + B) split with bucket-list FM
- Space
- O(n + p + B) total
- Where
- B = the number of placement bins; P = the number of FM passes; n = the number of cells; p = the number of pins
- Model
- Word RAM
- Properties
- deterministicnot exactiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Shreepad Panth, Kambiz Samadi, Yang Du, Sung Kyu Lim, 2014
Shrunk-2D is a design flow for two-tier gate-level monolithic 3D ICs, a part of 3D integration in EDA. In a monolithic 3D IC the tiers are a few micrometers apart and joined by monolithic inter-tier vias (MIVs) of about 100 nm, so the third dimension adds almost nothing to the wirelength. Shrunk-2D uses this. It scales every cell, the die and the metal pitch by , so that all cells fit on a 2D die of half the area, and runs a normal 2D tool for placement, optimization, clock tree and routing. Then it gives every cell back its size, splits the cells of each small region between the two tiers with a Fiduccia-Mattheyses min-cut that keeps each region balanced, and lets a router insert the MIVs. Panth, Samadi, Du and Lim (ISLPED 2014) used it on the OpenSPARC T2 core in 28 nm and report 15.57% less total power than a 2D design at the same frequency and total silicon area.
In plain words
Two tiers of the same size stacked on top of each other look, from above, like one die of half the area with twice as many cells per square. So you can pretend each cell is half as large, place and route everything on that small die with an ordinary 2D tool, and get wires that are as long as the wires of the real two-tier chip.
At the end you must decide which cells go up and which go down. You cut the small die into a grid of bins and, in each bin, put half the cell area on each tier, while keeping as few nets as possible split between tiers. Each split net gets a tiny vertical via. Since the bins are small, a cell does not move far, and the work of the 2D tool is kept.
The problem
Input. A gate-level netlist of standard cells and memory macros with fixed places for the memories, the target footprint of the 3D design (half the area of the 2D design), a technology with its cell library and metal stack, and a timing target.
Output. A two-tier layout: for each cell a tier and a place, the routes in each tier, and the MIVs that join the tiers. Each tier must fit the footprint, and the design must meet timing.
Goal. Less power than a 2D design at the same performance and the same total silicon area. The step that this page computes is a case of tier partitioning with a balance rule in every bin; the 2D steps are done by the 2D tool.
The algorithm
Let .
SHRUNK-2D(netlist, die, k, ε)- 1
scale the width, height and pin offsets of each cell, the die, and the metal width and pitch by s; keep the wire RC per unit length - 2
place, optimize, build the clock tree and route the shrunk design with the 2D tool - 3
give each cell back its original size at its place - 4
cut the die into k × k placement bins - 5
in each bin, put the cells on the tiers largest first, each to the tier with less area in that bin - 6
repeat - 7
FM pass: move the unlocked cell of best gain whose move keeps its bin balanced, and lock it, until no cell can move - 8
keep the prefix of the moves with the best total gain - 9
until a pass has no positive gain - 10
insert an MIV for each net with cells on both tiers - 11
return the tiers, the places, the routes and the MIVs
Shrinking (line L1). Each cell gets half its area. The die gets half its area, which is the footprint of each tier. The metal width and pitch shrink with the die, so the total track length is unchanged, which is also the track length of the two tiers together. The tool still uses the original RC per unit length, so the extracted parasitics are those of a 3D wire of the same length with the real metal geometry.
Memory (part of line L2). A memory macro cannot shrink, because the placer may not put cells over it. The flow splits it into its pins and its blockage. The memory footprint is shrunk to a filler cell while its pins keep their real places, so they still anchor the cells around them. The memories of both tiers are projected onto one plane. A region covered in both tiers becomes a full placement blockage. A region covered in one tier becomes a partial blockage with half the target density, because only the other tier has room there.
Balance in each bin (lines L5 to L9). Let be the original cell area in bin and its largest cell. A split is balanced if, in every bin, the areas of the two tiers differ by at most , which lets each tier be off half the bin area by the largest cell, as in the balance rule of Fiduccia and Mattheyses. The gain of a cell is the number of nets that its move would make uncut minus the number it would make cut. The only change from plain FM, as the paper says, is that balance is checked in each bin and not over the whole chip. Before the split, the paper moves memories to their tiers and moves cells over a partial blockage to the tier without the memory; the code has no memories.
MIVs and the rest (lines L10 and L11). The paper does not place MIVs itself. It doubles the metal stack in a technology file, gives each cell a version for each tier with its pins on that tier's metals, puts routing blockages in the via layer over cells, and lets the 2D router connect everything. The vias that the router uses between the two stacks are the MIVs. The router may give one net several MIVs, which the paper keeps. Then each tier is routed with its real design rules, and timing and power are signed off. The code puts one MIV per cut net at the center of the net's bounding box.
The implementation uses a stand-in for the 2D tool at line L2: a quadratic placement with the clique net model, solved by the Gauss-Seidel method, and then a spreading step that puts the cell of rank among at of the die side in each direction. It does no legalization into rows, no routing, no memory handling and no clock tree. FM scans all cells for the best move, where the original uses bucket lists.
Example
Shrinking. A cell of µm becomes µm, of area 1 µm². A die of µm becomes µm, the footprint of each tier. If the placer puts every cell at the same relative place, a net with a half-perimeter wirelength of 30 µm gets µm, which is 29.3% less.
Why the balance is per bin. Take eight cells of unit area. After placement, are in the left bin and in the right one. The nets are , and . Let , so in each bin the tiers may differ by at most , and each tier gets one to three of the four cells.
- With balance over the whole chip, the best split puts on tier 0 and on tier 1. Only is cut, so one MIV. But then the left half of tier 0 holds the cell area of the whole left bin of the shrunk die, twice the density that the 2D tool planned, and the left half of tier 1 is empty. The placement is lost.
- With balance per bin, each four-cell net must be split, since no bin may put all four cells on one tier. Line L5 gives and to tier 0 and and to tier 1, which cuts all three nets. FM then moves , which uncuts , so the result cuts 2 nets. Now the left bin has on tier 0 and on tier 1, a difference of 2, which the rule allows. An exhaustive search over all 256 splits confirms that 2 is the least cut that keeps both bins balanced. Each tier has 1 to 3 of the 4 cells of each bin, so its density stays close to what the 2D tool planned.
The test file checks this example.
Correctness
The full proof shows four things. First, if the placer commutes with scaling, which quadratic placement does because its equations are linear and which the code's rank spreading does too, then the shrunk placement is the 2D placement times , and every half-perimeter wirelength is times its 2D value: the 29.3% bound of the paper. Second, line L5 leaves every bin balanced, because adding a cell to the lighter tier never makes the difference larger than the largest cell. Third, every FM move keeps its bin balanced and each pass keeps a prefix of nonnegative total gain, so the cut never grows, and the loop ends because each repeated pass lowers the cut by at least one. Fourth, every cut net gets an MIV, so the two tiers implement the same netlist. The proof does not show that the cut is the least one; that problem is NP-hard (see tier partitioning).
Proof: Shrunk-2D scales the wirelength by 1/sqrt(2), and its split is balanced in every bin, never raises the cut, ends, and gives an MIV to every cut netfull
We use the notation of the page: , cells with areas , nets that are sets of cells and fixed pads, bins, and for a bin its cell area , its largest cell area , and the limit . A split is balanced if for every bin, where . The cut is the number of nets with cells on both tiers.
Lemma 1 (scaling). Call a placer scale-equivariant if, when every pad and the die side are multiplied by , every cell coordinate it returns is multiplied by . If the placer is scale-equivariant, then after line L1 every net has half-perimeter wirelength exactly times its value in the 2D placement, so the total is times the 2D total, a decrease of .
Proof. The half-perimeter wirelength of a net is over its pins. If every pin coordinate is multiplied by , each max and min is multiplied by , and so is the sum. Pads are scaled at line L1 and cell coordinates are scaled by the assumption. Summing over the nets gives the total.
Lemma 2 (the placer of the code is scale-equivariant). The quadratic placement with the clique model, solved by Gauss-Seidel from the die center, and the spreading by rank are both scale-equivariant.
Proof. The clique weights depend only on the net sizes, which do not change. A Gauss-Seidel step sets to a weighted mean of the current coordinates of its neighbors and of its pads, with fixed weights. If the start point and all pads are multiplied by , then by induction every iterate is too, because a weighted mean of values that are all multiplied by is multiplied by . The stop test compares the change with , and both sides scale by , so the same iterate is returned. (The same holds for the exact solution, since with the Laplacian fixed gives .) The rank spreading orders the cells by , which does not change, and puts rank at , which scales with .
In floating point, Lemma 2 holds up to rounding; the code rounds to nine digits before ranking, so the order is the same unless two cells are within of each other. The tests check the ratio to a relative error of .
Lemma 3 (the start is balanced). After line L5, for every bin.
Proof. Fix a bin. Its cells are added one at a time, each to the tier with less area. Before the first cell, . Suppose before a cell of area is added, and say , so the cell goes to tier 1 (if it goes to tier 0, the same case by symmetry). The new difference is , and , so . The order of the cells does not matter for this bound.
Lemma 4 (FM keeps balance). Every split that line L7 produces, and the split after line L8, is balanced.
Proof. Line L7 moves a cell of bin only if the new difference, , has absolute value at most ; the differences of the other bins do not change. So every split in the sequence of moves of a pass is balanced if the first one is. Line L8 keeps a prefix of the moves, so its split is one of the splits in the sequence. By Lemma 3 the first pass starts balanced, and each later pass starts from the split of the last one.
Lemma 5 (gain). The gain of a cell on tier , , counted over nets with at least two cells, is the decrease of the cut when moves.
Proof. Moving changes only the nets that contain it. A net in which is the only cell on its tier, and which has cells on the other tier, becomes uncut; if it has no cell on the other tier, it has only one cell, which the count excludes. A net with no cell on the other tier is uncut and becomes cut, since it has another cell left on tier . Every other net stays cut. The code updates the counts of each net after every move, so it uses the gain of the current split.
Lemma 6 (the cut never rises, and the loop ends). The cut after each pass is at most the cut before it, and the loop ends after at most passes.
Proof. By Lemma 5, the cut after the first moves of a pass is the cut at its start minus the sum of the first gains. Line L8 keeps the prefix with the largest sum, and the empty prefix has sum 0, so the kept sum is at least 0 and the cut does not rise. If , the loop stops at line L9. Otherwise , because gains are integers, and the cut falls by at least 1. The cut is a nonnegative integer, so at most passes have . Each pass is finite, because each move locks a cell.
Theorem 7. Line L11 returns a split that is balanced in every bin, whose cut is at most that of line L5, with one MIV for each cut net, and the two tiers together with the MIVs connect exactly the nets of the input.
Proof. Balance is Lemma 4, the cut and termination are Lemma 6. Line L10 adds an MIV for every net with cells on both tiers, so each such net is joined across the tiers; a net with all cells on one tier is routed in that tier. No cell or net is added or removed by the split, so the netlist is the same.
What is not proved. The cut is not shown to be the least balanced cut; bisection with a balance rule is NP-hard (see the reduction on tier partitioning), and the tests measure the gap on small cases. Lemma 1 is about the ideal placer; a real 2D tool legalizes and optimizes timing and is not scale-equivariant, which is why Panth et al. measure 27.05% and not 29.3%. The power results are measurements of the paper.
Complexity
Shrinking takes for cells and pins. With bucket lists, an FM pass takes time, so the split takes for passes and bins; the number of passes is small in practice, and at most the number of nets, since each pass but the last lowers the cut. Counting the MIVs takes . The 2D place and route is the cost of the 2D tool, and it dominates. The code is slower than this bound, because it scans all cells for each move ( moves and gains per pass, times the net sizes) and runs Gauss-Seidel to a fixed tolerance; for the small tests this does not matter.
Properties
What is proved. With a placer that commutes with scaling, the shrunk wirelength is exactly times the 2D wirelength. The split is balanced in every bin, its cut is at most the cut of line L5, the loop ends, and each cut net has an MIV. These hold for any netlist and any number of bins.
What is cited. Panth et al. (2014, Section 4) report, for OpenSPARC T2 in a 28 nm technology at 1 GHz with timing closed: the shrunk 2D design has 27.05% less wirelength than the 2D design, close to the 29.3% bound (Table 3). The monolithic 3D design has 20.40% less wirelength, 22.33% fewer buffers, 8.03% fewer gates and 15.57% less total power, with zero total silicon area overhead; the face-to-face version has 15.27% less power. With dual-Vt libraries the reduction is 16.08% (Table 4); the abstract rounds the result to 16%. Keeping several MIVs per net instead of one cuts the wirelength of the monolithic design by 8.43%, from 15.61 m to 14.29 m, and its total power by 2.25% (Table 1). The leaf-level clock tree, with the clock backbone on tier 0, uses 29.82% less clock power than one clock tree per tier (Table 2).
What is measured. The tests compare the cut of the split with an exhaustive search over all balanced splits, on 200 random designs of 6 to 10 cells in bins (seed 0). The split reaches the least cut on 180 of them and is at most 3 nets worse on the others. On 300 random splits of 4 to 40 cells (seed 1), FM keeps every bin balanced and never cuts more nets than line L5. These are toy designs; they test the code, not the power results of the paper.
Variants and improvements
- Multiple MIVs per net. The paper keeps all MIVs that the router inserts, which shortens the wires. A flow that optimizes timing tier by tier needs one MIV per net, because each MIV becomes an I/O port of a tier with its own timing constraint.
- Leaf-level 3D clock tree. The paper builds the clock tree in the shrunk design, fixes the clock buffers and clock gates on tier 0, and lets only the flip-flops move between tiers, so MIVs follow the leaf buffers. The usual way builds one clock tree per tier and joins them with an MIV near the clock source.
- Face-to-face stacking. The same flow works for two dies bonded face to face. The metal stack of the upper die is put in reverse order in the technology file, and the bond vias may go over cells, because they use only the top metal.
- Partitioning for timing or heat. Other flows split with a cost for critical paths, or put cells of high power next to the heat sink, as in thermal-driven 3D floorplanning at the block level.
When to use it
Use Shrunk-2D when the vertical links are small enough to be used on most nets, which is monolithic 3D or fine-pitch face-to-face bonding, and when you want to reuse a 2D tool and its timing optimization. It does not suit TSV-based stacks: each TSV is large and needs a keep-out zone, so splitting at the gate level would need far more TSVs than the area allows, and partitioning is done at the block level there.
Pitfalls
- The 29.3% is a bound for an ideal placer. Real placers legalize into rows and optimize timing, so the wirelength does not scale exactly. The paper measures 27.05% for the shrunk design and 20.40% for the final monolithic design, after the split and MIV insertion.
- Global balance. Balance over the whole chip lets FM put whole regions on one tier, which doubles the density there and breaks the placement. The balance must be checked in each bin.
- Parasitics. If the RC per unit length were scaled with the metal width, the extracted RC would be that of the thinner shrunk wires, not of the real ones. The flow keeps the original values on purpose.
- Memory macros. Shrinking a memory would let cells overlap it in the tier where it sits. The flow needs the pin and blockage split described above.
- Timing in each tier. After the split, each tier is routed again with real rules, and the paper derives timing constraints for each tier from a top-level analysis. Without this step, the sign-off timing of the tiers does not match the shrunk design.
- Tool flags. MIVs must not go over cells, which the flow ensures with routing blockages in the via layer; face-to-face vias may.
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/shrunk-2d/. The authors are listed in prov/BTYXM7.jsonl.
"""Shrunk-2D: a two-tier gate-level 3D flow built on a 2D placer.
A design has n cells with widths w[i] and heights h[i], a square die of
side W, and nets. A net is a pair (cells, pads): a list of cell indices and
a list of fixed pad points (x, y) on the die.
The flow scales every cell, pad and the die by s = 1/sqrt(2), places the
shrunk design with a 2D placer, gives each cell back its original size,
cuts the die into k x k bins, and splits the cells of every bin between
tier 0 and tier 1 with a Fiduccia-Mattheyses pass that keeps the area of
the two tiers balanced inside each bin. Every cut net gets one inter-tier
via (MIV) at the center of its bounding box.
The placer here is a small stand-in for the commercial tool of the paper:
a quadratic placement with the clique net model, solved by Gauss-Seidel,
followed by spreading by rank. Both steps commute with scaling, which is
the property that the flow uses. There is no legalization into rows, no
routing, no memory handling and no clock tree.
"""
import math
SCALE = 1.0 / math.sqrt(2.0)
def shrink(widths, heights, nets, die, s=SCALE):
"""Scale cell sizes, pads and die by s (the metal pitch would scale too)."""
w = [x * s for x in widths]
h = [y * s for y in heights]
new_nets = [(list(cs), [(px * s, py * s) for px, py in pads]) for cs, pads in nets]
return w, h, new_nets, die * s
def quadratic_place(n, nets, die, tol=1e-13, max_iter=20000):
"""Clique-model quadratic placement, then spread by rank over the die."""
nbr = [dict() for _ in range(n)]
anchor = [[0.0, 0.0, 0.0] for _ in range(n)] # weight, sum wx, sum wy
for cells, pads in nets:
p = len(cells) + len(pads)
if p < 2:
continue
wt = 1.0 / (p - 1)
for a in cells:
for b in cells:
if a != b:
nbr[a][b] = nbr[a].get(b, 0.0) + wt
for px, py in pads:
anchor[a][0] += wt
anchor[a][1] += wt * px
anchor[a][2] += wt * py
x = [die / 2.0] * n
y = [die / 2.0] * n
for _ in range(max_iter):
delta = 0.0
for i in range(n):
tw = anchor[i][0] + sum(nbr[i].values())
if tw == 0.0:
continue
nx = (anchor[i][1] + sum(wt * x[j] for j, wt in nbr[i].items())) / tw
ny = (anchor[i][2] + sum(wt * y[j] for j, wt in nbr[i].items())) / tw
delta = max(delta, abs(nx - x[i]), abs(ny - y[i]))
x[i], y[i] = nx, ny
if delta <= tol * die:
break
return spread_by_rank(x, die), spread_by_rank(y, die)
def spread_by_rank(coord, die):
"""Put the cell of rank r at (r + 0.5) / n of the die side."""
n = len(coord)
order = sorted(range(n), key=lambda i: (round(coord[i] / die, 9), i))
out = [0.0] * n
for r, i in enumerate(order):
out[i] = (r + 0.5) * die / n
return out
def hpwl(xs, ys, nets):
total = 0.0
for cells, pads in nets:
px = [xs[c] for c in cells] + [p[0] for p in pads]
py = [ys[c] for c in cells] + [p[1] for p in pads]
if len(px) >= 2:
total += max(px) - min(px) + max(py) - min(py)
return total
def make_bins(xs, ys, die, k):
size = die / k
return [min(int(x / size), k - 1) * k + min(int(y / size), k - 1) for x, y in zip(xs, ys)]
def bin_limits(areas, bins, eps):
"""Allowed |area(tier 0) - area(tier 1)| in each bin.
As in the balance rule of Fiduccia and Mattheyses, each tier may be off
half the bin area by the largest cell, so the limit on the difference is
twice the largest cell area, or eps times the bin area if that is more.
"""
total, biggest = {}, {}
for a, b in zip(areas, bins):
total[b] = total.get(b, 0.0) + a
biggest[b] = max(biggest.get(b, 0.0), a)
return {b: max(eps * total[b], 2.0 * biggest[b]) for b in total}
def initial_split(areas, bins):
"""In each bin, largest cell first, to the tier with less area."""
side = [0] * len(areas)
load = {}
for i in sorted(range(len(areas)), key=lambda i: (-areas[i], i)):
l0, l1 = load.get(bins[i], (0.0, 0.0))
if l0 <= l1:
side[i], l0 = 0, l0 + areas[i]
else:
side[i], l1 = 1, l1 + areas[i]
load[bins[i]] = (l0, l1)
return side
def bin_diffs(areas, bins, side):
diff = {}
for a, b, s in zip(areas, bins, side):
diff[b] = diff.get(b, 0.0) + (a if s == 0 else -a)
return diff
def cut_nets(nets, side):
return [e for e, (cells, _) in enumerate(nets) if len({side[c] for c in cells}) == 2]
def fm_split(areas, bins, nets, side, eps=0.1, max_passes=20):
"""Fiduccia-Mattheyses with the balance checked in each bin."""
n = len(areas)
side = list(side)
limit = bin_limits(areas, bins, eps)
cell_nets = [[] for _ in range(n)]
for e, (cells, _) in enumerate(nets):
for c in cells:
cell_nets[c].append(e)
for _ in range(max_passes):
count = [[0, 0] for _ in nets]
for e, (cells, _) in enumerate(nets):
for c in cells:
count[e][side[c]] += 1
diff = bin_diffs(areas, bins, side)
locked = [False] * n
moves, gains = [], []
def gain(v):
g, s = 0, side[v]
for e in cell_nets[v]:
if len(nets[e][0]) < 2:
continue
if count[e][s] == 1:
g += 1
if count[e][1 - s] == 0:
g -= 1
return g
while True:
best, best_g = -1, None
for v in range(n): # @line L7
if locked[v]:
continue
d = diff[bins[v]] + (-2 * areas[v] if side[v] == 0 else 2 * areas[v])
if abs(d) > limit[bins[v]] + 1e-12:
continue
g = gain(v)
if best_g is None or g > best_g:
best, best_g = v, g
if best < 0:
break
v = best
s = side[v]
for e in cell_nets[v]:
count[e][s] -= 1
count[e][1 - s] += 1
diff[bins[v]] += -2 * areas[v] if s == 0 else 2 * areas[v]
side[v] = 1 - s
locked[v] = True
moves.append(v)
gains.append(best_g)
run, best_sum, best_k = 0, 0, 0
for k, g in enumerate(gains): # @line L8
run += g
if run > best_sum:
best_sum, best_k = run, k + 1
for v in moves[best_k:]:
side[v] = 1 - side[v]
if best_sum <= 0: # @line L9
break
return side
def shrunk_2d(widths, heights, nets, die, k=2, eps=0.1):
n = len(widths)
sw, sh, snets, sdie = shrink(widths, heights, nets, die) # @line L1
xs, ys = quadratic_place(n, snets, sdie) # @line L2
areas = [w * h for w, h in zip(widths, heights)] # @line L3
bins = make_bins(xs, ys, sdie, k) # @line L4
side = initial_split(areas, bins) # @line L5
side = fm_split(areas, bins, snets, side, eps) # @line L6
mivs = []
for e in cut_nets(snets, side): # @line L10
cells, pads = snets[e]
px = [xs[c] for c in cells] + [p[0] for p in pads]
py = [ys[c] for c in cells] + [p[1] for p in pads]
mivs.append((e, (max(px) + min(px)) / 2.0, (max(py) + min(py)) / 2.0))
return {"x": xs, "y": ys, "die": sdie, "bins": bins, "side": side, "mivs": mivs, # @line L11
"hpwl": hpwl(xs, ys, snets)}
test_shrunk_2d.py 124 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/shrunk-2d/. The authors are listed in prov/BTYXM7.jsonl.
import math
import random
from shrunk_2d import (
SCALE,
bin_diffs,
bin_limits,
cut_nets,
fm_split,
hpwl,
initial_split,
quadratic_place,
shrink,
shrunk_2d,
)
def random_design(rng, n, m, die=10.0):
widths = [rng.choice([1.0, 1.0, 2.0]) for _ in range(n)]
heights = [1.0] * n
nets = []
for i in range(n):
if i % 3 == 0:
nets.append(([i], [(rng.uniform(0, die), rng.choice([0.0, die]))]))
else:
nets.append(([i, (i + 1) % n], []))
for _ in range(m):
nets.append((rng.sample(range(n), rng.choice([2, 2, 3, 4])), []))
return widths, heights, nets, die
def balanced(areas, bins, side, eps):
limit = bin_limits(areas, bins, eps)
return all(abs(d) <= limit[b] + 1e-12 for b, d in bin_diffs(areas, bins, side).items())
def brute_cut(areas, bins, nets, eps):
n, best = len(areas), None
for mask in range(1 << n):
side = [(mask >> i) & 1 for i in range(n)]
if balanced(areas, bins, side, eps):
c = len(cut_nets(nets, side))
best = c if best is None else min(best, c)
return best
def test_page_example():
# Cells a..h are 0..7, of unit area. a..d are in the left bin, e..h in the right one.
areas = [1.0] * 8
nets = [([0, 1, 2, 3], []), ([4, 5, 6, 7], []), ([3, 4], [])]
per_bin = [0, 0, 0, 0, 1, 1, 1, 1]
side = fm_split(areas, per_bin, nets, initial_split(areas, per_bin), eps=0.1)
assert balanced(areas, per_bin, side, 0.1)
assert len(cut_nets(nets, side)) == 2 == brute_cut(areas, per_bin, nets, 0.1)
one_bin = [0] * 8
assert brute_cut(areas, one_bin, nets, 0.0) == 1
assert sorted(bin_limits(areas, per_bin, 0.1).values()) == [2.0, 2.0]
def test_shrink_scales_hpwl_by_one_over_root_two():
rng = random.Random(3)
for _ in range(5):
w, h, nets, die = random_design(rng, 30, 40)
n = len(w)
x1, y1 = quadratic_place(n, nets, die)
sw, sh, snets, sdie = shrink(w, h, nets, die)
assert math.isclose(sum(a * b for a, b in zip(sw, sh)), sum(a * b for a, b in zip(w, h)) / 2)
x2, y2 = quadratic_place(n, snets, sdie)
for a, b in zip(x1 + y1, x2 + y2):
assert math.isclose(b, a * SCALE, rel_tol=1e-9)
ratio = hpwl(x2, y2, snets) / hpwl(x1, y1, nets)
assert math.isclose(ratio, SCALE, rel_tol=1e-9)
assert math.isclose(1 - ratio, 0.2929, abs_tol=1e-4)
def test_split_against_exhaustive_optimum():
rng = random.Random(0)
hits, worst = 0, 0
for _ in range(200):
n = rng.randint(6, 10)
w, h, nets, die = random_design(rng, n, rng.randint(n, 2 * n))
r = shrunk_2d(w, h, nets, die, k=2, eps=0.1)
areas = [a * b for a, b in zip(w, h)]
assert balanced(areas, r["bins"], r["side"], 0.1)
opt = brute_cut(areas, r["bins"], nets, 0.1)
got = len(r["mivs"])
assert got >= opt
hits += got == opt
worst = max(worst, got - opt)
assert hits == 180
assert worst == 3
def test_fm_keeps_balance_and_never_raises_the_cut():
rng = random.Random(1)
for _ in range(300):
n = rng.randint(4, 40)
areas = [rng.choice([1.0, 2.0, 3.0]) for _ in range(n)]
bins = [rng.randrange(4) for _ in range(n)]
nets = [(rng.sample(range(n), rng.randint(2, min(5, n))), []) for _ in range(n)]
eps = rng.choice([0.0, 0.1, 0.3])
start = initial_split(areas, bins)
assert balanced(areas, bins, start, eps)
side = fm_split(areas, bins, nets, start, eps)
assert balanced(areas, bins, side, eps)
assert len(cut_nets(nets, side)) <= len(cut_nets(nets, start))
def test_one_miv_per_cut_net_inside_its_box():
rng = random.Random(2)
for _ in range(20):
w, h, nets, die = random_design(rng, 25, 30)
r = shrunk_2d(w, h, nets, die, k=3)
assert r["die"] == die * SCALE
cut = cut_nets(nets, r["side"])
assert [e for e, _, _ in r["mivs"]] == cut
for e, mx, my in r["mivs"]:
cells, pads = nets[e]
xs = [r["x"][c] for c in cells] + [p[0] * SCALE for p in pads]
ys = [r["y"][c] for c in cells] + [p[1] * SCALE for p in pads]
assert min(xs) <= mx <= max(xs) and min(ys) <= my <= max(ys)
History
Earlier gate-level monolithic 3D flows, such as CELONCEL of Bobba et al. (ASP-DAC 2011), placed cells on several tiers but could not handle memory macros, so they did not apply to real designs. Panth, Samadi, Du and Lim gave Shrunk-2D at ISLPED 2014, built on Cadence Encounter for placement and routing and Synopsys PrimeTime for sign-off, with the per-bin FM split, MIV insertion by a 2D router and a leaf-level clock tree. Later gate-level 3D studies often compare with it, and later flows change the way the cells are placed before the split or partition for timing.
References
- Shreepad Panth, Kambiz Samadi, Yang Du and Sung Kyu Lim, Design and CAD methodologies for low power gate-level monolithic 3D ICs, Proceedings of the International Symposium on Low Power Electronics and Design (ISLPED 2014), La Jolla, Section 3.1 (the argument that z is negligible), Section 3.2 (scaling by 0.707, the 29.3% HPWL bound, metal width and pitch scaled with RC per unit length kept), Section 3.3 (memory as pins plus full and partial placement blockages), Section 3.5.1 (FM with area balance in each placement bin), Section 3.5.2 (leaf-level 3D clock tree), Section 3.5.3 (MIV insertion by a 2D router on a doubled metal stack), Section 4 (OpenSPARC T2 in 28 nm at 1 GHz, Tables 1 to 4)
- C. M. Fiduccia and R. M. Mattheyses, A linear-time heuristic for improving network partitions, Proceedings of the 19th Design Automation Conference (DAC 1982), pages 175 to 181, the move-based min-cut pass with bucket lists and the balance rule that lets each side be off by the largest cell (general locator)
- S. Bobba, A. Chakraborty, O. Thomas, P. Batude, T. Ernst, O. Faynot, D. Z. Pan and G. De Micheli, CELONCEL, effective design technique for 3-D monolithic integration targeting high performance integrated circuits, Proceedings of the 16th Asia and South Pacific Design Automation Conference (ASP-DAC 2011), pages 336 to 343, the earlier gate-level monolithic 3D flow that Panth et al. call rudimentary, because it does not handle memory macros (general locator)
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 BTYXM7 Edit this page History Report an error Markdown