Two-Criterion Optimization in State Assignment for ... - Semantic Scholar

1 downloads 0 Views 332KB Size Report
(PLAs) or MUSTANG [6] and JEDI [7] for multilevel. FSM implementation. However, state assignments gen- erated by these methods, for FSMs implemented in ...
214

Two-Criterion Optimization in State Assignment for Synchronous Finite State Machines using NSGA-II Nitin Gupta1, Vivek Kumar Agrawal2 department of Computer Science and Engineering, Indian Institute of Technology, Kanpur 2 Department of Mechanical Engineering, Indian Institute of Technology, Kanpur, India E-mail: [email protected] Abstract One of the challenging problems in circuit implementations is finding the best state assignment for implementing a synchronous sequential circuit which are also represented as Finite State Machines. This problem, commonly known as State Assignment Problem (S.A.P.), has been studied extensively because of its importance in reducing the cost of implementation of circuits. The previous work on this problem assumes the number of coding bits as constant, making it a single objective problem with the only objective being to reduce the cumulative cost of transition between the connected states. In this work, we add another dimension to this optimization problem by introducing a second objective of minimizing the number of bits used for assignment. This is desirable to reduce the complexity and the cost of a circuit. The two objectives are conflicting and thus the optimal solution requires a tradeoff. We present an evoluationary algorithms based approach to solve this multi-dimensional optimization problem. We compare the results from two algorithms, and find that an NSGA-II based approach, with some modifications to constraint handling, gives better results and running time than NSGA. We also gain some insights about the shape of the efficient frontier. 1 Introduction A significant part of the digital circuits is constituted by sequential synchronous circuits behaviour of which can be presented by a finite state machine (FSM). Thus it is not strange that the FSM synthesis models are continually developed. One of the most crucial steps in FSM synthesis is the encoding of FSM states referred to as the state assignment problem (SAP). It consists of the unique assignment of bit strings to the states of sequential circuit (SC). This step of FSM synthesis is important because it affects the quality of realised SC (cost/area, maximum frequency, power consumption). Attempts at solving the state assignment problem

spreads over five decades. Amongst the early attempts are those due to Armstrong [1], Dolotta and McCluskey [2] and the decomposition technique due to Hartmanis and Stearns [3, 4]. Effective algorithms for the state encoding were developed, e.g. NOVA [5] for two-level implementation targeted to Programmable Logic Arrays (PLAs) or MUSTANG [6] and JEDI [7] for multilevel FSM implementation. However, state assignments generated by these methods, for FSMs implemented in modern programmable devices allowing efficient implementations of digital systems, are far from optimum [8]. Taking above into account, and considering other conditions (cf. [9, 10]) we decided to try to cope with SAP using evolutionary methods. 2 Multi-Objective Problem Formulation We have a directed graph representing the FSM. Each vertex in the graph represents a state. Suppose there are m states. Each of these states is to be assigned a binary string of k bits. We have to find the assignment to these states that optimizes that objective functions. 2.1 Objective Functions We have two conflicting objectives 1 that we want to minimize: (I) k- Minimizing the number of bits used for state representation reduces the implementation costs and the size of the circuit. (2) Transition Costs- This represents the cumulative transition cost between states in the graph. Transition Cost for any pair of states i, j , such that j is connected to i is given by the Hamming distance between the string representation of states i and j , i.e. the number of bit flips required to move from i to j . Thus it is desirable to do the assignment of states in such a way that neighbouring states in the graph are assigned more "similar" binary strings than far-off states. 2.2 Constraints Two constraints apply on the number of bits k used for assignment. The first constraint specifies a lower limit on

215 4 Comparison of EMO Approaches and Results We have experimented with two main EMO approaches, NSGA and NSGA-II, as discussed below. Note that all the simulations have been run on a personal PC with 800 MHz P-II1 processor and 128 MB memory. 4.1 NSGA Fig. 1. Example of Tradeoff: The first figure shows the only possible two bit assignment (k=2) for the state, while the second figure shows one of the best possible three bit (k=3) assignments. We observe that number of flips in first image is 8, while only 6 in the second image. This example illustrates the significance of considering different k's.

