Feed-through river routing

Feed-through river routing

41 Feed-through river routing Amnon Joseph Department of Electrical Engineering9 Technion, Israel Institute of Technology, Haifa 32000, Israel Ron Y...

522KB Sizes 1 Downloads 104 Views

41

Feed-through river routing Amnon Joseph Department of Electrical Engineering9 Technion, Israel Institute of Technology, Haifa 32000, Israel Ron Y. Pinter IBM Israel Scientific Center, Technion Oty, Haifa 32000, Israel

Received 1 July 1988

Abstract. We propose a natural extension to river-routing in multiple, parallel channels which faithfully models connections among non-adjacent rows for routability and placement purposes. We devise an efficient algorithm for finding an optimal placement of the components (in the horizontal axis) that yields the minimal area in which routing of all nets is still possible with one layer when the channels' widths are given. Even though this algorithm has quadratic worst-case behaviour, its observed running time is linear. Finding the channels' widths that would achieve minimal area when only the sum of the widths is given has been previously proved to be an NP-complete problem (even for multiple channels without feed-throughs). Thus, we provide a heuristic for finding a "good" set of channels' widths for which the area would be reasonably close to optimal (which works well even when feed-throughs are allowed). We present experimental results.

Keywords. Data-path design, longest*path algorithms, one-layer routing.

1. Introduction In constructing a data-path, the components are arranged in rows and the bits pass from row to row in a fixed order. Therefore, it is possible to route the data-bits in one layer using river routing [4]. The data-flow, however, is not necessarily restricted to connections between adjacent rows in simple channels. We call this feed-through river routing, because wires must pass through gaps that are to be created between the components in each row, as shown in Fig. 1. Elsevier Science Publishers B.V. INTEGRATION, the VLSI journal 8 (1989) 41-50 0167-9260/89/$3.50 © 1989, Elsevier Science Publishers B.V.

42

A. Joseph, R. Y. Pinter / Feed-through river routing

A primary design goal is often to minimize the (overall or routing) area of the circuit (or some other monotonic function of its dimensions, the total width and the spread). As long as no feed-throughs are allowed, and when the width of each channel is given, a longest-path based algorithm can be used to find the lateral components' positions yielding the minimal spread of the circuit, as described in [4]. When only the sum of the widths is given, the problem becomes NP-complete [5] (unless there is exactly one component in each row [2]); minimizing the area altogether without any partial knowledge of the circuit's dimensions is no easier. In this paper, we address this problem when feed-throughs are present. On one hand, the longest-path based techniques can be extended to this new situation without loss of efficiency: we propose a way to model f e e d - t h r o u g h s so that the area between adjacent components (in the same row) can be fully utilized, and at the same time the flexibility of the routing within each channel is not impaired. Thus, a true optimum is obtained. Further, we propose a hybrid algorithm for computing the single-source longest-paths of the placement graph that is constructed. The portions of the graph that can be processed by a single pass are dealt with in linear time; those that have more complicated structure are identified and then handled by a quadratic time algorithm. This algorithm applies to the feed-through free case as well. Experiments have revealed that the more complex structures constitute a relatively small portion of a typical placement graph, hence the observed complexity is linear.

Joseph received the B.Sc. and M.Sc. degrees in Electrical Engineering from the Technion, Israel Institute of Technology, Haifa, in 1983 and 1987, respectively. During 1983-1985 he was a staff engineer with the Israel Aircraft Industry. In 1988 he joined NCR Israel where he is currently working as a microelectronics engineer. His research interests include layout algorithms for integrated circuits and the design of digital systems. Amnon

received the B.Sc. degree in Computer Science from the Technion, Israel Institute of Technology, Haifa, in 1975, and the S.M. and Ph.D. degrees in Electrical Engineering and Computer Science from the Massachusetts Institute of Technology, Cambridge, in 1980 and 1982, respectively. During 1982-1983, he was a Member of the Technical Staff in the Computing Sciences Research Center, AT&T Bell Laboratories, Murray Hill, NJ. In December 1983, he joined the IBM Israel Scientific Center, where he is the manager of the Programming Languages Group. He is also an Adjunct Senior Lecturer in the Electrical Engineering Department at the Technion, and has taught at the Hebrew University, Jerusalem. For the academic year 1988/89, Dr. Pinter is visiting the Department of Computer Science, Yale University, New Haven, CT. His research interests include parallel programming techniques, code generation algorithms, layout for integrated circuits, and computational geometry. Dr. Pinter is a member of the Association for Computing Machinery, ACM SIGPLAN, and the IEEE Computer Society. Ron Y. Pinter

