General channel-routing algorithm

6
General channel-routing algorithm M. Marek-Sadowska, M.S., Ph.D., and E.S. Kuh, B.S., S.M., Ph.D., Fel. I.E.E.E. Indexing term: Algorithms Abstract: A new approach to the 2-layer channel-routing problem is introduced. The method allows hori- zontal and vertical connections on both layers. An order graph similar to the traditional vertical constraint graph is used in the algorithm. The main advantage is that the method is general and is immune to cyclic constraints. Furthermore, the channel width does not have a lower bound equal to the maximum density. 1 Introduction 2-layer channel routing is one of the key elements in the automatic layout design of VLSI circuits. In the traditional approach of channel routing, one layer is used exclusively for horizontal connections and the other is used exclusively for vertical connections [1, 2]. Via holes are used for intercon- nections between layers. The present paper takes a new look at the problem by allowing horizontal and vertical connections on both layers. Thus, the only restrictions are that, on each layer, nets must not intersect and must not overlap on the same horizontal or vertical track. With this flexibility, the vertical constraint graph associated with the given net list is no longer required to be acyclic. Furthermore, the channel width is not bounded by the maximum density over the channel. 2 Basic approach The problem can be specified by a net list defined on a hori- zontal channel. Nets which are to connect terminals on two sides of a channel are to be routed using horizontal and vertical tracks on two layers. A number between 0 and N is assigned to each terminal. Terminals with the same number / (1 </<JV) are to be connected by net / and terminals with number 0 are left unconnected, as shown in Fig. 1. Our objective is to route all the nets using a minimum number of horizontal tracks. We assume that all top terminals are available on layer 1 and all bottom terminals on layer 2. Our basic approach depends on the classification of nets according to their therminal positions. We assume first that all nets are 2-terminal nets. As will be shown later, multiterminal nets can be decomposed into 2-terminal subnets. Thus, our treat- ment is general. In Fig. 1 we show the five basic types of 2- terminal nets and their connections. Continuous lines represent connections made on the first layer, and discon- tinuous lines represent those on the second layer. As seen in the Figure, type-A and type-B nets require the use of two via holes each, while the others require only one via. To be more precise, the following definitions are given: Type-A net: both terminals are on top side of a channel. Type-B net: both terminals are on the bottom side of a channel. Type-C net: both terminals are on the same vertical track. Type-D net: one terminal is on the bottom side of the channel and the other is on the top side; the lower terminal is to the left of the upper terminal. Type-E net: one terminal is on the bottom side of the channel and the other is on the top side; the lower terminal is to the right of the upper terminal. The proposed method of routing takes advantage of the five basic types of nets and routes the nets top down according to a definite order. The method places special emphasis on the horizontal segment of each net. Thus, when we say that the routing order of nets is top down, we refer to the horizontal segments of the nets. When horizontal segments overlap, we assign them to different tracks. In the following, we discuss the necessary ordering of the five types of nets. I IZJ 1ZTZI 1 0 1 5 3 4 0 Fig. 1 Five different types of 2-terminal nets Net 1: type B, net 2: type A, net 3: type C, net 4: type D and Net 5: type E Paper 2430G, first received 7th June 1982 and in revised form 4th January 1983 The authors are with the Department of Electrical Engineering & Computer Sciences and the Electronics Research Laboratory, Uni- versity of California, Berkeley, CA 94720, USA. Dr. Marek-Sadowska is on leave from the Institute of Electron Technology, Technical Uni- versity of Warsaw, Poland Fig. 2 Nets of type A showing routing in any order Order 1, 2; Order 2, 1 In either case, routing can be completed with no intersection on same layer Let us first consider nets of the same type. If all nets which have horizontal overlaps are of type A, then nets can be routed in any order without blocking each other. This is illustrated in Fig. 2. where only continuous and discontinuous lines cross each other independent of the routing order. The same argument can be given to type-B nets. Consider next two type-D nets, with horizontal over- lapping, as shown in Fig. 3. While Fig. 3a gives a good solu- tion, Fig. 3b leads to an intersection on the second layer. A correct order is to route first the net which has its lower terminal farthest to the left. Thus, the top-down ordering IEEPROC, Vol. 130, Ft. G, No. 3, JUNE 1983 83

