Problemadvanced
Module selection
Also called resource type selection.
Choose for each operation one of several library units of different speed and area, for example a ripple or carry-lookahead adder, together with the schedule.
Module selection is the problem of high-level synthesis in which each operation may run on one of several library modules that do the same job at different speed and area, for example a ripple-carry adder that is small and slow or a carry-lookahead adder that is large and fast. The choice of modules and the schedule must be made together, since a slow module lengthens the schedule and a fast one costs area. It contains latency-constrained scheduling, where each operation has one module, and it is NP-hard even for a chain of operations, where scheduling alone would be trivial, by a reduction from the knapsack problem.
In plain words
A chip library often has several circuits for the same job. One multiplier is fast but big, another is slow but small. For each multiplication in the design, we pick one of these circuits and a time slot. Picking the small, slow circuit saves area but makes the whole computation take longer. With a deadline to meet, the task is to pick the circuits and slots so that the deadline holds and the total area of the circuits we build is least. Fast circuits belong where time is short, and slow ones where there is time to spare.
Definition
The model is that of latency-constrained scheduling, with types replaced by a choice of modules.
Input.
- A sequencing graph with no cycle, and for each operation an operation kind , such as multiply or add.
- A library of modules. Each module implements one kind, has an integer delay and an area . Let be the modules of kind .
- A latency bound , an integer.
Feasible solutions. A module choice for each , and a schedule with for each edge and for each . Units are not pipelined and there is no chaining.
Objective. The design needs
instances of module . Minimize the area .
Decision form. Given the input and an area , is there a feasible choice and schedule with area at most ?
A feasible choice exists exactly when is at least the critical path computed with the fastest module of each kind, see the critical path method.
Variants
- Least latency under an area bound. Swap the roles: the area is bounded and the latency is minimized, as in resource-constrained scheduling.
- Pipelined modules. A pipelined module of latency accepts a new operation every step, so it is busy only in step .
- Shared multi-function units. An ALU implements several kinds at once. Then a module serves operations of different kinds, and the area count mixes kinds.
- Chaining and clock period. With operation chaining, modules have delays in nanoseconds, and the choice also decides which operations fit together in one clock period.
- Power and energy. The cost adds the energy per operation of each module, or the problem bounds the power per step.
Examples
Three multiplies and an add. Multiplies and feed an add , which feeds a multiply . The library has a fast multiplier with delay 1 and area 8, a slow multiplier with delay 2 and area 3, and an adder with delay 1 and area 1. The least area for each latency bound:
| least area | a best design | |
|---|---|---|
| 3 | 17 | two and one adder: in step 0, in step 1, in step 2 |
| 4 | 9 | one and one adder: in step 0, in step 1, in step 2, in step 3 |
| 5 | 7 | two and one adder: in steps 0 and 1, in step 2, in steps 3 and 4 |
| 6 | 7 | the same |
| 7 | 4 | one and one adder: , then , then , then |
Below nothing is feasible, since the path takes 3 steps even with . At , mixing and costs at least , more than reusing one . The cheapest design jumps from 9 to 7 at , where two slow multipliers fit, and to 4 at , where one slow multiplier does all three.
Known algorithms
- Integer programming. The ILP scheduling formulation extends to module choice with a 0-1 variable for each operation, module and start step. Exact, for small graphs.
- Start fast, then slow down. Ishikawa and De Micheli (1991) start from the fastest modules and replace them by slower, cheaper ones on operations with slack, as long as the latency bound holds. Heuristic.
- Scheduling with module choice. List and force-directed schedulers can try each module of an operation and keep the one that adds the least area. Heuristic. Schedulers based on system of difference constraints take a fixed choice and are run for several choices.
- Dynamic programming for chains. For a chain of operations of distinct kinds, the problem is a knapsack with integer delays, solved in time by the knapsack recurrence.
Bounds
Monotone in the latency. Any design feasible for is feasible for , so the least area does not increase as grows. The table above shows that it falls in jumps, from 17 to 9 in one step of , and not at every step.
Lower bound. Each kind used in needs at least one module, so the area is at least the sum, over the kinds, of the area of the smallest module of that kind. The example reaches this bound at .
Upper bound on useful latency. With operations and the slowest delay , running all operations one after another on the smallest module of each kind takes at most steps, so for the lower bound is reached.
Reductions
From latency-constrained scheduling. If each kind has exactly one module, module selection is latency-constrained scheduling, which is NP-hard. So module selection is NP-hard as well.
From knapsack, for a chain. Take a knapsack instance: items with values and weights , , a capacity and a target . Build a chain , where has its own kind with two modules: a fast one with delay 1 and area , and a slow one with delay and area 1. Set . Since each kind occurs once, every chosen module has one instance. Let be the set of operations that get the slow module. The chain fits in steps exactly when , and the area is . So the area is at most exactly when some set of weight at most has value at least . The instance has size polynomial in the input. The chain needs no scheduling decision, so the hardness comes from the module choice alone. The numbers appear as delays, and the dynamic program above is polynomial in , so this reduction shows NP-hardness in the weak sense only.
Applications
- Datapath synthesis. Every library offers several adders and multipliers, and synthesis tools choose among them per operation.
- FPGA flows. A multiply can go to a DSP block or to lookup table logic, which differ in delay and in the scarce resource they use.
- Codesign. At a coarser level, choosing between a hardware and a software version of a task is the same trade-off, see hardware-software partitioning.
References
- Masayoshi Ishikawa and Giovanni De Micheli, A module selection algorithm for high-level synthesis, IEEE International Symposium on Circuits and Systems, 1991, whole paper (module selection under a latency bound, starting from the fastest modules)
- Giovanni De Micheli, Synthesis and Optimization of Digital Circuits, McGraw-Hill, 1994, Chapters 5 and 6 (scheduling and binding when one operation type has several implementations)
- Michael R. Garey and David S. Johnson, Computers and Intractability, A Guide to the Theory of NP-Completeness, W. H. Freeman, 1979, Appendix A6, problem MP9, Knapsack
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 BXSS6G Edit this page History Report an error Markdown