NSGA is a non-elitist evolutionary algorithms [12]. The basic principle of NSGA, like most other EMO algorithms is to stress on selection of dominating points, and avoid too much of crowding in any front. The individuals within a population are divided into diffrent fronts(ranks) and an individual in a lower front (in this minimization problem) will be given preference over an individual in a relatively higher front.

the number of bits, that must be used to represent a set of m distinct states.

4.1.1 Test Machine: For testing the performance of the algorithm we have designed finite state machine M with 23 states. The first state of the machine is connected, both-ways, to the remaining 22 states. There are no connections within the 22 states. It is easy to observe that minimum transition cost will occur if the remaining 22 states are assigned strings which are different at only one position from the assignment of the first state. We have summarized the analytically computed minimum transition cost for each value of k in Table 1. Note that all the pairs mentioned in this table are paretooptimal, except (23,44), as it is dominated by (22,44).

k > \log2(m)]

(1)

The second constraint is an upper limit on the number of bits, which is same as the number of states. Any number of bits beyond this limit is redundant and can only increase the cost of transition. k < rn

(2)

There is one more constraint for the solutions to be valid: Each state should be given a distinct assignment. This is obviously required for unique identification of each state. 3 Methods The first thing to do in Evolutionary Multiobjective Optimization(EMO) approach is to determine a feasible and solvable pair of representation and operators. The crossover and mutation operators are designed according to the chosen representation (genotype coding). We use a matrix representation for one solution, that is a set of assignments covering all the states of the given machine. In this representation, a certain genotype is represented by a 2-D matrix. The number of rows is equal to the number of states in the machine. The number of colums is equal to the upper limit on k. Our representation ensures that the constraint k < m is followed. We need to check only for the remaining two constraints, that is the lowerbound on k, and that no two states get the same assignment.We do a two-point column-wise crossover. We use simple bitwise mutation with the mutation probability currently set at 0.002 which represents the small chance that each bit of the matrix can get changed.

4.1.2 Results: The algorithm gives 7 near pareto-optimal points, of which only 5 are actually pareto-optimal. Two points (5,92) and (6,82) are not pareto-optimal, while the points (7,76), (8,72), (9,70), (10,68) and (11,66) are pareto optimal, as seen in Table 1. The initial population is quite far away from the efficient front which is obtained at the end of the simulations (see Figure 2). The algorithm is able to move towards the efficient frontier, and obtain five pareto-optimal points. The simulations were run for 75,000 generations, although the results did not change much after 25,000 generations. This indicated that the algorithm will not be able to detect the remaining 13 pareto-optimal points. All results are obtained for a population size of 500. 4.2 NSGA-II NSGA-II [13] is an extension of NSGA. NSGA-II ensures that it has the following three properties: 1. It uses an elitist approach, i.e. the best individuals are preserved in each generation 2. It uses an explicit diversity preserving mechanism

216

k Min Cost

5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 92 78 76 72 70 68 66 64 62 60 58 56 54 52 50 48 46 44 44

Table 1. The minimum cost of transitions, calculated analytically, for the test machine M. Note that all the pairs mentioned in this table are pareto-optimal, except (23,44), as it is dominated by (22,44).

a penalty zero. The domination criteria was adjusted to this change. If two given individuals are of different penalty value, the one with lower penalty is said to dominate the one with higher penalty value. In case of indiviuals with equal (or zero) penalty, the old domination criteria based on objective function value was used.

4

6

8

10

12

14

16

18

20

22

24

Fig. 2. Figure shows the distribution of the initial populations. The curves represent the best three fronts of individuals found by the algorithm.

3. It emphasizes the non-dominated solutions. In this algorithm, the offspring population Qt is first created from the pareant population Pt and the usual reproduction, crossover and mutation operators[14]. Thereafter, the two populations are combined together to form Rt of size 2N. Then, a non-dominated sorting is used to classify the entire population Rt. Once the nondominated sorting is over, the new population is filled by solutions of different non-dominated fronts, one at a time. The filling starts with the best non-dominated front and continues with solution of the second nondominated front, followed by the third non-dominated front, and so on. Since the overall population size of Rt is 2N, not all fronts may be accomodated in N slots available in the new population. All fronts which could not be accomodated are deleted. While the last front is under consideration, there may arise a situation when this front has more solutions than the number of free slots in the new population. In such situations the crowding measure is used, and the individuals with maximum crowding distance are chosen. Here, we first used a penalty-function approach for handling constraints. A penalty equalling the number of clashes in state assignments was given to every individual. Feasible individuals, with no clash, were given