Transcript of General channel-routing algorithm

Page 1: General channel-routing algorithm

General channel-routing algorithmM. Marek-Sadowska, M.S., Ph.D., and E.S. Kuh, B.S., S.M., Ph.D., Fel. I.E.E.E.

Indexing term: Algorithms

Abstract: A new approach to the 2-layer channel-routing problem is introduced. The method allows hori-zontal and vertical connections on both layers. An order graph similar to the traditional vertical constraintgraph is used in the algorithm. The main advantage is that the method is general and is immune to cyclicconstraints. Furthermore, the channel width does not have a lower bound equal to the maximum density.

1 Introduction

2-layer channel routing is one of the key elements in theautomatic layout design of VLSI circuits. In the traditionalapproach of channel routing, one layer is used exclusively forhorizontal connections and the other is used exclusively forvertical connections [1, 2] . Via holes are used for intercon-nections between layers. The present paper takes a new lookat the problem by allowing horizontal and vertical connectionson both layers. Thus, the only restrictions are that, on eachlayer, nets must not intersect and must not overlap on thesame horizontal or vertical track. With this flexibility, thevertical constraint graph associated with the given net list isno longer required to be acyclic. Furthermore, the channelwidth is not bounded by the maximum density over thechannel.

2 Basic approach

The problem can be specified by a net list defined on a hori-zontal channel. Nets which are to connect terminals on twosides of a channel are to be routed using horizontal andvertical tracks on two layers. A number between 0 and N isassigned to each terminal. Terminals with the same number/ (1 < / < J V ) are to be connected by net / and terminals withnumber 0 are left unconnected, as shown in Fig. 1. Ourobjective is to route all the nets using a minimum number ofhorizontal tracks. We assume that all top terminals are availableon layer 1 and all bottom terminals on layer 2.

Our basic approach depends on the classification of netsaccording to their therminal positions. We assume first that allnets are 2-terminal nets. As will be shown later, multiterminalnets can be decomposed into 2-terminal subnets. Thus, our treat-ment is general. In Fig. 1 we show the five basic types of 2-terminal nets and their connections. Continuous linesrepresent connections made on the first layer, and discon-tinuous lines represent those on the second layer. As seen in

the Figure, type-A and type-B nets require the use of two viaholes each, while the others require only one via. To be moreprecise, the following definitions are given:

Type-A net: both terminals are on top side of a channel.Type-B net: both terminals are on the bottom side of a

channel.Type-C net: both terminals are on the same vertical track.Type-D net: one terminal is on the bottom side of the

channel and the other is on the top side; the lower terminalis to the left of the upper terminal.

Type-E net: one terminal is on the bottom side of thechannel and the other is on the top side; the lower terminalis to the right of the upper terminal.

The proposed method of routing takes advantage of the fivebasic types of nets and routes the nets top down according toa definite order. The method places special emphasis on thehorizontal segment of each net. Thus, when we say that therouting order of nets is top down, we refer to the horizontalsegments of the nets. When horizontal segments overlap, weassign them to different tracks. In the following, we discussthe necessary ordering of the five types of nets.

I IZJ

1ZTZI

1 0 1 5 3 4 0

Fig. 1 Five different types of 2-terminal nets

Net 1: type B, net 2: type A, net 3: type C, net 4: type D and Net 5:type E

Paper 2430G, first received 7th June 1982 and in revised form 4thJanuary 1983The authors are with the Department of Electrical Engineering &Computer Sciences and the Electronics Research Laboratory, Uni-versity of California, Berkeley, CA 94720, USA. Dr. Marek-Sadowskais on leave from the Institute of Electron Technology, Technical Uni-versity of Warsaw, Poland

Fig. 2 Nets of type A showing routing in any order

