*3.1.1. Energy function formulation*

Energy function in the MFA algorithm corresponds to formulation of the cost function of the cell placement problem in terms of spins. Since the MFA algorithm iterates on the expected values of the spins, the expected value of the energy function is formulated. The gradient of the expected value of the energy function is used in the MFA algorithm to compute the new values to update spin vectors in order to minimize the energy function. The applied cost energy for this problem is routing cost energy that is calculated approximately. It is not feasible to calculate the exact routing length for two reasons. Firstly, a feasible placement is not available during the execution of some algorithms; secondly, the computation of the exact routing cost necessitates the execution of the global and the detailed routing phases which are as hard as the placement phase. Commonly used approximations are the *semiperimeter* method or *Half Perimeter Wire Length* (*HPWL*) method*.* 

Using the expected values of spins, the probability of existence of one or more cells of *nth*  net in *pth* row and *qth* column is calculated and applying *HPWL* method routing length cost is obtained. Different weights for row and column routing length costs could be considered.

If the routing cost is used as the only factor in the cost function, the optimum solution is mapping all cells of the circuit to one location in the layout. This placement will reduce the routing cost to zero but obviously it is not feasible. Hence, a term in the energy function is needed which will penalize the placements that put more than one cell to the same location. This term is called the overlap cost. This term is calculated by multiplying the probabilities of being *ith* and *jth* cells in same location. The total energy function��, is:

$$E\_t = E\_{\nu rc} + E\_{\hbar rc} + \mathcal{J} \times E\_o \tag{13}$$

where ����, ���� and �� are vertical routing cost, horizontal routing cost and overlap cost respectively.The parameter � is balance factor between routing and overlap cost functions.

### *3.1.2. Half Perimeter Wire Length (HPWL) method*

A very simple and widely used cost function parameter is the interconnect wire length of a placement solution; this can be easily approximated using the bounding box method. This wire length estimation method draws a bounding box around all ports in a given net, half the perimeter of this box is taken as the net's interconnect length approximation. The *half perimeter wire length* (HPWL) estimation for minimally routed two and three port nets gives an exact value.
