Abstract
We describe algorithmic results on two crucial aspects of allocating resources on computational hardware devices with partial reconfigurability. By using methods from the field of computational geometry, we derive a method that allows correct maintenance of free and occupied space of a set of $n$ rectangular modules in time $O(n \log n)$; previous approaches needed a time of $O(n^2)$ for correct results and $O(n)$ for heuristic results. We also show a matching lower bound of $\Omega(n \log n)$, so our approach is optimal. We also show that finding an optimal feasible communication-conscious placement (which minimizes the total weighted Manhattan distance between the new module and existing demand points) can be computed with $\Theta(n \log n)$. Both resulting algorithms are practically easy to implement and show convincing experimental behavior.
Introduction
Modern reconfigurable hardware, such as Field-Programmable Gate Arrays (FPGAs), increasingly supports partial reconfiguration. This capability allows specific hardware modules—such as video decoders or cryptographic engines—to be swapped in and out while the remainder of the chip continues its operations. This dynamic environment presents a complex resource allocation challenge, akin to a real-time game of Tetris.
As modules of varying rectangular dimensions are added and removed, the chip's free space becomes fragmented. An operating system managing such hardware must efficiently solve two primary problems:
- Free-Space Management (FSM): Identifying available gaps large enough to accommodate a new module.
- Routing-Conscious Placement (RCP): Selecting a valid gap that minimizes communication costs (wire length) to other active modules.
Historically, solutions have struggled with either high computational complexity ($O(n^2)$) or unreliable heuristics that fail to find valid placements even when they exist.
Methodology
The proposed approach leverages advanced techniques from computational geometry to achieve optimal performance.
Geometric Problem Transformation
To determine where a new module $m$ of size $(w_m, h_m)$ can fit, the algorithm employs a geometric transformation. All existing modules are "expanded" by half the width and height of the new module, while the chip boundary is "shrunk" by the same amount. This transformation simplifies the search from finding a valid rectangular area to finding a valid point for the module's center.
Plane-Sweep and Segment Trees
The boundaries of these expanded modules are mapped using a plane-sweep algorithm. A vertical line scans the chip from left to right; as it encounters module edges ("events"), it updates a segment tree. This data structure efficiently tracks occupied vertical intervals, allowing the algorithm to maintain an accurate map of free space in $O(n \log n)$ time.
Manhattan Distance Optimization
To minimize communication costs, the authors optimize for the weighted Manhattan distance. They demonstrate that the optimal placement is typically located at the "weighted median" of communication partners. If that ideal point is occupied, the optimal feasible placement is proven to lie on the boundary (contour) of the free space.
Experimental Results
The algorithms were evaluated using benchmark instances involving 100 modules placed and removed on an $80 \times 120$ unit chip across various size distributions (Uniform, Increasing, and Decreasing).
- Computational Efficiency: The RCP algorithm demonstrated superior speed, averaging a running time of 170ms for 100 modules. This outperformed both the previous heuristic NAO (209ms) and the standard bin-packing approach KFF (200ms).
- Placement Quality: Routing costs were significantly reduced. In uniform distribution tests, RCP achieved a cost of 1403, compared to 3641 for NAO and 9522 for KFF.
- Utilization: RCP maintained a low rejection rate of 3.6%, matching the best existing methods while providing vastly superior placement quality.
Conclusion and Future Work
This research establishes that $O(n \log n)$ is the theoretical lower bound for these placement problems and provides an algorithm that meets this bound. While the current "online" model places modules as they arrive, future work could explore "offline" versions that look ahead to future requests for even better chip utilization. Additionally, extending the model to account for modules as routing obstacles—using geodesic Manhattan distance—would further enhance the practical applicability of these geometric methods in hardware design.
Summary updated