Order 1, 2; Order 2, 1In either case, routing can be completed with no intersection on samelayer

Let us first consider nets of the same type. If all nets whichhave horizontal overlaps are of type A, then nets can be routedin any order without blocking each other. This is illustrated inFig. 2. where only continuous and discontinuous lines crosseach other independent of the routing order. The sameargument can be given to type-B nets.

Consider next two type-D nets, with horizontal over-lapping, as shown in Fig. 3. While Fig. 3a gives a good solu-tion, Fig. 3b leads to an intersection on the second layer. Acorrect order is to route first the net which has its lowerterminal farthest to the left. Thus, the top-down ordering

IEEPROC, Vol. 130, Ft. G, No. 3, JUNE 1983 83

Page 2: General channel-routing algorithm

for type-D nets must follow the order of the lower terminalsfrom left to right. Again, using a dual argument, we canstate that the proper ordering for type-E nets is to followthe order of the upper terminals from right to left, as shownin Fig. 4.

I2 | 6

i

I Iv

Fig. 3 Nets 1 and 2 both type-D nets

If net 1 is routed before net 2, then routing is completed withoutintersections on the same layer. If net 2 is routed first, then segmentsof different nets intersect on the same layer, which is not allowed

edge (vh Vj) 6 E iff net vt and net Vj overlap horizontally, andthe horizontal segment of vt must be placed above that of v-}

