Algorithmadvanced
Minimum-area retiming
Also called minimum register retiming.
Retimes a circuit to the fewest registers under a clock period bound, as the dual of a minimum cost flow problem.
- Time
- O(E V M) worst
- Space
- O(V^2) extra
- Where
- E = the number of wires; M = the number of constraints, at most E + V^2; V = the number of gates with the host
- Model
- Word RAM
- Properties
- deterministicexactofflineiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Charles E. Leiserson, James B. Saxe, 1991
Minimum-area retiming moves the registers of a synchronous circuit so that it has the fewest registers, either with no clock period bound or with a period of at most . The variables are the same as in retiming: one integer per gate. The register count of the retimed circuit is a linear function of , and the constraints are difference constraints, so the problem is a linear program. Leiserson and Saxe observed that its dual is a min-cost flow problem with no capacities, and that the node potentials of an optimal flow give an optimal integer retiming.
In plain words
A register costs area and power. Retiming can move registers to places where fewer of them do the same job, for example from the two inputs of a gate to its one output. Each gate gets a number, which says how many registers it pushes from its outputs back to its inputs. The total count of registers is a sum of these numbers with plus and minus signs. The rules are the same as for retiming: no wire gets a negative count, and no long stretch of logic stays without a register when a clock period is given. So the task is to minimize a sum under rules of the form "this number minus that number is at most a constant". This is the mirror image of a cheapest way to ship goods through a network, and a flow algorithm solves it exactly.
The problem
The circuit is with gate delays , register counts , and a host , as on the retiming page. A retiming with gives for , and it is legal when all . The input also has an optional period bound . The output is a legal retiming with that minimizes the register count, and that count. Two counts are common.
- Per edge. , one register for each register on each wire.
- Shared. . The fanout edges of a gate can share one chain of registers, and the gate needs as many as its most delayed fanout.
Like retiming, this page moves registers and keeps a single clock time for all of them. Clock skew scheduling keeps the registers and moves the clock arrival times. All three are solved through difference constraints.
The algorithm
Since counts once for each edge into and minus once for each edge out of , the per-edge count is
So the problem is the linear program: minimize subject to for each constraint . Its dual has one variable per constraint: minimize subject to "inflow minus outflow equals " at every vertex, where the constraint is an arc of cost . That is a min-cost flow problem.
MIN-AREA-RETIMING(G, w, d, h, c, shared)- 1
S ← { (u, v, w(e)) : e = (u, v) ∈ E } ▷ (u, v, b) means r(u) - r(v) ≤ b - 2
B ← every edge e of G with breadth β(e) = 1 ▷ the terms of the objective - 3
if shared then for each gate u with k ≥ 2 fanout edges e_i = (u, v_i) do - 4
add a mirror vertex m_u, and add (v_i, m_u, w_max(u) - w(e_i)) to S for each i - 5
in B, give e_i and the new edge (v_i, m_u) the breadth 1/k; scale all breadths to integers - 6
if c is given then compute W and D, and add (u, v, W(u, v) - 1) to S for each D(u, v) > c - 7
a(x) ← Σ β(e) over the edges of B into x - Σ β(e) over the edges of B out of x - 8
arcs ← { u → v with cost b, no capacity : (u, v, b) ∈ S } - 9
f ← a min-cost flow on arcs with inflow(x) - outflow(x) = a(x) at each x, by successive shortest paths with Bellman-Ford- 10
if the arcs have a negative cycle or no flow meets a, return "infeasible" - 11
π ← shortest distances in the residual graph of f, from a virtual source - 12
r ← π(h) - π on the vertices of G - 13
return r and the count of G_r
Here is the largest over the fanout edges of . Lines L3 to L5 build the mirror vertices of Leiserson and Saxe. The path has registers for every , so the paths, each with breadth , add up to . The constraint on the edge forces this value to be at least for each , and the optimum makes it equal to the largest one. Line L6 adds the period constraints of the retiming page. Lines L11 and L12 read the retiming off the flow: the potentials make every reduced cost nonnegative and make it zero on every arc that carries flow, which is complementary slackness for the pair of programs.
Example
One gate. A gate with delay 1 reads the host twice, through edges with one register each, and drives the host by with none. So , and , . The arcs are of cost 1, twice, and of cost 0. The flow sends one unit from to along an arc of cost 1, so the dual optimum is 1, and drops by 1. The potentials have , which gives . The two input registers become one register on the output edge , and the count is 1.
The correlator. Take the correlator of the retiming page, with 4 registers and period 24.
| period bound | least per-edge count | least shared count |
|---|---|---|
| none | 4 | 4 |
| 24, 16 | 4 | 4 |
| 14, 13 | 5 | 4 |
| 12 | infeasible | infeasible |
At , every legal retiming that meets the bound puts at least 5 registers on the edges. One of them is the retiming of the retiming page, with registers on the edges , , , and . The edges and both leave gate 1 with one register, so with sharing they use one register, and the count is 4.
Correctness
The per-edge count is the linear function above, and by the theorem on the retiming page, the constraints of lines L1 and L6 describe exactly the legal retimings that meet the period bound. With the mirror vertices, the minimum of the modeled objective over is the shared count, so the program is right for both counts. The constraint matrix is the transpose of a network matrix, so it is totally unimodular, and with integer bounds the program has an integer optimum. Bellman-Ford returns integer potentials, the potentials meet complementary slackness with the optimal flow, and so (shifted to ) is optimal for the primal. The full proof gives the details.
Proof: The flow dual gives a legal retiming with the fewest registersfull
We use the notation of the page. is the set of constraints , each meaning , built by lines L1, L4 and L6. The vertex set is plus the mirror vertices. is the set of objective edges with their breadths after the scaling of line L5, and is the coefficient of line L7. Write for the scale factor of line L5, with for the per-edge count.
Lemma 1 (the feasible set). A map with is a legal retiming with exactly when it extends to so that all constraints of hold. Without a period bound, drop "".
Proof. The constraints of lines L1 and L6 are those of Theorem 1 on the retiming correctness page, so on they hold exactly for the legal retimings with . A constraint of line L4 has the form , a lower bound on . Each mirror vertex appears only in these lower bounds, so a large enough integer meets them, and they never exclude a value of on .
Lemma 2 (the objective). For every on that meets , , with equality on the per-edge model, and on the shared model when each is the least value that meets line L4. Here is the count of the chosen model.
Proof. For the per-edge count, with , and the sum is . For the shared count, let have fanout edges and let with . By Lemma 1 of the retiming proof, the path has , the same value for every . With breadth on each of the edges, these terms add up to . Since by line L4, for every , so . The least that meets line L4 makes some , so it gives . A gate with one fanout edge keeps and contributes . Summing over gives the claim, with as the main term.
So by Lemmas 1 and 2, the problem is the linear program
since by the same telescoping as on the page, and a minimizer may take each at its least value without loss.
Lemma 3 (bounded). If is feasible, and its relaxation over are bounded below.
Proof. On the feasible set, every with is at least 0, by line L1 for the edges of and by line L4 for the mirror edges. So the objective is at least .
Lemma 4 (duality). The dual of the relaxation of is
the min-cost flow problem of lines L8 and L9, where the constraint is an arc . A pair of feasible solutions and is optimal exactly when only on arcs with .
Proof. Write the constraints as , where the row of has at and at . The dual of subject to with free is subject to and . Put . Then is the flow out of minus the flow into , so reads , and the objective is . The last claim is complementary slackness, from the complementary slackness page.
Lemma 5 (the cases of line L10). If the constraint graph has a negative cycle, is infeasible. Otherwise has an optimal solution.
Proof. A negative cycle of arcs of cost gives a sum of constraints whose left sides cancel and whose right side is negative, so has no solution, by the theorem on the difference constraints page. If there is no negative cycle, is feasible by the same theorem, is bounded by Lemma 3, so the relaxation has an optimum, and by LP duality is feasible and has an optimum of the same value.
So line L10 returns "infeasible" exactly when no legal retiming meets the bound: when there is no negative cycle, successive shortest paths finds a flow, by the next lemma, and it cannot report a missing flow.
Lemma 6 (successive shortest paths). If the arcs have no negative cycle and is feasible, line L9 returns an optimal flow , and the residual graph of has no negative cycle.
Proof. Add a super source joined to each with by an arc of capacity and cost 0, and a super sink reached from each with by an arc of capacity . Give each real arc the capacity , where . A flow of value that meets the demands never puts more than on an arc in an optimal solution with no flow cycles, and has such an optimal solution because removing a cycle of flow does not raise the cost when there is no negative cycle. So the capacity does not change the optimum. By the theorem on the successive shortest path page, the method keeps a flow whose residual graph has no negative cycle, and after units it has a flow of value of least cost. Its restriction to the real arcs is optimal for .
Lemma 7 (potentials). Let be the shortest distances of line L11, in the residual graph of restricted to , from a virtual source with a 0 arc to every vertex. Then satisfies and is tight on every arc with .
Proof. The residual graph has no negative cycle by Lemma 6, so the distances exist, and they are integers because all costs are integers. Every real arc of cost stays in the residual graph, since its flow is at most and its capacity is . So , that is , and holds. If on the arc, the reverse arc of cost is in the residual graph, so . Together, , and the constraint is tight. Adding the constant keeps all differences.
Theorem. If some legal retiming meets the period bound, MIN-AREA-RETIMING returns an integer legal retiming with and whose register count is the least over all such retimings, in the chosen model. Otherwise it returns "infeasible".
Proof. The second claim is Lemma 5 with Lemma 1. For the first, is feasible for by Lemma 6, and is feasible for the relaxation of and tight wherever by Lemma 7. By Lemma 4, is optimal for the relaxation, and it is an integer vector, so it is optimal for . The integrality also follows from the fact that is the transpose of a network matrix and so totally unimodular. Lowering each to its least value keeps and does not raise the objective, since counts only edges into , so already has these least values at an optimum or another optimum has them with the same values on . By Lemmas 1 and 2, the restriction of to is a legal retiming that meets the bound and minimizes , hence .
Complexity
The system has constraints, or with no period bound. Lines L1 to L7 take time with the period bound, for and , and without it. For the per-edge count, the total demand is at most , and each shortest path pushes at least one unit, so successive shortest paths make at most rounds of Bellman-Ford, each in time. That is time and space. For the shared count, the scale factor of line L5 multiplies the demands, so this bound grows with the least common multiple of the fanout sizes. A min-cost flow method whose time does not depend on the demands, such as cost scaling, removes this factor.
Properties
- Exact. The count is the least over all legal retimings with the period bound, for the count model chosen.
- Integral. The optimum is reached by an integer retiming, by total unimodularity.
- Infeasibility is detected. If no retiming meets the period bound, the constraint graph has a negative cycle, and line L10 reports it.
- The function is kept. As for any retiming, the gates are unchanged, and the output streams are the same after the start-up phase.
Variants and improvements
- Weighted registers. Give each edge a cost per register, for example for wide buses. The breadths of line L2 become these costs, and nothing else changes.
- Least period first. Run retiming for the least period , then minimum-area retiming with . This gives the fewest registers among the fastest retimings.
- Fewer constraints. Most period constraints are implied by others. Shenoy and Rudell (1994) prune them, which makes the method practical for large netlists.
- Other flow solvers. Any min-cost flow solver that returns optimal potentials works, for example network simplex, whose dual values are the potentials, or successive shortest paths with Dijkstra and reduced costs.
When to use it
Use it when the clock period is fixed by the design and the register count, area or power should go down, for example after a pipeline was added by hand. Use the shared count for real hardware, since a gate with many fanouts can share one register chain. When the registers must stay put, for example because of test or verification, use clock skew scheduling for timing instead.
Pitfalls
- Per-edge counts overstate the area. Without the mirror vertices, the program pays for every fanout edge, and it may refuse a move that a shared register makes cheap. In the correlator at , the per-edge count is 5, but the circuit needs only 4 registers.
- Lost constraints in the flow. The arcs have no capacity. A flow code that gives them a finite capacity must make it large enough that no arc is saturated, or the saturated arc drops out of the residual graph and its constraint is lost from the potentials. Then can break the period bound.
- The sign of the potentials. The constraint is met by , not by , when the arc is of cost .
- Initial states. As for retiming, the moved registers need new initial values, and a backward move can make them impossible to find.
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/minimum-area-retiming/. The authors are listed in prov/HEA0W3.jsonl.
"""Minimum-area retiming as the dual of a minimum cost flow problem.
A circuit is a graph with vertices 0 .. n-1, integer delays d[v] >= 0 and
edges (u, v, w), a wire from u to v through w >= 0 registers. Vertex 0 is
the host and keeps r(0) = 0. Every cycle must hold a register. A retiming r
gives w_r(e) = w(e) + r(v) - r(u), and it is legal when every w_r(e) >= 0.
Two register counts are supported:
- per edge: the sum of w_r(e) over all edges;
- shared: the registers on the fanout edges of one vertex form one chain,
so the count is the sum over u of the largest w_r(e) of an edge out of u.
The shared count uses the mirror vertices of Leiserson and Saxe.
"""
from math import lcm
from typing import Optional
Edge = tuple[int, int, int]
def register_count(edges: list[Edge], r: list[int], shared: bool = False) -> int:
er = [(u, v, w + r[v] - r[u]) for (u, v, w) in edges]
if not shared:
return sum(w for (_, _, w) in er)
most: dict[int, int] = {}
for (u, _, w) in er:
most[u] = max(most.get(u, 0), w)
return sum(most.values())
def clock_period(n: int, d: list[int], edges: list[Edge]) -> int:
"""The largest delay of a path with no register. Raises ValueError if a
cycle has no register."""
succ: list[list[int]] = [[] for _ in range(n)]
indeg = [0] * n
for (u, v, w) in edges:
if w == 0:
succ[u].append(v)
indeg[v] += 1
arrive = list(d)
queue = [v for v in range(n) if indeg[v] == 0]
seen = 0
while queue:
u = queue.pop()
seen += 1
for v in succ[u]:
arrive[v] = max(arrive[v], arrive[u] + d[v])
indeg[v] -= 1
if indeg[v] == 0:
queue.append(v)
if seen < n:
raise ValueError("a cycle has no register")
return max(arrive) if n else 0
def wd_matrices(n: int, d: list[int], edges: list[Edge]):
"""W[u][v]: the fewest registers on a path u to v; D[u][v]: the largest
delay of such a path, with d[u] and d[v]. None when there is no path."""
best: list[list[Optional[tuple[int, int]]]] = [[None] * n for _ in range(n)]
for v in range(n):
best[v][v] = (0, 0)
for (u, v, w) in edges:
cand = (w, -d[u])
if u != v and (best[u][v] is None or cand < best[u][v]):
best[u][v] = cand
for k in range(n):
for i in range(n):
if best[i][k] is None:
continue
for j in range(n):
if best[k][j] is None:
continue
cand = (best[i][k][0] + best[k][j][0], best[i][k][1] + best[k][j][1])
if best[i][j] is None or cand < best[i][j]:
best[i][j] = cand
W = [[None if best[u][v] is None else best[u][v][0] for v in range(n)] for u in range(n)]
D = [[None if best[u][v] is None else d[v] - best[u][v][1] for v in range(n)] for u in range(n)]
return W, D
def _bellman_ford(n: int, arcs: list[tuple[int, int, int]], src: Optional[int]):
"""Shortest distances over arcs (a, b, cost). From src, or from a virtual
source joined to every node when src is None. Returns (dist, parent) or
None on a negative cycle. Unreachable nodes have dist None."""
dist: list[Optional[int]] = [0] * n if src is None else [None] * n
parent: list[Optional[int]] = [None] * n
if src is not None:
dist[src] = 0
for _ in range(n + 1):
changed = False
for i, (a, b, cost) in enumerate(arcs):
if dist[a] is not None and (dist[b] is None or dist[a] + cost < dist[b]):
dist[b] = dist[a] + cost
parent[b] = i
changed = True
if not changed:
return dist, parent
return None
def min_cost_flow_dual(n: int, arcs: list[tuple[int, int, int]], demand: list[int]) -> Optional[tuple[int, list[int]]]:
"""Solve min sum(b * f) over uncapacitated arcs (u, v, b) with
inflow(x) - outflow(x) = demand[x], by successive shortest paths.
Returns the least cost and potentials pi with b + pi[u] - pi[v] >= 0 on
every arc and equality on every arc with flow, or None if no flow meets
the demands or a negative cycle exists."""
if _bellman_ford(n, arcs, None) is None:
return None
total = sum(x for x in demand if x > 0)
s, t = n, n + 1
# residual arcs: [tail, head, cost, capacity]; arc 2k + 1 is the reverse of arc 2k
res: list[list[int]] = []
def add(a: int, b: int, cost: int, cap: int) -> None:
res.append([a, b, cost, cap])
res.append([b, a, -cost, 0])
for (u, v, b) in arcs:
# Uncapacitated: the flow on one arc never exceeds the total demand, so the
# capacity total + 1 is never reached and every arc stays in the residual graph.
add(u, v, b, total + 1)
for x in range(n):
if demand[x] < 0:
add(s, x, 0, -demand[x])
elif demand[x] > 0:
add(x, t, 0, demand[x])
cost = 0
sent = 0
while sent < total: # @line L9
live = [(a, b, c) for (a, b, c, cap) in res if cap > 0]
index = [i for i, arc in enumerate(res) if arc[3] > 0]
out = _bellman_ford(n + 2, live, s)
assert out is not None # the residual graph of a min-cost flow has no negative cycle
dist, parent = out
if dist[t] is None:
return None
path, x = [], t
while x != s:
i = index[parent[x]]
path.append(i)
x = res[i][0]
push = min(res[i][3] for i in path)
for i in path:
res[i][3] -= push
res[i ^ 1][3] += push
cost += push * dist[t]
sent += push
live = [(a, b, c) for (a, b, c, cap) in res if cap > 0 and a < n and b < n] # @line L11
out = _bellman_ford(n, live, None)
assert out is not None
return cost, out[0]
def min_area_retiming(n: int, d: list[int], edges: list[Edge], c: Optional[int] = None,
shared: bool = False) -> Optional[tuple[int, list[int]]]:
"""The fewest registers over legal retimings with period at most c (no
bound when c is None), and a retiming that reaches it. None if no legal
retiming has period at most c."""
clock_period(n, d, edges)
cons = [(u, v, w) for (u, v, w) in edges] # @line L1: (u, v, b) means r(u) - r(v) <= b
breadth: list[tuple[int, int, int]] = [] # (tail, head, weight of the edge in the objective)
m = n
if shared: # @line L3
fanout: dict[int, list[Edge]] = {}
for e in edges:
fanout.setdefault(e[0], []).append(e)
scale = lcm(*[len(es) for es in fanout.values()]) if fanout else 1 # @line L5: integer breadths
for u, es in fanout.items():
if len(es) == 1:
breadth.append((u, es[0][1], scale))
continue
wmax = max(w for (_, _, w) in es)
mirror = m
m += 1
for (_, v, w) in es:
breadth.append((u, v, scale // len(es)))
breadth.append((v, mirror, scale // len(es)))
cons.append((v, mirror, wmax - w)) # @line L4
else:
scale = 1
breadth = [(u, v, 1) for (u, v, _) in edges] # @line L2
if c is not None: # @line L6
W, D = wd_matrices(n, d, edges)
for u in range(n):
for v in range(n):
if D[u][v] is not None and D[u][v] > c:
cons.append((u, v, W[u][v] - 1))
# objective: sum over objective edges of beta * (r(head) - r(tail)), plus a constant
coef = [0] * m # @line L7
for (u, v, beta) in breadth:
coef[v] += beta
coef[u] -= beta
# min coef . r subject to r(u) - r(v) <= b has the dual: min sum b f over arcs u -> v
# with inflow - outflow = coef, and the optimum r is minus the potentials.
out = min_cost_flow_dual(m, cons, coef) # @line L8
if out is None:
return None # @line L10
_, pi = out
r = [-p + pi[0] for p in pi] # @line L12
return register_count(edges, r[:n], shared), r[:n] # @line L13
test_minimum_area_retiming.py 114 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/minimum-area-retiming/. The authors are listed in prov/HEA0W3.jsonl.
import itertools
import random
from minimum_area_retiming import clock_period, min_area_retiming, min_cost_flow_dual, register_count, wd_matrices
# The correlator of the page: host 0, comparators 1 to 4 (delay 3), adders 5 to 7 (delay 7).
N = 8
DELAY = [0, 3, 3, 3, 3, 7, 7, 7]
EDGES = [(0, 1, 1), (1, 2, 1), (2, 3, 1), (3, 4, 1), (4, 5, 0), (5, 6, 0), (6, 7, 0), (7, 0, 0),
(3, 5, 0), (2, 6, 0), (1, 7, 0)]
def retimed(edges, r):
return [(u, v, w + r[v] - r[u]) for (u, v, w) in edges]
def legal(edges, r) -> bool:
return all(w >= 0 for (_, _, w) in retimed(edges, r))
def random_circuit(rng: random.Random, n: int):
while True:
d = [0] + [rng.randint(1, 5) for _ in range(n - 1)]
edges = [(i, (i + 1) % n, rng.choice([0, 1, 1])) for i in range(n)]
for _ in range(rng.randint(1, n + 1)):
u, v = rng.randrange(n), rng.randrange(n)
if u != v:
edges.append((u, v, rng.choice([0, 0, 1, 2])))
try:
clock_period(n, d, edges)
except ValueError:
continue
if sum(w for (_, _, w) in edges) <= 8:
return d, edges
def fewest_registers(n, edges, src):
best = [None] * n
best[src] = 0
for _ in range(n):
for (u, v, w) in edges:
if best[u] is not None and (best[v] is None or best[u] + w < best[v]):
best[v] = best[u] + w
return best
def all_legal_retimings(n, edges):
"""Every legal retiming with r(0) = 0, from the box -W(0, v) <= r(v) <= W(v, 0)."""
down = fewest_registers(n, edges, 0)
up = [fewest_registers(n, edges, v)[0] for v in range(n)]
for t in itertools.product(*[range(-down[v], up[v] + 1) for v in range(1, n)]):
r = [0, *t]
if legal(edges, r):
yield r
def test_one_gate() -> None:
# Host 0 feeds gate 1 on two wires, each with a register; gate 1 feeds the host.
edges = [(0, 1, 1), (0, 1, 1), (1, 0, 0)]
count, r = min_area_retiming(2, [0, 1], edges)
assert (count, r) == (1, [0, -1])
def test_flow_dual_small() -> None:
# min 3 f01 + 1 f12 + 1 f02 with one unit from 0 to 2: the path 0 -> 2 costs 1.
cost, pi = min_cost_flow_dual(3, [(0, 1, 3), (1, 2, 1), (0, 2, 1)], [-1, 0, 1])
assert cost == 1
for (u, v, b) in [(0, 1, 3), (1, 2, 1), (0, 2, 1)]:
assert b + pi[u] - pi[v] >= 0
assert 1 + pi[0] - pi[2] == 0 # the arc with flow is tight
def test_correlator() -> None:
assert min_area_retiming(N, DELAY, EDGES) == (4, [0] * 8)
count, r = min_area_retiming(N, DELAY, EDGES, 13)
assert count == 5 and legal(EDGES, r)
assert clock_period(N, DELAY, retimed(EDGES, r)) <= 13
count, r = min_area_retiming(N, DELAY, EDGES, 13, shared=True)
assert count == 4 and register_count(EDGES, r, shared=True) == 4
assert min_area_retiming(N, DELAY, EDGES, 12) is None
assert min_area_retiming(N, DELAY, EDGES, 16)[0] == 4
def test_against_bruteforce() -> None:
rng = random.Random(5201)
saved = 0
for _ in range(120):
n = rng.randint(3, 6)
d, edges = random_circuit(rng, n)
table = []
for r in all_legal_retimings(n, edges):
table.append((clock_period(n, d, retimed(edges, r)),
register_count(edges, r), register_count(edges, r, shared=True)))
_, D = wd_matrices(n, d, edges)
bounds = [None] + sorted({x for row in D for x in row if x is not None})
for c in bounds:
ok = [t for t in table if c is None or t[0] <= c]
for shared in (False, True):
got = min_area_retiming(n, d, edges, c, shared)
if not ok:
assert got is None
continue
best = min(t[2 if shared else 1] for t in ok)
assert got is not None and got[0] == best
count, r = got
assert r[0] == 0 and legal(edges, r)
assert register_count(edges, r, shared) == count
if c is not None:
assert clock_period(n, d, retimed(edges, r)) <= c
saved += min(t[1] for t in table) < register_count(edges, [0] * n)
assert saved >= 20 # many instances lose registers
History
Leiserson and Saxe (1991) stated the minimum register problem as a linear program over the retiming variables, observed that its dual is a min-cost flow problem, and gave the mirror vertex construction for shared fanout registers. Shenoy and Rudell (1994) reduced the number of period constraints so that the method runs on large netlists.
References
- Charles E. Leiserson and James B. Saxe, Retiming synchronous circuitry, Algorithmica 6(1-6), 5 to 35, 1991, the sections on minimizing the number of registers, the linear program and its min-cost flow dual, and the mirror vertices for fanout sharing
- Giovanni De Micheli, Synthesis and Optimization of Digital Circuits, McGraw-Hill, 1994, Chapter 9, Sequential Logic Optimization (retiming for area)
- Efficient implementation of retiming, the reduction of the period constraints that makes minimum-area retiming run on large circuits (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 HEA0W3 Edit this page History Report an error Markdown