43

A. Joseph, R. Y. Pinter / Feed-through river routing 1

11

12

13

]

Fig. 1. Multiple, parallel channels with feed-throughs between components.

Finally, we suggest an efficient and well performing heuristic algorithm for assigning widths to the individual channels such that the overall area is minimized. Again, this algorithm applies both for the case in which feed-throughs are present as well as for when they are not used. The major application for our algorithms is for synthesizing data-paths. It can be used also for routing signals from drivers to the internals of a circuit and for stylized compaction purposes. Moreover, the feed-through modelling technique can be applied to the case in which the components are not horizontally aligned and the area outside the "smooth" channel can be used effectively. Section 2 reviews some necessary preliminaries and provides the extensions necessary for modelling feed-throughs. The hybrid algorithms for solving the longest-path problem is presented in Section 3, and the channels' widths assignment heuristic is given in Section 4. We conclude in Section 5 with an evaluation of the results and open problems.

2. Modelling We follow the notation of [4]. The components are given row by row, and the terminals on (the bottom and top of) each component are specified relative to its left edge. Feed-throughs are listed between components in the appropriate place in each row. Since nets are identified implicitly (as induced by their order of appearance along each channel), feed-throughs are unambiguously associated with the terminals (or other feed-throughs) that they are adjacent to in both channels. Seemingly, this way a topological decision must be made as to the h o m o t o p y class of each feed-through. This decision, however, can be fully deduced from the planarity of river-routing in channels: the only situation in which a wire can go around a component in more than one way is if the component has no terminals on it, which does not make sense for any application one may imagine. For placement purposes, each component is modelled by a vertex. An edge is drawn between two components if they are consecutive in a row, or when a routability condition between them (across a channel) needs to be expressed. Recall that a routability constraint has the form ai+ t - b~ >~ t, where the a ' s and

44

A. Joseph, R.Y. Pinter / Feed-through river routing

(a) two chaanels with feed-throughs

(b) The graph modelling the above layout problem (weights are omitted for clarity) Fig. 2. Modelling feed-throughs. (a) Two channels with feed-throughs. (b) The graph modelling the layout problem shown in (a).

b's are terminal location variables that are then translated to component variables, and the new right hand side of the inequality is used as the weight of the cross edge. The question, then, is how to model feed-throughs. The objective is to use the area between components effectively for feed-through wiring purposes and maintain flexibility with respect to the channels at the same time. This can be achieved by modelling each feed-through as two pseudo components, one facing each bordering channel, but have these components be of zero height so that minichannels are created between the components. The routability inside these minichannels can be easily modelled by cross edges that are derived from the height of the components. The pseudo components are also l-long, so as to maintain proper spacing among them (and the terminals themselves sit on the left end, to conform with [4]), and this is reflected by appropriate chains of edges. This modelling is exemplified in Fig. 2. Notice that now all the routability considerations are modelled in one system of constraints that can be solved simultaneously using a longest-path algorithm, obtaining an overall optimum.

A. Joseph, R. Y. Pinter / Feed-through river ~outing

45

3. The longest-path algorithm

