*3.2.4. Construction of MFA initial average spin vectors based on the position of movable modules (mapping)*

In addition extra module as an overlap maker module enters the algorithm too but it stays on its location during algorithm. Some of outer modules that advance inside the inner modules area could enter MFA algorithm to prevent some undesirable locating. We divided inner modules area to *P* rows and Q columns. Minimum value between all of the heights and widths of the modules is obtained. Then the width and height of relocation range are divided to this obtained value and rounded to integer values that are number of columns and rows; Q and P. We define position of a module with two vectors at MFA space, one for representing its vertical position and another one for its horizontal position. These vectors have *P* and *Q* elements respectively and for module *"m"* these vectors are shown with ݒ ݒand that finally form overall matrices as ݒandݒ. Every element of above mentioned vectors called spin (neuron) and sum of values of these elements is equal to 1. Left-down corner coordinate of a module determines its position, that means if this point locates in range of *ith* row and *jth* column, *ith* element ofݒ and *jth* element of ݒ is set to 1 and others to 0 as:

Mean Field Annealing Based Techniques for Resolving VLSI Automatic Design Problems 15

$$\nu\_m^r = \underbrace{\begin{bmatrix} 0 & \dots & 1 & \dots & 0 \end{bmatrix}}\_{\mathbf{1} \colon \mathbb{I} \to \mathbb{I}} \underbrace{\begin{bmatrix} \dots & 0 \end{bmatrix}}\_{\mathbf{i} + \mathbf{1} \colon \mathbb{P}} \quad , \quad \nu\_m^c = \underbrace{\begin{bmatrix} 0 & \dots & 1 & \dots & 0 \end{bmatrix}}\_{\mathbf{1} \colon \mathbb{I} \cdot \mathbb{I}} \underbrace{\begin{bmatrix} \dots & 0 \end{bmatrix}}\_{\mathbf{j} + \mathbf{1} \colon \mathbb{Q}} \tag{16}$$

To construct precision vertical and horizontal vectors we used a pseudo-trigonometric method. Module position is determined using its left-down corner distance with left-down corner of relocation range with coordinate as(���, ���).Fig. 5 shows the relocation range of Fig. 3 and its incident inner modules that are darker one. We used a special value to normalize these distances. This value is Euclidean distance between left-down corner of relocation range and a point with coordinate of inner modules maximum "x" and maximum "y" as:

14 Simulated Annealing – Single and Multiple Objective Problems

**Figure 4.** a) Coordinates of a module b) Boundary modules

range of *ith* row and *jth* column, *ith* element ofݒ

*modules (mapping)* 

ݒand

to 0 as:

In main algorithm sum of widths or heights of modules that are located in the same row or column are calculated and results are not permitted to exceed permissible distance of that row or column. For decreasing number of variables and calculations, outer modules that must have fixed position are laid aside and just inner modules that are movable enter MFA algorithm. In addition extra module as an overlap maker module enters the algorithm but it stays on its location during algorithm. Some of outer modules that advance inside the inner

modules area could enter MFA algorithm to prevent some undesirable locating.

*3.2.4. Construction of MFA initial average spin vectors based on the position of movable* 

In addition extra module as an overlap maker module enters the algorithm too but it stays on its location during algorithm. Some of outer modules that advance inside the inner modules area could enter MFA algorithm to prevent some undesirable locating. We divided inner modules area to *P* rows and Q columns. Minimum value between all of the heights and widths of the modules is obtained. Then the width and height of relocation range are divided to this obtained value and rounded to integer values that are number of columns and rows; Q and P. We define position of a module with two vectors at MFA space, one for representing its vertical position and another one for its horizontal position. These vectors have *P* and *Q* elements respectively and for module *"m"* these vectors are shown with ݒ

 that finally form overall matrices as ݒandݒ. Every element of above mentioned vectors called spin (neuron) and sum of values of these elements is equal to 1. Left-down corner coordinate of a module determines its position, that means if this point locates in

