Problemcore
Technology mapping
Also called library binding.
Cover a technology-independent network with gates of a cell library or with lookup tables, minimizing area, delay or power.
Technology mapping turns a circuit that is described without regard to the target technology, a Boolean network or an and-inverter graph, into a circuit built from the parts that the technology offers. For a chip made of standard cells, the parts are the gates of a cell library, each with a function, an area and a delay. For an FPGA, the parts are lookup tables (LUTs) with inputs, each of which can hold any function of inputs; that case has its own page, LUT mapping. The mapped circuit must compute the same outputs, and the goal is the least area, the least delay, the least power, or one of them under a bound on another. In the usual formulation, introduced by Keutzer in 1987, the circuit is first written in a few base gates as a subject graph, and the mapping is a cover of the subject graph by matches of library gates. Many forms of the problem are NP-hard, and only some special cases, such as trees, have polynomial exact algorithms.
In plain words
A circuit design is first written in a simple, neutral form, with many small gates. A factory, though, offers a fixed set of gates, some small and simple, some larger ones that do more work in less area. Technology mapping rebuilds the design from the factory's gates.
The rebuilt circuit must do exactly what the design does. Among all ways to rebuild it, pick one that takes the least room on the chip, or one that makes the signals arrive soonest, or one that uses the least power. For an FPGA, the parts are small memories that can act as any gate with a few inputs.
Definition
Input. A subject graph : a directed acyclic graph whose sources are the primary inputs and whose other nodes are base gates, for example 2-input NAND gates and inverters, with a set of outputs. A library of gates. Each gate has a function over its inputs, an area , and a delay model, for example a fixed delay . Each gate is described by one or more pattern graphs over the same base gates, or by its function alone.
Feasible solutions. A cover of : a set of matches, where a match of at node is a set of nodes of rooted at whose function, as a function of the match inputs, is the function of under some assignment of the inputs of . Every output gate must be the root of a match, and every input of a match must be a primary input or the root of a match. A match may cover a node that is also covered by another match, which copies its logic. The matched gates, wired as their inputs say, form the mapped circuit, which computes the outputs of .
Objective. One of:
- area: the sum of over the matches;
- delay: the largest arrival time at an output, where the arrival time at a match root is the largest arrival time of an input plus the delay of the gate, and 0 at the primary inputs;
- power, or area under a delay bound, or delay under an area bound.
Decision version. Given , and a number , is there a cover of area at most ? The same with delay at most .
A match is structural if the covered nodes have the shape of a pattern graph of , and Boolean if only the function of the covered region is compared with the function of , as in Boolean matching. The structural form depends on the subject graph: a different decomposition of the same functions can allow different covers.
Variants
- Target. A cell library, or -input LUTs, where every function of at most inputs is a gate of area 1. The second is LUT mapping.
- Tree covers. Cut at every node with more than one fanout and allow only matches that stay inside one tree, so that no logic is copied. This is the setting of tree covering.
- Matching. Structural matches against pattern graphs, or Boolean matches of cut functions against cell functions under permutation and negation of the inputs.
- Delay model. Unit delay, a fixed delay per gate, or a delay that depends on the load that a gate drives. The last couples mapping with gate sizing and static timing analysis.
- Several structures. The input holds several subject graphs for the same functions, or one graph with choice nodes, and a cover may use any of them. Chatterjee, Mishchenko, Brayton, Wang and Kam (2006) call the dependence on one structure the structural bias.
- Sequential mapping. Registers stay in the graph, and mapping is done together with retiming.
- Functional form. Ask for any circuit of library gates that computes the outputs, not a cover of a given . This is the setting of exact synthesis, and it is much harder.
Examples
All areas below are made-up values for a toy library: INV 2, NAND2 3, AND2 4, AOI21 4 and AOI22 5. AND2 is INV(NAND(, )), AOI21 is INV(NAND(NAND(, ), INV())) and AOI22 is INV(NAND(NAND(, ), NAND(, ))).
- One large gate. as . Covers: three NAND2 and one INV, area 11; two NAND2 and one AND2, area 10; one AOI22, area 5. The least area is 5.
- Copying pays. feeds and . A cover that does not copy needs NAND2 for , INV for and AND2 over and for , with an INV for , area 11. A cover that copies uses AND2 over for and AOI21 over for , area 8.
- LUTs. The AND of 5 inputs, with , needs 2 LUTs and has depth 2 at best, since one LUT has only 4 inputs. With it needs 1 LUT.
- Structure matters. Add NAND3 with area 4, pattern NAND(, INV(NAND(, ))), and NAND4 with area 5, pattern NAND(INV(NAND(, )), INV(NAND(, ))). The function written as a balanced tree, , is one NAND4 match, area 5. Written as a chain, , the NAND4 pattern does not fit, and the best structural cover is NAND3 over AND2, area 8. The function is the same, and only the shape differs.
Known algorithms
- Tree covering technology mapping (Keutzer 1987). Exact for tree covers of the given subject graph, in time linear in the graph for a fixed library, for area and for a fixed delay per gate.
- FlowMap. Exact for the least depth in LUT mapping, in polynomial time.
- Cut enumeration with dynamic programming over the cuts of each node, and priority cuts. Cut-based mappers for LUTs, and with Boolean matching for cells. The area passes are heuristics.
- Exact covering by integer programming or SAT, with one variable per match. Exact, with exponential time in the worst case.
- The methods of compiler code generation for the same covering problem, such as BURS and maximal munch, from the instruction selection problem.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Tree covering technology mapping | O(N L s 2^s) worst | O(N) extra | deterministicnot exactofflineiterative | 1 language |
Bounds
Upper bounds (proved).
- Tree covers. For area, and for delay with a fixed delay per gate, the best tree cover of a subject graph is found in time linear in the graph for a fixed library, by dynamic programming over each tree.
- Depth of LUT mappings. For a -bounded network and unit delay per LUT, a mapping of least depth is found in polynomial time (Cong and Ding 1994, see FlowMap).
- The decision version with structural matches is in NP: a cover is a certificate of polynomial size, and its area and delay are checked in polynomial time.
Lower bounds (proved, as hardness).
- Covering a network with the fewest -input LUTs is NP-hard (Farrahi and Sarrafzadeh 1994). So area-optimal mapping with copying allowed is NP-hard for that library, which has every function of inputs.
- For cell libraries, area-optimal covering of a general DAG is stated to be NP-hard in the mapping literature. This page does not give a proof or a precise source for a particular library.
- With Boolean matches, a single match test contains a co-NP-hard question when the functions are given as circuits, see Boolean matching. With functions given as truth tables of a few inputs, as in practice, the test is fast.
- In the functional form, with the network given as a circuit, even the question whether an output needs no gate at all is co-NP-hard, since it asks whether the output is a constant or an input.
Measured. Mappers are compared on benchmark circuits such as the MCNC and ISCAS sets, and the papers report area and delay on those sets. These are measurements on those sets, not bounds. The second example above shows the kind of gap that tree covers can have on one small graph.
Reductions
- LUT mapping is a special case. Take the library of all functions of at most inputs, each with area 1 and delay 1, with Boolean matches.
- To set covering. A DAG cover is a covering problem with one 0-1 variable per match and constraints that each output is covered and each input of a chosen match is covered, a binate covering problem.
- Instruction selection. Selecting machine instructions for the expression DAG of a program is the same covering problem, with instructions as the library and their cost as the area.
- Boolean matching as a subproblem. Each Boolean match test is an instance of Boolean matching.
Applications
- Standard cell synthesis. Every ASIC flow maps the optimized logic into the cells of a library before placement.
- FPGA synthesis. Every FPGA flow maps the logic into LUTs, carry chains and other blocks of the device.
- Resynthesis. Mapping into a library of small gates, then reading the mapped circuit back as a network, is also used as a logic optimization step.
References
- Kurt Keutzer, DAGON: technology binding and local optimization by DAG matching, Proceedings of the 24th ACM/IEEE Design Automation Conference, 1987, pages 341 to 347; the subject graph, the pattern graphs of the library, and covering as the formulation of the problem
- Giovanni De Micheli, Synthesis and Optimization of Digital Circuits, McGraw-Hill, 1994, chapter 10, cell-library binding (general locator, not checked)
- Satrajit Chatterjee, Alan Mishchenko, Robert Brayton, Xinning Wang and Timothy Kam, Reducing structural bias in technology mapping, IEEE Transactions on Computer-Aided Design 25(12), 2006, pages 2894 to 2903; the dependence of a cover on the structure of the subject graph, and mapping over several structures at once
- Complexity of the lookup-table minimization problem for FPGA technology mapping, pages 1319 to 1332; the NP-hardness of covering a network with the fewest lookup tables
Where this leads
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 | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag FYE7QJ Edit this page History Report an error Markdown