We follow the formulation of the algorithm by Bellman and Ford [3] as rendered in [4]: let ~(v) denote the longest path found so far from the source, v0, to v. Initially, set X ( v 0 ) ~ 0 and for all other vertices X ( v ) ~ - o o . Then sequence through a list L of edges, and for each edge e = (v, u) with weight w (e) update X(u) according to the rule X(u) ~ max(?~(u), w(e) + X(v)) until all path-lengths are correct. For an arbitrary weighted graph G = (V, E, w) the list L consists of [ V I copies of E (and this is enough also to detect positive cycles). We show now that this duplication is not necessary for the entire set E but rather only for (typically small) parts of it. The graphs generated by data-path layout problems as above have the following special structure: a number of chains from the source, representing the left margin, to the sink, representing the right margin, and then cross edges among adjacent chains. The mini-channels modelling feed-throughs may split the affected chains into two parallel subchains, but this does not change the overall left-to-right nature of these edges. The only way cycles can be created in the graph is when cross edges are in a certain configuration. Such cycles, however, are rare, and it seems advantageous (both didactically and complexity-wise) to deal with the cycle-free case first and then make accommodations for cycles. For a directed acyclic graph, L need comprise only one properly sorted copy of E [3]. The list L is created implicitly, destroying E - - o r a copy thereof--in the process. We also use a set of vertices U which at any given point in time contains those vertices all of whose outgoing edges can be processed and then deleted. The longest path algorithm is then as follows:

u , - (v0) while U is not empty do pick any vertex v from U for all outgoing edges (v, u) leaving v do •(u) ~ max(?~(u), w(e) + ~(v)) delete (v, u) from E if ther~ ~ e no more edges entering u then add u to U end end

Notice that any vertex whatsoever can be picked from U, thus no special order needs to be maintained; the observed order of vertices entering and leaving the set U is induced by their order of appearance in the chains and the order in which the tails appear in the chains (for cross edges). The above procedure amounts to performing a single scan of the edges, where each edge is processed exactly once and also the total number of tests for no

A. Joseph, R. Y. Pinter // Feed-through rioer routing

46

incoming edges is also equal to [E I- An edge-list data structure with no additional provisions can support all the necessary operations (including the test whether there are no incoming edges to u which amounts to testing whether the list-pointer is null). Furthermore, the special structure of the graph as explained above also implies that E = O( I V I), since E can be viewed as the union of two planar edge sets over I1. Hence the overall complexity of computing the longestpath in the cycle-free case is O( I V I). Cycles need to be both detected and processed. The strategy is as follows: find a vertex on a cycle as soon as the set U becomes empty, explore the cyclic portion of the graph, reinstate U and then keep going until we encounter the next cycle, spending quadratic time only on the cycles. We now explain each of these three steps: • Detection is easy thanks again to the structure of the graph as induced by the routability constraints which guarantees the following: Any cycle contains a subcycle of length 2. Furthermore, this 2-cycle is between two vertices on adjacent chains which are each the leftmost vertex on that chain which is involved in the cycle. We maintain a frontier consisting of the right-most vertex that was processed so far along each chain. Thus, when necessary, pairs of adjacent vertices in the frontier are checked for forming a 2-cycle. • Cycles are explored using a depth-first-search (DFS) [1] on the reversed edges. The vertex that was picked in the previous step serves as the root, and all the vertices that are reached by the DFS (and the induced edges) constitute a Table 1 The relative size of barriers No. of rows

No. of blocks (components)

No. of feed-throughs (FT)

No. of edges in barriers

Total no. of edges in placement graph

% of edges in barriers

4 3 3 4 7 7 7 10 11 11 10 11 9 12 8 7 9 7 10

12 9 11 20 25 29 28 44 46 43 38 35 37 40 32 28 35 30 44

4 1 0 4 12 13 13 13 16 20 12 13 14 20 14 8 14 10 13

396 136 80 265 1357 1568 5157 6342 1777 1920 5315 2221 2053 1097 3753 2083 2072 1813 2287

1060 523 266 2317 24869 35818 57013 69189 21338 13467 57387 15431 56443 50727 30803 56443 56400 25313 36838

37.3 26 30 11 5.4 4.3 9 9.1 8.3 14.2 9.2 14.3 3.6 2.1 12.1 3.7 3.6 7.1 6.2

A. Joseph, R. Y. Pinter / Feed-through river routing

47

subgraph called a barrier. It is easy to prove that the barrier contains all the edges on paths to members of the frontier. Hence, performing a full-fledged Bellman-Ford procedure on the barrier would resolve the stalemate. It is also at this stage that positive cycles are detected and the whole procedure may terminate with failure to satisfy the routability constraints for the given set of channels' widths. • A new frontier can now be defined as the set containing the right-most barrier-vertex in each chain. After the barrier has been processed, U can be defined as this new frontier, and we proceed with the linear-time scan given above until we encounter the next cycle or until the whole graph is explored. The worst-case time complexity of this algorithm is indeed quadratic (it is easy to construct graphs with barriers of size $2( IV 1)), but the super linear portion of the complexity is proportional to the sum of the squares of the barriers' sizes. In order to quantify this phenomenon, we have randomly generated several feedthrough layout problem, and analyzed the corresponding graphs. The results are displayed in Table 1 and show that the number of edges involved in barriers is usually well under 15% of ]E I (unless the graph is trivially small). Moreover, as the graph grows this percentage tends to go down.

4. The channel-spacing heuristic Rather than starting with a given sum that needs to be divided among the channels, we present here a procedure for finding a legal assignment of widths that yields a small overall area. The considerations that need to be taken into account in determining the widths of the channels are as follows: (1) The number of nets crossing each channel. (2) The interaction between minimizing the widths' of adjacent channels. Clearly, if the width of a channel is the number of nets crossing it, then it can be routed. We use this width as an initial value and decrease it as long as routability is not violated. However, it is not advisable to "squeeze" one channel all the way at the expense of setting up its neighbours in such a way that their widths will have to be large due to the resulting placement of their common components. Hence, we proceed gradually from one channel to the next, exerting one small squeeze at a time, iterating the process over all the channels until an overall minimum is approximated. There are several ways in which the width of one channel can be minimized, such as a binary search, single-stepping, or any other way. Our idea is to apply one (successful) step of the minimization procedure and then move on to the next channel; after all channels were treated, we iterate until no further improvement is possible. Here is an outline of one possible version of the heuristic, which uses a binary search as the update rule, and scans the channels from the topmost to the lowest. t denotes the widths vector (of length k, the number of channels), and n i is the number of nets crossing channel i (including feed-throughs).

A. Joseph, R. Y. Pinter / Feed-through river routing

48 t ~-- ( n 1. . . . . nk)

s * ~ the area obtained by applying the longest-path algorithm to the configura. tion given by t until --1 progress do progress ~ false for i ~ 1 to k do ti ~ ti/2

A: s ~ the area obtained by applying the longest-path algorithm to the configuration given b y the new t if there is no feasible solution then do t i ~-- 3 t i / 2

goto A end if s < s* then do S*~-- S

progress ~ true end end end

Fig. 3. The result of applying the channel-spacing heuristic on a data-path with 6 channels and 29 components.

A. Joseph, R. Y. Pinter / Feed-through river routing

49

This version was found to be most effective when compared to using single decrements in width (i.e. t i ~ t i - 1) and to treating the channels in order of decreasing (or increasing) current widths (rather than going top to bottom), both in terms of running time and quality of results. An example for the results obtained by running this heuristic are shown in Fig. 3. When applying it to small problems, for which the entire set of widths vectors could be explored in order to obtain the true optimum, the heuristic indeed found this optimum.

5. Conclusions

We have presented fast algorithms for obtaining area efficient layouts for horizontally aligned rows of components with river routing (including feedthroughs). When the channels' widths are given, an optimal area layout can be obtained in time that is closer to linear than to quadratic, as substantiated by a careful decomposition of the problem and experimental data which validates it. When the widths are not given, the minimal area can be effectively approximated by a heuristic algorithm that in fact provides a framework for several possible variations. The modelling technique of Section 2, and hence the algorithm of Section 3, can be further extended to deal with components that are known to be at a fixed height above the base-line of their respective row: we define pseudo components (of length 1 and height 0) lying on the base-line itself, as we did for feed-throughs, and establish a mini-channel between the base-line and the actual component. This again yields maximal utilization of the slack area, as with feed-throughs. More importantly, we believe that the hybrid longest-path (or the equivalent shortest-path) procedure of Section 3 can be used in other settings as well, reducing the running time for graphs with arbitrary edge weights and a relative small number of edges that are involved in cycles. Such graphs may be found in other application areas, such as simulation and scheduling. Finally, there remains one major open problem: can the linear time placement algorithm of [4], which applies to a single channel, be extended to the multiple channel case (with or without feed-throughs)? Even though cycles can occur in one channel, they are still handled by a single pass due to their very special structure; we could not extend the necessary properties to multiple channels (especially since cycles can span several chains in tricky ways) and even a worst-case sub-quadratic algorithm would be nice to have.

References

[1] Even, S., Graph Algorithms (Computer Science Press, Rockville, MD, 1979). [2] Heng, F.-L., and A.S. LaPaugh, Optimal compaction of multiple two-component channels under fiver routing, CS-TR-068-86, Princeton University, December 1986.

50

A. Joseph, R.Y. Pinter / Feed-through river routing

[3] Lawler, E.L., Combinatorial Optimization--Networks and Matroids (Holt, Reinhart, and Winston, New York, 1976). [4] Leiserson, C.E., and R.Y. Pinter, Optimal placement for river routing, SIAM J. Comput. 12(3) (August 1983) pp. 447-462. [5] Pinter, R.Y., The impact of layer assignment methods on layout algorithms for integrated circuits, Ph.D. Dissertation, Massachusetts Institute of Technology, September 1982.