Btree + SA

Embed Size (px)

Citation preview

  • 8/2/2019 Btree + SA

    1/6

    B*-Trees: A New Representation for Non-Slicing Floorplans

    Yun-Chih Chang, Yao-Wen Chang, Guang-Ming Wu, and Shu-Wei Wu

    Department of Computer and Information Science, National Chiao Tung University, Hsinchu 300, Taiwan

    AbstractWe present in this paperan efficient, flexible, and effective data struc-ture, B*-trees, for non-slicing floorplans. B*-trees are based on orderedbinary trees and the admissible placement presented in [1]. Inheritingfrom the nice properties of ordered binary trees, B*-trees are very easyfor implementation and can perform the respective primitive tree op-erations search, insertion, and deletion in only O ( 1 ) , O ( 1 ) , and O ( n )times while existing representations for non-slicing floorplans need atleast O ( n ) time for each of these operations, where n is the number ofmodules. The correspondence between an admissible placement and itsinduced B*-tree is 1-to-1 (i.e., no redundancy); further, the transforma-tion between them takes only linear time. Unlike other representationsfor non-slicing floorplans that need to construct constraint graphs forcost evaluation, in particular, the evaluation can be performed on B*-trees and their correspondingplacements directly and incrementally. Wefurther show the flexibility of B*-trees by exploring how to handle ro-tated, pre-placed, soft, and rectilinear modules. Experimental results on

    MCNC benchmarks show that the B*-tree representation runs a bout 4.5times faster, consumes about 60% less memory, and results in smallersilicon area than the O-tree one [1]. We also develop a B*-tree basedsimulated annealing scheme for floorplan design; the scheme achievesnear optimum area utilization even for rectilinear modules.

    1 IntroductionDue to the growth in design complexity, circuit sizes are getting

    larger. To cope with the increasing design complexity, hierarchical de-sign and IP modules are widely used. The trend makes module floor-planning/placement much more critical to the quality of a VLSI design.

    A fundamental problem to floorplanning/placement lies in the repre-sentation of geometric relationship among modules. The representationprofoundly affects the operations of modules and the complexity of afloorplan/placement design process. It is thus desired to develop an effi-cient, flexible, and effective representation of geometric relationship forfloorplan/placement designs.

    1.1 Previous WorkFloorplans can be divided into two categories, the slicing struc-ture [12, 15] and the non-slicing structure [1, 6, 9, 14]. A slicing struc-ture can be represented by a binary tree whose leaves denote modules,and internal nodes specify horizontal or vertical cut lines. Wong andLiu proposed an algorithm for slicing floorplan designs [15]. They pre-sented a normalized Polish expression to represent a slicing structure,enabling the speed-up of its search procedure. However, this represen-tation cannot handle non-slicing floorplans. Recently, researchers haveproposed several representations for non-slicing floorplans, such as se-quence pair [6], bounded slicing grid (BSG) [9], and O-tree [1].

    Onodera et al. in [11] used the branch-and-bound method to solvethe module placement problem. This approach has very high time com-plexity and is thus feasible for only small problem sizes. Murata etal. in [6] proposed the sequence-pairrepresentation for rectangularmod-ule placement. The main idea is to use a sequence pair to represent thegeometric relation of modules, place the modules on a grid structure,

    and construct corresponding constraint graphs to evaluate cost. Thisrepresentation requires2 n d l g n e

    space to encode a sequence pair and

    This work was partially supported by the National Science Council of Tai-wan under Grant No. NSC-89-2215-E-009-055. E-mail: f gis87512, ywchang,gis85815, gis8867555g @cis.nctu.edu.tw.

    there are( n )

    2

    combinations in total, wheren

    is the number of mod-ules. Further, the transformation between a sequence pair and a place-ment takes O ( n l g n ) time. Nakatake el al. in [9] presented a grid basedrepresentationBSG. The BSG structure utilizes a set of horizontal andvertical bounded-length lines to cut the plane into rooms and representsa placement by these lines and rooms. BSG incurs redundancies. Itscomplexity is similar to that of the sequence pair. The sequence pairand BSG were then extended to handle pre-placed modules and softmodules in [2, 7, 8, 10].

    Guo et al. in [1] proposed a tree based representation, called O-trees.

    The number of O-tree combinations is only O ( n 2 2 n 2 = n 1 5 ) . Further,the transformation between the representationand a floorplan takes onlyO ( n ) time. However, the tree structure is irregular, and thus some prim-itive tree operations, such as search and insertion, are not efficient. Toreduce the operation complexity, the tree is encoded by a sequence of2 n bits and a permutation of n d l g n e bits.

    7n

    8n

    9n

    10n

    11n 3n

    4n

    5n

    6n

    1n

    2n

    0n6b

    b0

    b1b2

    b10

    b5

    b3 b4

    11b

    b9

    b7

    b8

    (a) (b)

    Figure 1: (a) An admissible placement. (b) The (horizontal) B*-treerepresenting the placement.

    1.2 Our ContributionsTo handle non-slicing floorplans, we propose in this paperan ordered

    binary-tree based representation, called B*-trees. Given an admissibleplacement[1], we can represent it by a unique horizontal and a uniquevertical B*-trees. (See Figure 1(b) for the horizontal B*-tree for the ad-missible placement shown in Figure 1(a).) The admissible placementhere means that it is compacted and can neither move down nor moveleft. Inheriting from the particular characteristics of the ordered binarytree, the B*-tree has many advantages compared with other representa-tions. We summarize the advantages of B*-tree as follows:

    Based on ordered binary trees, the B*-tree is very fast and easyfor implementation. Since the number of branches in a B*-tree isfixed (i.e., two branches), it can be implemented by either a staticdata structure or a dynamic one. By using static memory, wecan search and insert a node in

    O ( 1 )

    time while the O-tree needsO ( n ) time. Note that an O-tree is irregular and its number of

    branches is unpredictable (see Figure 2(b)); thus, it incurs higheroperation complexity and/or significant encoding cost.

    The B*-tree is very flexible for handling the floorplanning prob-lems with various types of modules (e.g., hard, pre-placed, soft,and rectilinear modules) directly and efficiently. In contrast, otherrepresentation cannot handle some special modules well. Todeal with soft modules using sequence pair, for example, pre-vious work in [8] transformed it to the convex problem (which isNP-hard [13]), processed the soft modules, and then transformedback to the sequence pair.

    B*-trees do not need to construct constraint graphs for area costevaluation. In contrast, the sequence pair and O-tree representa-

  • 8/2/2019 Btree + SA

    2/6

  • 8/2/2019 Btree + SA

    3/6

    positions for inserting a node are limited to the external nodes (see Fig-ure 3) to facilitate the update of the encoding tuple. Inserting a node to aposition other than external positions makes the update of the encodingtuple difficult and time-consuming. The inflexibility might c ause the O-tree to deviate from the optimal during solution perturbations, and thusinevitably limit the quality of a floorplan design. We consider this in-flexibility a major drawback of the O-tree representation. It will be clearin the next subsection that this deficiency can be fixed by using B*-trees.

    3n

    4n

    5n

    6n7n 8n 9n 10n

    11n

    1n

    2n

    0n

    external node

    internal node

    root

    Figure 3: The internal and external insertion positions. To facilitate theupdate of the encoding tuple, O-trees allow a node to be inserted only atthe external positions.

    3.2 The B*-Tree RepresentationGiven an admissible placement P , we can represent it by a unique

    (horizontal) B*-tree T . (See Figure 1(b) for the B*-tree representing theplacement shown in Figure 1(a).) A B*-tree is an ordered binary treewhose root corresponds to the module on the bottom-left corner. Simi-lar to the DFS procedure, we construct the B*-tree T for an admissibleplacement P in a recursive fashion: Starting from the root, we first re-cursively construct the left subtree and then the right subtree. Let Rdenote the set of modules located on the right-hand side and adjacent tob . The left child of the node n corresponds to the lowest module inR

    that is unvisited. The right child ofn

    represents the lowest mod-ule located above b , with its x -coordinate equal to that of b and itsy -coordinate less than that of the top boundary of the module on theleft-hand side and adjacent to b , if any.

    The B*-tree keeps the geometric relationship between two modulesas follows. If node n

    j

    is the left child of node n , module bj

    must be

    located on the right-hand side and adjacent to module b in the admissi-ble placement; i.e.,

    x

    j

    = x + w

    . Besides, if noden

    j

    is the right childof n , module b

    j

    must be located above and adjacent to module b , withthe

    x

    -coordinate ofb

    j

    equal to that ofb

    ; i.e.,x

    j

    = x

    . Also, since theroot of T represents the bottom-left module, the x - and y -coordinates ofthe module associated with the root ( x

    r o o t

    y

    r o o t

    ) = ( 0 0 ) .As shown in Figure 1, we make n

    0

    the root of T since b0

    is on thebottom-left corner. Constructing the left subtree of n

    0

    recursively, wemake n

    7

    the left child of n0

    . Since the left child ofn7

    does not exist, wethen construct the right subtree of n

    7

    (which is rooted by n8

    ). The con-struction is recursively performed in the DFS order. After completingthe left subtree of n

    0

    , the same procedure applies to the right subtree ofn

    0

    . Figure 1(b) illustrates the resulting B*-tree for the plac ement shownin Figure 1(a). The construction takes only linear time.

    Note that a B*-tree can also be constructed by transforming an O-tree to a binary tree, underseveral additional construction rules for somespecial module placements to make the theorem to be presented below

    hold. However, constructing a B*-tree in this way is not as efficient asthe aforementioned procedure.

    We have the following lemma which leads to Theorem 1.

    Lemma 1 For a module b in an admissible placement, the correspond-ing node n in its induced B*-tree has a unique parent if n is not theroot.

    Theorem 1 There is a 1-to-1 correspondence between an admissibleplacement and its induced B*-tree.

    In other words, for an admissible placement, we can construct a uniqueB*-tree, and vice versa. The nice property of the 1-to-1 correspondence

    between an admissible placement and its induced B*-tree prevents thesearch space from being enlarged with duplicate solutions.

    4 Operations on ModulesWe adopt the contourdata structure presented in [1] to facilitate the

    operations on modules. The contour structure is a doubly linked listfor modules, describing the contour curve in the current com paction di-rection. A horizontal contour (see Figure 4) can be used to reduce therunning time for finding the

    y

    -coordinate of a newly inserted module.Without the contour, the running time for placing a new module wouldbe linear to the number of modules. By maintaining the contour struc-

    ture, however, they

    -coordinate of a module can be computed inO ( 1 )

    time [1]. Figure 4 illustrates how to update the horizontal contour afterinserting a new module.

    0

    1 34

    10

    9

    811

    7

    b b b

    b

    b

    b

    b b

    b

    old contour

    newlyaddedmodule

    new contour

    horizontal contour

    verticalcontour

    Figure 4: Adding a new module on top, we search the horizontal con-tour from left to right and update it with the top boundary of the newmodule.

    To cope with rotated modules, when inserting a deleted node intoa B*-tree, we can perform the operation twice at each position to finda better solution, one for the original orientation, and the other for therotated one. In the following, we shalldiscuss the floorplanningproblemwith pre-placed, soft, and rectilinear modules.

    4.1 Pre-placed ModulesIntuitively, if there exists a pre-placed module which cannot be lo-

    cated on its fixed positions during compaction, we would discard thissolution. Unfortunately, this approach is not effective. A better ap-proach is to change an infeasible solution to be feasible. Therefore, we

    handle the situation in this way: if there exists a pre-placed module thatcannot be located on its fixed positions during compaction, we exchangethe pre-placed module with anotherso thatthe pre-placed module can belocated on its fixed positions. There are two subproblems to be solved:(1) how to choose the module that swaps with the pre-placed module,and (2) how to locate the pre-placed one on its fixed position.

    We say a module to be ahead (behind) another if its bottom-left x -coordinate is smaller (larger) than that of another. Similarly, a moduleis lower (higher) than another if its bottom-left y -coordinate is smaller(larger) than that of another. A coordinate (

    x y

    ) dominates another co-ordinate (x y ), denoted by ( x y ) ( x y ) , iff x x and y y .

    Letb

    be a pre-placed module, (x

    f

    y

    f

    ) denote its fixed coordinate, and

    D = f b

    j

    ( x

    f

    y

    f

    ) ( x

    j

    y

    j

    ) g . If there are modules ahead or lower

    thanb

    so thatb

    cannot be placed at (x

    f

    ,y

    f

    ), we would exchangeb

    with the module in D that is most close to (xf

    y

    f

    ).To identify the modules in

    D

    , we first trace backT

    from the noden

    until detecting a node n j whose corresponding module b j is dominatedby (x f y f ). We add n

    j

    into D . Then, we trace down the subtree of

    n

    j

    and add all modules dominated by ( xf

    y

    f

    ) into D . Note that whenwe trace down the subtree of n

    j

    , once we find a node n that is not

    dominated by (x

    f

    y

    f

    ), all the nodes in the subtree ofn

    will not be

    dominated by (x f y f ). After D is determined, the module that is most

    close to (xf

    y

    f

    ) is chosen for exchange.Figure 5(a) shows a placement with a pre-placed module b

    6

    and its

    fixed position (xf

    6

    ,yf

    6

    ). b6

    cannotbe placed at (xf

    6

    y

    f

    6

    ) since the positionhas been occupied by module

    b

    2

    . Therefore, we must choose a modulefor exchangewith b

    6

    . Following the aforementioned procedure, we have

  • 8/2/2019 Btree + SA

    4/6

    66,( )xf fy

    6b

    11bb0

    b1b2

    b10

    b9

    b7

    b5

    b3b4

    b8

    b5

    b1

    b2

    b0

    b36b b4

    b10

    b9

    b8 11b

    b7

    66,( )xf fy

    (a) (b)Figure 5: (a) A placement with a pre-placed module. (b) Place

    b

    6

    at its

    fixed position (xf

    6

    y

    f

    6

    ).

    D

    6

    = f b

    1

    b

    2

    g . Since b2

    is most close to ( xf

    6

    y

    f

    6

    ), we exchange n2

    andn

    6

    in T and transform T to its corresponding placement. Figure 5(b)shows the resulting exchange of b

    2

    and b6

    , with b6

    being placed at its

    fixed position (xf

    6

    y

    f

    6

    ). Note that, to save the execution time, we do notidentify all feasible modules (e.g., b

    0

    ) for the exchange.A nice property of the B*-tree lies in the incremental cost update.

    The DFS order of T before the exchange is ( n0

    n

    7

    n

    8

    , n1 1

    n

    9

    n

    1 0

    ,n

    1

    n

    2

    n

    3

    ,n

    4

    n

    5

    n

    6

    ). The positions ofb

    0

    b

    7

    b

    8

    b

    1 1

    b

    9

    b

    1 0

    , andb

    1

    remain unchangedafter the exchange since they are in the front of b2

    inthe DFS order. Therefore, we do not need to recompute the area cost

    from scratch.4.2 Soft Modules

    With its area being fixed, the width and heightof a soft module is freeto be changed under its aspectratio constraint. Our method for handlingsoft modules consists of two stages: the first stage picks a soft modulefor processing (deleting and inserting a node associated with the mod-ule), and the second stage adjusts the shapes of the other soft modules.To insert a node, most existing work tries all possible combinations ofwidths and heights. To avoid the time-consuming process of trying allpossible combinations, we shall find the best shape directly.

    6b

    b0

    b1

    b2

    b10

    b5

    b3 b4

    11b

    b9

    b7

    b8

    (a)

    7n

    8n

    9n

    10n

    11n3n

    4n

    5n

    6n

    1n

    2n

    0n

    (b)

    Figure 6: (a) An admissible placement. (b) The vertical B*-tree repre-senting the placement.

    To compact along the y direction, we introduce the vertical B*-treeT

    v

    , and call the B*-tree described in Section 3.2 the horizontal B*-tree,denoted by T

    h

    . Given an admissible placement P , we can construct aunique

    T

    v

    . LetU

    denote the set of modules located above and adjacentto b . The construction is similar to constructing a T

    h

    described in Sec-

    tion 3.2 with the only difference in direction. The left child of the noden corresponds to the leftmost module in U that is unvisited. The rightchild of n represents the module located on the right-hand side and ad-jacent to

    b

    , with itsy

    -coordinate equal to that ofb

    and itsx

    -coordinateless than that of the right boundary of the module below and adjacentto

    b

    , if any. Figure 6(b) gives the vertical B*-tree for the admissibleplacement shown in Figure 6(a).

    After inserting a node associated with a soft module, we compute itssurplus spacein the x and y directions for stretching its width and height

    under its aspect ratio constraint. Let A H (A V ) denote the set of mod-ules affected by shifting the soft module b in the horizontal (vertical)direction and b itself. (Note that we can shift a module either up or right

    in an admissible placement.) The modules in A H are those associated

    with the nodes in the left subtree ofb

    inT

    h

    andb

    itself. The modulesin A V can be similarly defined in T

    v

    .Let

    y

    i ; m i n

    y

    i ; m a x

    ( x

    i ; m i n

    x

    i ; m a x

    ) be the range on the vertical(horizontal) contour that could be affected by pushing b forward in thehorizontal (vertical) direction. We have

    y

    i ; m a x

    = m a x f y

    k

    + h

    k

    b

    k

    2 A

    H

    g

    (1)

    y

    i ; m i n

    = m i n f y

    k

    b

    k

    2 A

    H

    g (2)

    and

    x

    i ; m a x

    = m a x f x

    k

    + w

    k

    b

    k

    2 A

    V

    g (3)

    x

    i ; m i n

    = m i n f x

    k

    b

    k

    2 A

    V

    g (4)

    Letx

    I

    i

    (y

    I

    i

    ) be the maximumx

    (y

    ) coordinate on the vertical (hor-izontal) contour in the range I = y

    i ; m i n

    y

    i ; m a x

    ( xi ; m i n

    x

    i ; m a x

    ),and

    H

    ( i ) (V

    ( i ) ) denote the distance between xI

    i

    ( yI

    i

    ) and the maxi-

    mum x (y ) coordinate on the vertical (horizontal) contour. Also, let O R

    (O U ) be the set of modules on the right-hand (upper) side ofb and theirvertical (horizontal) boundaries overlap with the interval

    y y + h

    ( x x + w ), x = m i n f xj

    b

    j

    2 O

    R

    g (y = m i n f yj

    b

    j

    2 O

    U

    g )

    denote the minimum x (y ) coordinate of the modules in O R (O U ), and

    H

    ( i ) =

    H

    ( i ) + x

    ? x ? w ; i f O

    R

    6=

    H

    ( i ) otherwise

    V

    ( i ) =

    V

    ( i ) + y

    ? y ? h ; i f O

    U

    6=

    V

    ( i )

    otherwise

    We have

    w =

    8

    r

    m a x

    h =

    8

    >

    :

    h +

    V

    ( i ) ; i f r

    m n

    ( h

    i

    +

    V

    (

    2

    a

    i

    r

    m a x

    p

    a r

    m n

    i f

    ( h

    i

    +

    V

    (

    2

    a

    i

    < r

    m n

    p

    a r

    m a x

    i f

    ( h

    i

    +

    V

    (

    2

    a

    i

    > r

    m a x

    Modifying the shape of a module, we change its width first, thenchange its height after compacting along the y direction, and compactalong the

    x

    direction at last. Changing width and height at the sametime may cause confusion as there may be surplus space in both of thex

    andy

    directions.After changing the shape of the inserted soft module, we then change

    those of other soft modules. We first compute the surplus space in the xand

    y

    directions for each soft module. Instead of computing the surplusspace from the contour, we find the space between the soft module andits neighboring ones. After inserting a soft module

    b

    , we compute the

    surplus space of a soft module bj

    in the x and y directions from O Rj

    and

    O

    U

    j

    respectively.

    Let H

    ( j ) (V

    ( j ) ) be the surplus space ofbj

    in the horizontal (verti-cal) direction, and

    x

    (y

    ) be the maximumx

    (y

    ) coordinate on the vertical(horizontal) contour. We have

    H

    ( j ) =

    x

    j

    ? x

    j

    ? w

    j

    ; i f O

    R

    j

    6=

    x ? x

    j

    ? w

    j

    otherwise

    V

    ( j ) =

    y

    j

    ? y

    j

    ? h

    j

    ; i f O

    U

    j

    6=

    y ? y

    j

    ? h

    j

    otherwise

    Substituting H

    ( i ) for H

    ( j ) and V

    ( i ) for V

    ( j ) , we can obtain thenew w

    j

    and hj

    similar to the equations shown above.Similar to the processing of the inserted soft module, we change the

    widths and heights of the soft modules one at a time. After changingtheir widths, we compact in the vertical direction. Then we continue tochange their heights and compact in the horizontal direction at last.

  • 8/2/2019 Btree + SA

    5/6

    b1

    b2

    (a) (d)

    b1 b2

    (c)

    b1

    b2

    (b)

    b1b2

    Figure 7: Four cases of an L-shaped module after rotation. Each is par-titioned into two parts by slicing it along the middle vertical boundary.

    4.3 Rectilinear ModulesWe can partition a rectilinear module into several rectangular sub-

    modules by slicing from left to right along each vertical boundary. Wefirst consider L-shaped modules and then extend to general rectilinearmodules.

    An L-shaped module bL

    can be partitioned into two rectangular sub-modules by slicing b

    L

    along its middle vertical boundary. As shown inFigure 7,

    b

    1

    andb

    2

    are the sub-modules ofb

    L

    , and we sayb

    1

    b

    2

    2 b

    L

    .During placement, we must guarantee that the two sub-modules b

    1

    andb

    2

    abut, andb

    L

    maintains its original shape. To ensure that the leftsub-module b

    1

    and the right sub-module b2

    of bL

    abut, we impose thefollowing location constraint(LC for short) for b

    1

    andb

    2

    :

    L C : Keep b2

    as b1

    s left child in the B*-tree.

    Since modules are placed in the DFS order, keepingb

    2

    asb

    1

    s leftchild in the B*-tree guarantees that b

    1

    and b2

    are placed in sequence.The

    L C

    relation ensures that thex

    -coordinate ofb

    2

    s left boundaryequals that of b

    1

    s right boundary. For example, the two sets of sub-modules b

    1

    b

    2

    and b3

    b

    4

    shown in Figure 8(a) abut. The sub-modulesb

    3 andb

    4 are placedat the correct positions whileb

    1 andb

    2 are not sinceb

    1

    and b2

    do not conform to their original L shape. We say b1

    and b2

    tobe mis-aligned. To slove the mis-aligned problem, we must adjust they coordinate of b

    1

    or b2

    . For the b1

    and b2

    shown in Figure 8(a), forexample,

    b

    1

    must be pulled up until they

    coordinate ofb

    1

    s top (bot-tom) boundary equals that of b

    2

    s for the L shape shown in Figure 7(a)(Figure 7(d)).

    b1

    0

    1

    2

    b2

    b3b4 b2

    b1

    1

    0

    2

    b3

    b4

    LC relations

    (a) (b)

    Figure 8: Suppose that b1

    b

    2

    and b3

    b

    4

    are two sets of sub-modulescorresponding to two L-shaped modules. (a) A placement in whichb

    1

    b

    2

    and b3

    b

    4

    abut. However, b1

    and b2

    are mis-aligned. (b) Theircorresponding nodes in the B*-tree keep the

    L C

    relation betweenb

    1

    andb

    2

    (as well asb

    3

    andb

    4

    ).

    For each L-shaped module, there are four orientations after rotation,as shown in Figure 7. Whenever we perform a rotation on an L-shapedmodule, we must repartition it into two sub-modules and maintain theLC relation between them. See Figure 7 for the sub-modules after repar-titioning.

    A rectilinear module is convex if any two points within the modulecan be connected by the shortest Manhattan path which also lies withinthe module; it is concave otherwise. A convex module b

    C

    can be par-

    titioned into a set of sub-modules b 1 b 2 ; : : : ; b n by slicing b C from leftto right along each vertical boundary. Considering the L C relation, wekeep the sub-module b

    + 1

    as b s left child in the B*-tree to ensure thatthey are placed side by side along the

    x

    direction, where1 i n ? 1

    .To ensure that b

    1

    b

    2

    ; : : : ; b

    n

    are not mis-aligned, we may need to adjustthe y coordinates of the sub-modules, like what we did for L-shapedmodules. For a concave module, we can fill the concave holes of themodule and make it convex. Then, the operations remain the same asthose for a convex module.

    5 The AlgorithmOur floorplan design algorithm is based on the simulated annealing

    method [4]. The algorithm can consider not only hard modules, but also

    pre-placed, soft, and rectilinear ones.We perturb a B*-tree (a feasible solution) to another B*-tree by using

    the following four operations.

    Op1: Rotate a module.

    Op2: Move a module to another place.

    Op3: Swap two modules.

    Op4: Remove a soft module and insert it into the best internal orexternal position.

    We have discussed Op1 in Section 4. Op2 deletes and inserts a module.If the deleted node is associated with a rectangular module, we simply

    delete the node from the B*-tree. Otherwise, there will be several nodesassociated with a rectilinear module, and we treat them as a whole andmaintain their

    L C

    relations. Op4 deletes a soft module, tries all possibleinternal and external positions, inserts it into the best position, changesits shape and the shapes of the other soft modules (see Section 4.2).Op2, Op3, and Op4 need to apply the I n s e r t and D e l e t e operationsfor inserting and deleting a node to and from a B*-tree. We explain thetwo operations in the following.

    5.1 DeletionThere are three cases for the deletion operation.

    Case 1: A leaf node.

    Case 2: A node with one child.

    Case 3: A node with two children.

    In Case 1, we simply delete the target leaf node. In Case 2, we removethe target node and then place its only child at the position of the re-moved node. The tree update can be performed in O ( 1 ) time. In Case

    3, we replace the target node n t by either its right child or left child n c .Then we move a child of n

    c

    to the original position of nc

    . The processproceeds until the corresponding leaf node is handled. It is obvious thatsuch a deletion operation requires O ( h ) time, where h is the height ofthe B*-tree. Note that in Cases 2 and 3, the relative positions of themodules might be changed after the operation, and thus we might needto reconstruct a corresponding placement for further processing. Also,if the deleted node corresponds to a sub-module of a rectilinear moduleb

    R

    , we should also delete other sub-modules of bR

    .

    5.2 InsertionWhen adding a module, we may place it around some module, but

    not between the sub-modules that belong to a rectilinear module. Wedefine three types of positions as follows.

    Inseparable position: A position between two nodes associatedwith two sub-modules of a rectilinear module.

    Internal position: A position between two nodes in a B*-tree, but

    is not an inseparable one. External position: A position pointed by a NULL pointer.

    Only internal and external positions can be used for inserting a newnode. For a rectangular module, we can insert it into an internal or anexternal position directly. For a rectilinear module b

    R

    consisting of thesub-modules b

    1

    b

    2

    ; : : : ; b

    n

    ordered from left to right, the sub-modulesmust be inserted simultaneously, and b

    + 1

    must be the left child of b tosatisfy the L C relation.

    The simulated annealing algorithm starts by randomly choosing aninitial B*-tree. Then it perturbs a B*-tree (a feasible solution) to an-other B*-tree based on the aforementioned Op1Op4 until a predefinedfrozen state is reached. At last, we transform the resulting B*-tree tothe corresponding final admissible placement.

    6 Experimental ResultsWe implemented two algorithms in the C++ programming language

    on a 200 MHz SUN Sparc Ultra-I workstation with 256 MB memory.

    One is the iterative, deterministic algorithm used in [1], and the otheris the aforementioned simulated annealing algorithm. The d eterministicone is served for the purpose of fair comparison with the O-tree repre-sentation which is the fastest for non-slicing floorplans in the literature.

    We performed two sets of experiments: one was basedon the MCNCbenchmark circuits used in [1], and the other on some artificial rectilin-ear modules. Table 2 lists the names of the circuits, the numbers of mod-ules, the runtimes per iteration for the iterative, deterministic algorithm,memory requirements, and chip areas for the cluster refinement algo-rithm [16], the O-tree, the B*-tree based on the iterative algorithm. Wealso tested the total runtimes and areas resulted from using the B*-treebased simulated annealing algorithm. The results show that the B*-treeachieved average speedups (area reductions) of 458 and 4.5 (1.0% and

  • 8/2/2019 Btree + SA

    6/6