according to the rules discussed above. It is also clear that theorder-graph Go, different from the traditional vertical con-straint graph, is always acyclic. The basic idea is to route thenets top down by following the order-graph (7O. Thus, netscorresponding to those vertices without ancestors are selectedfirst to pack the first horizontal track as densely as possible.This can be done with the left-edge algorithm [3]. Once anet is routed, its corresponding vertex is deleted from Go

together with its incident edges, to form a reduced ordergraph. At the completion of the routing for the first hori-zontal track, we consider the reduced order-graph for routingthe second horizontal track. The procedure continues until allnets are routed, or, equivalently, the reduced order graph isempty. Before we give the algorithm, let us first consider theproblem of multiterminal nets.

i

1

i i ( • —

^ ,r

?iii

K *

Fig. 4 Nets I and 2 of type E

a Net 2 to be routed before net 1b Incorrect order, leading to intersection on first layer

Next, we consider nets of different types. The relationbetween a type-A and a type-D net with horizontal overlapis shown in Fig. 5. It is clear that, in general, type-A netsshould be routed before type-D nets in order to avoid anintersection on the same layer, as shown in Fig. 5b. However,this can be sometimes relaxed, as noted in the caption of Fig.5. Similarly, using a dual argument, we can show that sometype-E nets must be routed before type-B nets.

In Fig. 6, we illustrate the relation between a type-A netand a type-C net. The proper order is to route type-A netsbefore type-C nets.

Although there are other combinations to be tested, wecan easily conclude that the proper top-down ordering fornets of different types is A-D-C-E-B. With this order, therewill be no intersections on either layer.

The above discussion suggests a simple algorithm which isbased on an order-graph Go. Go = (V, E) is a digraph whosevertices correspond to all the 2-terminal nets given. A directed

\

Fig. 5 Net I type A, Net 2 type D

a, b First terminal of net 2 between terminals of net 1. As shown,net 1 to be routed before net 2c, d First terminal of net 2 to left of net 1 - either order correct

i \

Fig. 6 Net 1, type A: net 2, type C

a Correct routing, i.e. type-A net to be routed before type-C net.(Note horizontal segment of type-C net degenerated to a point, thevia)b Incorrect routing

84 IEE PROC, Vol. 130, Pt. G, No. 3, JUNE 1983

Page 3: General channel-routing algorithm

3 Multiterminal nets

It is easy to show that any multiterminal net can be decom-posed into 2-terminal subnets, as shown in Fig. 7. We use thefollowing rules in the decomposition:

(i) Two terminals are assigned to the same subnet if theyare in the nearest vertical tracks.

(ii) If there exist two terminals on the same vertical track,then they form a type-C subnet.

(iii) Whenever a choice exists because of the presence of atype-C subnet, use type-A and type-B subnets rather thantype-D and type-E subnets, [see Fig. 7 example, because of

X

1

X

a

X

X

bX

t

X

X

*

•X

C

X

X

dX

X

e

X

X

X

X

X

•i—

X

f

gX

4

I

X

hX

X

Fig. 7 Multiterminal net decomposition

Terminals a, b, c, d, e, f, g and /) form net, divided into 2-terminal sub-nets: (a, b), (b, c), (c, e), (d, e), (e, f), (J, g) and (g, h)

I 2 4 0 3 2 5 0 6 817 7 6 I8 5I9O 0 0 0 7 I5I4I9I3 12 OOOO 9 81413 10XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

17 13

18

4o 4b

15

19

12

IOo 10b

14

9

10c

16

20 Ma lib

8a 8b 8c

XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXX

17 30180 0 4 I 160 160 0 4 0151210 0 0 108 0 0 8 9 100 II 0 II 0 II20 20

Fig. 8A Net list specification for channel and horizontal segments ofsubnets

the presence of type-C subnet (d, e). type-B subnets (c, e)and (e, f) are used rather than (c, d) and (d, / ) ]

4 Routing algorithms

The basic routing algorithm is summarised below:

Algorithm 1Step 0. Track number = 0.Step 1. Decompose nets into subnets.Step 2. Assign each subnet into appropriate class.Step 3. Obtain order-graph Go.Step 4. Find all subnets which correspond to vertices in G"o

with no ancestors. This is the set 5 of subnets which can beplaced on the next track.

Step 5. Apply left-edge algorithm to subnets in 5; let thenets chosen be the set Sx, where S\ C 5.

Step 6. Track number = track number + 1.Step 7. Route subnets in 5, on current track.Step 8. Remove vertices corresponding to S{ from Go

together with incident edges, to obtain reduced order-graphGo-

Step 9. Are there any vertices left in (7O? If yes, go to step4. if not, go to Step 10.

Step 10 End of algorithm.

We give an example as shown in Fig. 8. Fig. 8a shows the netlist of the channel, together with the horizontal segments ofnets and subnets. Fig Sb shows the order-graph Go. Thealgorithm goes through the following iterations:

Iteration \:S = {2, 17,5, 14,6, 13, 19,7}5, = {17,7, 14}*-track 1

Iteration 2:5 = {2,5,6, 13, 19}St = {2,5, 19, 13}^-track 2

Iteration 3:S = {3,6,15,8c}Sy = {3,6, 15, 8c}*-track 3

Iteration 4: S = {18, 12,9}Sx = {18, 12,9}*-track 4

Iteration 5:5 = {4a, 8a, 8b, 10a, 106, 10c, 20}5! = {4a, 8a, 8b. 10<?} <- track 5

Fig. 8C Graph Co after two iterations of algorithms

IKE PROC, Vol. 130, Pt. G, No. 3, JUNE 1983 85

Page 4: General channel-routing algorithm

Iteration b:S = {1 , 16, 46, 10a, 106, 1 la, 1 16, 20}S, = {1,16, 10a, 106, l l a , 116}*-track 6

Iteration 1:S = {46,20}Si = {46, 20}«- track 7

Fig. 8/shows the realisation obtained by the basic algorithm.It is seen that a total of seven tracks is used in the realisation.The maximum density for the given net list is also seven.

In algorithm 1, all the steps, with the exception of step 3,are quite straightforward. In step 3, we need a simple algorithmto generate the order graph Go. This is given as follows:

Algorithm 2Step 1. Find all edges in Go which connect type-D nets

(vertices).Step 2. Find all edges in Go which connect type-E nets

(vertices).Step 3. Find all type-D vertices which do not have descend-

ants, call the set {Y}; and all type-E vertices which do not haveancestors, call the set {X}.

In the currently generated graph, add an edge from y{ 6 Yto XjEX if horizontal segments corresponding to v,- and Xjoverlap.

Step 4. Add type-A, C and B vertices to the graph applyingthe rules previously discussed, i.e. to follow the order A-D-C-E-B.

5 Modification of basic routing algorithm

The objective of the channel-routing problem is to minimisethe channel width, i.e. the number of horizontal tracks

required for realising the given net list. The proposed basicalgorithm gives a realisation with a channel width which hasa lower bound equal to the length of the longest path of theorder-graph Go. In this Section, we will introduce somemodifications to the basic algorithm to reduce further thechannel width. Instead of giving the detailed algorithms, weillustrate our ideas with the following example. In Fig. 9athere are four type-D nets; the order graph is shown in Fig. 96.The number of horizontal tracks required using the basicalgorithm is equal to four. In Fig. 9c we demonstrate thepossibility of introducing jogs at the two black dots; thus nets2 and 3 can be divided into segments 2', 2", 3' and 3". Thecorresponding order graph becomes that of Fig. 9d with alongest path length equal to two. Fig. 9e shows the routingwith jogs, which requires only two horizontal tracks.

Another useful modification deals with via placement. Theidea is that, by moving the actual position of a via, it is some-times possible to reduce the channel width; this is illustratedwith the same example, as in Fig. 9. In Fig. 10, we show that,by moving the vias of nets 1 and 2, it is possible to realise theproblem in Fig. 9a with only one horizontal track.

These modifications have been added to the basic algorithm.In the current version of the program, vias are shifted to theirmost opposing positions on the horizontal track withoutcreating blockages for subnets to be routed subsequently.Each net is pushed as far to the top of the channel as possible.The actual via position is chosen between the feasible extremeleft and right positions. Fig. 11 illustrates an example. Here wehave to route a D-type net, and three consecutive terminals tothe left from terminal T2 of this net have been already routed.

Fig. 8D Graph Go after three iterations

Fig. 8E Graph Go after four iterations

8 17 7 6 18

T5 19 0 0 0 0

: x x x x x7 15 14 19 13 12 0

< x x

r"

0 0 0 9 8 14 13 10X X X X .1

X X X X

1

< X

?1X X X

yI11

X

1i

111

X X X

11

111

X

11

111

x ; X X X

4 I 16 0 16 0 0 4 0 15 12 10 20 O 20 0 10 8 0 O 8 9 10 0

Fig. 8F Channel routed, applying algorithm

86

I IX X X

II 0 II

IEEPROC, Vol. 130, Pt. G, No. 3, JUNE 1983

Page 5: General channel-routing algorithm

It allows us to place via for the currently routed net at anyposition between T2 and T5. If the last occupied track is onthe first layer, we route the net as shown in Fig. 1 \c. If thelast occupied track is on the second layer, the net is routed,as in Fig. 1 Id. This allows the usage of horizontal tracks onboth layers more effectively. In Fig. 12, we show the resultsof routing the example in Fig. 8 after modifications. It isseen that the channel width is reduced to six, although themaximum density for the problem is seven.

6 Conclusion

The basic algorithm, together with modifications, has beenimplemented. The program has been tested with variousexamples. These are shown in Figs. 13—15. As seen from thefigures, the results are mixed. Whereas in one case, the realis-ation leads to a channel width less than the maximum density,in others, the results are inferior to earlier methods.

The main contribution of this paper is that we have departedfrom the traditional approach to the 2-layer channel-routingproblem and demonstrated the enormous flexibility in routing.The order graph introduced resembles the vertical constraint

T5T4T3T2

Fig. 11A Net to be routed

T5 T2

x )fII

o I

Fig. 11B Via pushed to the most opposing position

T5 T2 T5 3 T2X X -

1i

x xI 2

Fig. 9A Nets routed without jogs, channel width = 4

h

Figs. 11C and D Actual via position adjusted to current situation inchannel

Fig. 9B Ordergraph for case without jogs, length of longest path = 4

X X X

I 2

2 4x x

3"

ix4

X X X

3

Fig. 9C Dots show positions of possible jogs

Fig. 9D Ordergraphs for net list with jogs, length of maximum path

X X X X X X

I 2 3X X X

4

Fig. 9E Routing with jogs, channel width = 2

1 2 4 3x x x *

2 4* x x

* X X X

I 2X X

3

Fig. 10 Example from Fig. 9A routed with floating via approach.Number of tracks becomes one

Fig. 12 Example of Fig. 8 in six tracks (density = 7) routed withmodifications to basic algorithm

Fig. 13 Example 1 in Reference 2

Maximum density = 12, tracks = 1 1

Fig. 14 Example 4b in Reference 2

Maximum density = 17, tracks = 18

Fig. 15 Difficult example in Reference 1

Maximum density = 19, tracks = 24

IEEPROC, Vol. 130, Pt. G, No. 3, JUNE 1983 87

Page 6: General channel-routing algorithm

graph in the traditional approach; yet with the order-graph,there exist no cyclic constraints. It is manifestly possible tocombine the method proposed here and the method ofmerging vertices on the vertical constraint graph introduced inReference 2. This will be left for future research.

7 Acknowledgments

The authors wish to acknowledge a number of useful sugges-tions of the reviewers. The research was sponsored by NationalScience Foundation Grant ENG-78-24425 and the Air ForceOffice of Scientific Research (AFSC) United States Air Forceunder Contract F49620-79-C-0178.

8 References

1 DEUTSCH, D.N.: 'A dogleg channel router'. Proceedings of 13thdesign automation conference, 1976 pp. 425-433

2 YOSHIMURA, T., and KUH, E.S.: 'Efficient algorithms for channelrouting'. Electronics Res. Lab. M80-43, University of California,Berkeley, Aug. 1980., IEEE Trans., 1982, CAD-1, pp. 25-35

3 HASHIMOTO, A., and STEVENS, J.: 'Wire routing by optimizingchannel assignment within large apertures'. Proceedings of 8thdesign automation workshop, 1971, pp. 155-169

4 MAREK-SADOWSKA, M., and KUH, E.S.: 'A new approach tochannel routing'. Electronics Res. Lab. M81-95, University ofCalifornia, Berkeley, Dec. 1981., Proceedings IEEE IS ACS, Rome,1982, pp. 764-767

Malgorzata Marek-Sadowska received theM.S. degree in applied mathematics andthe Ph.D. degree in electrical engineeringfrom the Technical University of Warsaw,Poland, in 1971 and 1976, respectively.In 1971, she joined the Technical Uni-versity of Warsaw, where she was ap-pointed Assistant Professor in 1976. Shespent the academic year of 1974 to 1975on leave at the Pennsylvania State Uni-versity as a research assistant. From

October 1979 to July 1980, she was a Visiting Lecturer atthe Electrical Engineering and Computer Sciences Depart-ment at the University of California, Berkeley, and wasResearch Engineer at the Electronics Research Laboratory,University of California, Berkeley. She spent the spring quarterof 1981 with the Electronics Research Laboratory at Berkeley,and has been there more recently since August, 1982. Herresearch interests are in computer-aided design of integratedcircuits, with particular emphasis on layout.

Ernest S. Kuh was born in Peking, China,in 1928, and attended Shanghai Jiao-tong University from 1945 to 1947. Hereceived the B.S. degree from the Uni-versity of Michigan, Ann Arbor, in 1949;the S.M. degree from the MassachuesettsInstitute of Technology, Cambridge, in1950; and the Ph.D. degree from Stan-ford University, Stanford, California,in 1952.

From 1952 to 1956, he was a memberof the technical staff at the Bell Telephone Laboratories,Murray Hill, New Jersey. He joined the Electrical EngineeringDepartment faculty at the University of California, Berkely, in1956. From 1968 to 1972, he served as Chairman of theDepartment of Electrical Engineering and Computer Sciences.From 1973 to 1980 he served as Dean of the College ofEngineering, University of California, Berkeley.

IEEPROC, Vol. 130, Pt. G, No. 3, JUNE 1983