4.2.1 Results: The results are showed in Figure 3. We have obtained 16 points with rankl, and all of them actually correspond to pareto optimal points. The only two points that the method was unable to reach were (21,46) and (22,44), located at the far end of the solution space. 5 Discussions and Conclusion In this study, we have attempted to solve the state assignment problem (S.A.P.), keeping the number of bits as variable. Thus, we have two objectives to be optimized: (1). Reducing the cost of transition between states and (2). Reducing the number of bits used. We have approached this two-dimensional optimization problem through evolutionary algorithms approach. We observe that NSGA-II gave significantly better results than NSGA in lesser number of iterations, which can be attributed to the elitist approach. The inherent discreteness and discontinuity of the solution space increases the chance of losing a good solution during cross-over operators, and thus we find that an explicit mechanism of favoring the good solutions improves the qaulity of results. This is an evidence towards the discreteness of the efficient frontier of solutions. References [1] Armstrong, DB, "A programmed algorithm for assigning internal codes to sequential machines", IRE Trans, 1962, EC11, pp 466-472. [2] Dolotta, TA, and McCluskey, E, "The coding of internal states of sequential machines", IEEE Trans, 1964, EC13,pp 549-562. [3] Hartmanis, J, "On the state assignment problem for sequential machines I", IRE Trans, 1961, EC 10, pp 157-165. [4] Stearns, RE, and Hartmanis, J, "On the state assign-

217 ment problem for sequential machines II", IRE Trans, 1961, EC10,pp 593-603. [5] Villa T., Sangiovanni-Vincentelli A., NOVA: State Assignment of Finite State Machines for Optimal Two-Level Logic Implementation, IEEE Transactions on Computer- Aided Design, 1990, 9, (9), pp. 905924.

10

12

14

16

18

20

22

[6] Devadas S., Ma H.-K., Newton R., SangiovanniVincentelli A., MUSTANG: State Assignment of Finite State Machines Targeting Multilevel Logic Implementations, IEEE Transactions on ComputerAided Design, 7, (12), (1988), pp. 1290-1300. [7] Lin B., Newton R., Synthesis of Multiple Level Logic from Symbolic High-Level Description Languages, Proc. of the Int. Conf. on VLSI, Munchen, 1989, pp. 187-206. [8] Deniziak S., Sapiecha K., A Comparison of State Encoding Algorithms for Different Reprogrammable Architectures, Proc. of the RUC Conference., Szczecin, Poland 1998. [9] Gaat A., A system of data collection for small satellite systems with interfaces built with the use of FPGAs, Proc. of the RUC Conference, Szczecin, Poland 1999,pp.301-308. [10] Michalewicz Z., Genetic Algorithms + Data Structures = Evolution Programs, Springer-Verlag, Berlin Heidelberg 1996, 3rd edition. [11] De Micheli G., Synthesis and Optimization of Digital Circuits, McGraw-Hill, 1994.

X

X

X

X

X

X

[12] Srinivas N. and Deb K. Multi-objective function optimization using non-dominated sorting genetic algorithms. Evolutionary Computation Journal 2(3):221-248, 1994.

X

X

[13] Deb K., Agrawal S., Pratap K. and Meyarivan T. A fast and elitist multi-objective genetic algorithm: NSGA-II IEEE Transactions on Evolutionary Computation. 6(2): 182-197, 2002. 10

12

14

16

Fig. 3. The first figure shows the obtained efficient frontier, containing 16 points. The secondfigureshows the distribution of the initial population, and also the efficient frontier, to give a view of the distance that the population has to travel. The third figure shows the final population at the end of 3000 generations.

[14] Goldberg D. E. Genetic Algorithms in search, optimization and machine learning. Addison-Wesiey, Reading, Massachusetts, 1989.

Suggest Documents