Algorithm Search⌘K

Problemadvanced

Interconnect binding

Also called multiplexer minimization, port assignment.

Choose the buses, multiplexers and operand ports that connect registers and units after binding so that the number and width of multiplexer inputs is least.

Interconnect binding is the last binding step of high-level synthesis. Once every operation has a functional unit and every value has a register, the datapath still needs wires from registers to unit inputs and from unit outputs to registers. Each input that receives data from more than one place needs a multiplexer, or a bus. Interconnect binding chooses the operand ports of commutative operations, the buses and the multiplexers so that the number of multiplexer inputs is least. Even the choice of operand ports alone, for a single adder, is NP-hard.

In plain words

After binding, we know which adder does each addition and which register holds each number. Now the wires must be drawn. An adder input that takes numbers from three different registers needs a switch with three inputs in front of it, and switches cost area and time. For an addition like x plus y, it does not matter which input gets x and which gets y, so we may flip it. Flipping some additions can make each input see fewer registers. Choosing the flips well is a hard puzzle, even for one adder. The same goal applies to the inputs of registers and to shared buses.

Definition

Input. A scheduled and bound design: for each operation vv, a unit β(v)\beta(v) with operand ports 1,…,p1, \ldots, p, the registers or units that supply its operands, and the register ρ\rho that receives its result, as on the resource binding and register binding pages. Some operations are commutative, such as add, multiply, and, or.

Connections. A sink is an input port of a unit or the input of a register. The sources of a sink are the distinct registers, units or primary inputs that ever drive it. A sink with k≥2k \ge 2 sources needs a kk-input multiplexer, and a sink with one source is a plain wire.

Feasible solutions. For each commutative operation, a choice of which operand goes to which port of its unit. The units, registers and schedule stay fixed.

Objective. Minimize the total number of multiplexer inputs, ∑sinks with k≥2k\sum_{\text{sinks with } k \ge 2} k. A simpler objective counts all connections, ∑sinksk\sum_{\text{sinks}} k, including the plain wires.

Decision form. Given the bound design and an integer KK, can the operands be placed so that the cost is at most KK?

When the bindings are not yet fixed, the problem merges with register and unit binding, and the cost depends on all three choices at once.

Variants

  • Bus style. Instead of a multiplexer per sink, data moves over a few shared buses. Two transfers can share a bus if they never happen in the same step, so the fewest buses is a clique partition of the compatibility graph of transfers, see clique cover and Tseng-Siewiorek clique partitioning.
  • Binding with interconnect cost. The register binding is chosen so that values from the same unit share registers, as in weighted bipartite matching binding.
  • Multiplexer width and depth. On FPGAs, a multiplexer with more inputs than a lookup table takes several levels of logic, so the cost of a kk-input multiplexer grows faster than kk.
  • Register files with ports. Values live in multiport register files, and the problem assigns reads and writes to file ports in each step.

Examples

One adder, three registers. Registers R1,R2,R3R_1, R_2, R_3 hold three values, and one adder performs R1+R2R_1 + R_2, R2+R3R_2 + R_3 and R3+R1R_3 + R_1 in three steps. Written as given, port 1 receives R1,R2,R3R_1, R_2, R_3 and port 2 receives R2,R3,R1R_2, R_3, R_1: two 3-input multiplexers, 6 inputs. Flipping the third addition to R1+R3R_1 + R_3 gives port 1 the sources R1,R2R_1, R_2 and port 2 the sources R2,R3R_2, R_3: two 2-input multiplexers, 4 inputs. Fewer is impossible. Each register must reach a port. If each reached only one port, two of the three registers would share a port, but every two of them are added together, so they must reach different ports. Hence some register reaches both ports, and the best is 3+1=43 + 1 = 4.

A case with nothing to gain. If the adder only computes R1+R2R_1 + R_2 and R1+R3R_1 + R_3, put R1R_1 on port 1 both times: port 1 has one source and needs no multiplexer, and port 2 has a 2-input multiplexer.

Known algorithms

  • Clique partitioning of transfers. For the bus style, the greedy of Tseng-Siewiorek clique partitioning groups transfers into buses.
  • Operand swapping heuristics. Visit the commutative operations and flip each one that lowers the count, until no flip helps. Each pass is linear, and the result is a local optimum.
  • Joint binding. Binders that weigh shared sources, such as the weighted bipartite matching binder, reduce the interconnect while they bind registers.
  • Integer programming. A 0-1 variable per operation for its port order and per pair of source and sink gives the optimum for small designs.
  • Odd cycle transversal methods. For one two-port unit, the problem is exactly odd cycle transversal, as shown below, so its exact and parameterized algorithms apply.