and *jth* element of ݒ

is set to 1 and others

(15) ݄ݕ െ ݕൌ ݀ܥ ǡݓݔ െ ݔൌ ܴ݀

$$Sd = \sqrt{(\max(\chi\_{in}) - \chi\_{rr})^2 + (\max(\chi\_{in}) - \chi\_{rr})^2} \tag{17}$$

**Figure 5.** Relocation range and its inner modules for construction of MFA initial average spin vectors

Then for calculating row vector of a module, its vertical distance with left-down corner of relocation range is obtained and then normalized as Eq. 18. Same calculation is done for column vector.

$$\nu d\_{l} = \frac{y\_{l} - y\_{rr}}{\mathbb{S}d} \ , hd\_{l} = \frac{x\_{j} - x\_{rr}}{\mathbb{S}d} \tag{18}$$

Eq. 19 represents normalized total horizontal and vertical ranges. Horizontal range is divided into *P* parts and vertical range into *Q* parts. The algorithm then determines position of modules based on their ���and ���values in comparison to *P* and *Q* obtained spans.

$$\text{Horizontal range} = \left(\frac{\min(\mathbf{x\_{in}}) - \mathbf{x\_{rr}}}{\text{Sd}}, \frac{\max(\mathbf{x\_{in}}) - \mathbf{x\_{rr}}}{\text{Sd}}\right),$$

$$\text{Vertical range} = \left(\frac{\min(\mathbf{y\_{in}}) - \mathbf{y\_{rr}}}{\text{Sd}}, \frac{\max(\mathbf{y\_{in}}) - \mathbf{y\_{rr}}}{\text{Sd}}\right)$$

For module *"m"*, being in the *ith* vertical span causes the *ith* element of �� � to become 1 and being in the *jth* horizontal span causes the *jth* element of �� � to be equal to 1. In MFA space that means probability of finding module *"m"* at row "*i*" and column "*j*" is 1. ��and�� are initial average spin vectors as two inputs of MFA algorithm. Fig. 6 shows the flowchart of first stage of MFA local relocation algorithm.

Mean Field Annealing Based Techniques for Resolving VLSI Automatic Design Problems 17

is the probability of finding module "*i*" in one of the *P* locations at column "*q*",

Last energy function that supervises preserving permissible distances is *permissible distances preservation energy* or ܧௗ. When a selected module moves to a location, the summation of widths and heights of the modules that are in the same column or row are calculated and are compared to permissible distance of that row and column. If these values exceed the permissible distances first the selected module is rotated and the summation and comparison is done again. If the problem still exists the value of ܧௗand total energy increases respectively. In Eq. 21, ܧ௧, ܧ௪ andܧ are total energy function, routing cost or wire length energy function and overlap energy function, respectively. α and β are balance factors between ܧ௪ , ܧ and ܧௗ .α and β are constant during simulation and are used to increase or decrease importance of

every energy functions in total energy function related to others.

**Figure 7.** The energy function minimization: ܧ௧ǡ ܧ௪ǡ ܧand ܧௗ

<sup>1</sup> rcrc ω ω vvvv

<sup>2</sup> i j ip iq jp jq i ji q

p1 1 

<sup>1</sup> <sup>E</sup>ω ω P{Modules i and j are in the same location} o <sup>2</sup> i j i ji

P Q

<sup>1</sup> P Q ω ω P{Module i is in location pq} P{Module j is in location pq} <sup>2</sup> i j i j i p 1q 1

Fig. 7 shows energy function and its parameters, wire length cost, overlap energy and permissible distances preservation energy. At the final epoch, where all of the spins

(21) ௗܧ ൈ ߚ ܧ ൈ ߙ ௪ܧൌ ௧ܧ

(20)

ݒ and

respectively.

**Figure 6.** The flowchart of first stage of Local relocation