Bounds

Fix one commutative unit with two ports, and let nn be the number of distinct registers it reads. Every placement uses between nn and 2n2n port connections, since each register reaches one or both ports.

One two-port unit: the exact count. Build a graph GG on the nn registers, with an edge {R,R′}\{R, R'\} for each operation R+R′R + R' with R≠R′R \ne R'. A placement of the operands puts each edge's two ends on the two ports. Let S1S_1 and S2S_2 be the registers that reach port 1 and port 2. The connections number ∣S1∣+∣S2∣=n+∣S1∩S2∣|S_1| + |S_2| = n + |S_1 \cap S_2|. Then

min⁡∣S1∩S2∣=oct(G),\min |S_1 \cap S_2| = \mathrm{oct}(G),

the fewest vertices whose removal leaves a bipartite graph. Proof: removing T=S1∩S2T = S_1 \cap S_2 leaves each edge with one end only in S1S_1 and one end only in S2S_2, so G−TG - T is bipartite with sides S1∖S2S_1 \setminus S_2 and S2∖S1S_2 \setminus S_1. Conversely, let G−TG - T be bipartite with sides AA and BB. Put the AA end of each edge on port 1, the BB end on port 2, and for an edge inside TT choose either way. Then S1⊆A∪TS_1 \subseteq A \cup T and S2⊆B∪TS_2 \subseteq B \cup T, so S1∩S2⊆TS_1 \cap S_2 \subseteq T. The triangle example has oct=1\mathrm{oct} = 1 and costs 3+13 + 1.

Reductions

Vertex cover to odd cycle transversal. Take a graph HH. Build GG from HH by adding, for each edge uvuv of HH, a new vertex wuvw_{uv} joined to uu and vv. Then oct(G)\mathrm{oct}(G) equals the least vertex cover of HH. If CC covers HH, then G−CG - C has no edge between two old vertices, and each new vertex is joined only to old ones, so G−CG - C is bipartite. If TT breaks every odd cycle of GG, it meets each triangle uvwuvu v w_{uv}. Replace each wuv∈Tw_{uv} \in T by uu: afterwards wuvw_{uv} has at most one neighbour left and lies on no cycle, so the new set still works and is no larger. It contains an end of each edge of HH, so it is a cover.

Interconnect binding is NP-complete. By the two steps above, given HH and qq, build GG, make one register per vertex of GG and one addition per edge of GG on one adder, in different steps. The least number of port connections is ∣V(G)∣+oct(G)=∣V(G)∣+vc(H)|V(G)| + \mathrm{oct}(G) = |V(G)| + \mathrm{vc}(H), so it is at most ∣V(G)∣+q|V(G)| + q exactly when HH has a vertex cover of size qq. Vertex cover is NP-complete (Karp 1972). The result register of each addition adds the same fixed count in every placement. If HH has two disjoint edges, every port of GG's adder sees at least two sources in every placement, so every connection is a multiplexer input and the same reduction works for the multiplexer count. A placement is checked in polynomial time, so the decision form is in NP. Pangrle (1991) studied the complexity of the general connectivity binding problem.

Applications

  • Datapath area. In FPGA designs, multiplexers can take more area than the shared units, so a binding that saves one adder but adds many multiplexer inputs can lose.
  • Clock period. A wide multiplexer in front of a unit lengthens the critical path, so reducing multiplexer inputs also helps timing.
  • Bus-based architectures. Datapaths with a few shared buses use the transfer compatibility graph to decide which transfers ride on which bus.

References

  1. Giovanni De Micheli, Synthesis and Optimization of Digital Circuits, McGraw-Hill, 1994, Chapter 6, Resource Sharing and Binding (the interconnect that sharing creates, and bus and multiplexer styles)
  2. Chia-Jeng Tseng and Daniel P. Siewiorek, Automated synthesis of data paths in digital systems, IEEE Transactions on Computer-Aided Design 5(3), 379 to 395, 1986, the compatibility graph of data transfers and its partition into cliques, one bus per clique
  3. Barry M. Pangrle, On the complexity of connectivity binding, IEEE Transactions on Computer-Aided Design 10(11), 1460 to 1465, 1991, whole paper (the NP-completeness of connectivity binding)
  4. Deming Chen and Jason Cong, Register binding and port assignment for multiplexer optimization, Proceedings of the Asia and South Pacific Design Automation Conference, 2004, whole paper (binding and operand port choice to reduce multiplexer inputs on FPGAs)
  5. Richard M. Karp, Reducibility among combinatorial problems, in Complexity of Computer Computations, Plenum (1972), 85 to 103, the list of 21 problems (Node cover)

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a known algorithm
  • a contract.yaml