Keywords

1 Introduction

High-level synthesis means synthesizing register-transfer level (RTL) formation from the functional explanation. The two distinct tasks in high-level synthesis are scheduling and allocation [1]. Scheduling task describes the distinct start time for every process in the data flow graph (DFG). Scheduling gives the resource usage estimates. Allocation task ensures that sufficient numbers of resources are available for executing the operation.

The two steps in allocation are resource sharing and resource binding [2]. Resource sharing allows to control on the use of multiple hardware resources for implementing the operation. Resource binding maps between behavioral operations and the resources instances. Resource sharing and binding are NP (nondeterministic polynomial time) complete problem [3], which performs an exhaustive search in finding out the best answer.

2 Previous Work

Many novel techniques for resource binding and sharing are reported [4]. A clique partition algorithm for resource sharing and the coloring algorithm are the best method for resource sharing [5]. The ILP formulation [6, 7] for concurrent scheduling and binding provides successful solution of ILP problems for circuits of interesting size. Nature-inspired algorithms act as an optimized technique in solving the complex problem which is flexible in nature. Genetic algorithm is an optimization tool to solve high-complexity computation problems which are based on principles of Charles Darwin. Particle swarm optimization is swarm intelligence computation method-based stochastic algorithm.

Evolutionary-based search techniques are best to solve NP-Complete problem effectively.

3 Nature-Inspired Computations Method (Genetic Algorithm (GA), Particle Swarm Optimization (PSO))

Nature-inspired computations (NIC) are a method that is motivated by process focused from natural world. These computing methods led to the growth of working of algorithms so-called nature-inspired computation. The algorithms mainly focused toward the nature computational intelligence.

Nature-inspired computation algorithm is mainly categorized as follows:

Evolutionary Computation (EC): Evolutionary computation is a term used to illustrate an algorithm which was encouraged by ‘survival of the fittest’ or ‘normal selection’ principles proposed by Charles Darwin.

Swarm Intelligence (SI): Swarm intelligence is a phrase used to explain the algorithms and distributed problems-solvers mainly inspired by the cooperative cluster intelligence of swarm.

3.1 Genetic Algorithm (GA)

Genetic algorithm (GA) developed by John Holland [8]. The process of genetic algorithm is a search method used to compute to discover accurate or estimated solutions to optimization and search problems based on the rule of regular selection. Genetic algorithm is categorized as universal explore heuristics. Genetic algorithm [9] which is the group of evolutionary algorithms tools method motivated by evolutionary natural science such as inheritance, mutation, selection, and crossover.

3.2 Particle Swarm Optimization (PSO)

Eberhart and Shi [10] developed swarm intelligence method called particle swarm optimization, which emerges as a powerful stochastic optimization technique motivated by the communal activities of organisms such flocks of birds, schools of fish, or swarms of bees, and even human communal behavior, from which the behavior is emerged. Population-based search procedure in which individuals so called particles change their position (state) with time. The standard rule is particle swarm [11] move about toward the best position in explore space, identification based on each particle’s best known position and global best known position.

4 Methodology

4.1 Problem Formulation

The objective of the allocation work aims to locate the resources in finding the appropriate correct number and type of resource sharing of the multiplier resources and ALU resources for each operation so that the design constraint is met.

4.2 Benchmark Problem for Resource Allocation

To illustrate the allocation problem, the scheduled sequencing time constraint graph displayed in Fig. 1, the problem based on hardware abstraction layer (HAL). Implementation by resource with type ALU is considered for the operation of type adders, subtractor, and comparator.

Fig. 1
figure 1

Scheduled sequencing time constraint HAL benchmark problem

The scheduled graph from Fig. 1 indicates the operation for multiplier resources \( \left\{ {\left( {{\mathbf{o}}_{1} } \right), \left( {{\mathbf{o}}_{2} } \right)} \right\} \) is listed in the first time step, operation for multiplier resources \( \left\{ {\left( {{\mathbf{o}}_{3} } \right) , \left( {{\mathbf{o}}_{6} } \right) } \right\} \) is listed in second time step, operation for multiplier resources \( \left\{ {\left( {{\mathbf{o}}_{7} } \right), \left( {{\mathbf{o}}_{8} } \right)} \right\} \) scheduled in third time step. Adders, subtractor, and comparator are generalized as the resource-type ALU. The operation for ALU resources \( \left( {{\mathbf{o}}_{10} } \right) \) is scheduled in the initial control time step, operation for ALU resources \( \left( {{\mathbf{o}}_{11} } \right) \) scheduled in second control time step, operation for ALU resources \( \left( {{\mathbf{o}}_{4} } \right) \) scheduled in third time control step and operation for ALU resources \( \left\{ {\left( {{\mathbf{o}}_{5} } \right), \left( {{\mathbf{o}}_{9} } \right)} \right\} \) scheduled in fourth time control step. The obtained scheduled result under time constraint scheduling requires two multiplier operator units and two ALU operator units to fulfill the defined schedule graph.

4.3 Integer Linear Programming (ILP) Formulation for Allocation and Binding as a Constraint Optimization

To illustrate the allocation problem, the ILP formulation for operation binding as constraints optimization, for the scheduled data flow graph in Fig. 1 is as follows:

ILP model is a set of binary decision variables with two indices ‘B’ = {‘bir’; i = 0, 1, … n; ‘r' = 1, 2, … a}, ‘n' = number of operations, ‘a' = number of resources. {‘bir' = 1} implies the operation ‘oi' in constraint graph bound to resource ‘r', \( {\text{a}} \le {\text{n}} \) is an high bound on the numeral of resources to be set. Binary decision constants ‘X' = ‘xil'; i = 0, 1, … n; l = 1, 2, … λ + 1, where {‘xil' = 1} implies operation \( {\text{o}}_{\text{i }} \) start in the control step ‘l' of the schedule, from the schedule ‘l' = ‘ti'.

The different ILP formulation constraints are:

  • To obtain a binding, search a set of values of ‘B', to allocate behavior operation to the resources such that the set of following constraints are met.

    $$ \sum\limits_{{{\text{r}} = 1}}^{\text{a}} {{\text{b}}_{\text{ir}} = 1,\;{\text{i}} = 1,2, \ldots ,{\text{n}}} $$
    (1)

Equation (1) states every operation ‘oi' should assign to exactly one as well as only one resource of type ‘a'.

  • The resource allocation for Eq. (1) for ‘resource 1' and ‘resource 2' of the multiplier is summation of each operational units of multiplier by the ‘resource 1’ and 'resource 2’ given below as follows:

    $$ \begin{aligned} & {\text{b}}(1,1) + {\text{b}}(1,2) = 1 \\ & {\text{b}}(2,1) + {\text{b}}(1,2) = 1 \\ & {\text{b}}(3,1) + {\text{b}}(3,2) = 1 \\ & {\text{b}}(6,1) + {\text{b}}(6,2) = 1 \\ & {\text{b}}(7,1) + {\text{b}}(7,2) = 1 \\ & {\text{b}}(8,1) + {\text{b}}(8,2) = 1 \\ \end{aligned} $$
  • The resource allocation for Eq. (1) for ‘resource 1’ and 'resource 2’ of the ALU is summation of each operational units of ALU by the ‘resource 1’ and ‘resource 2’ given below as follows:

    $$ \begin{aligned} {\text{b}}(10,1) + {\text{b}}(10,2) & = 1 \\ {\text{b}}(11,1) + {\text{b}}(11,2) & = 1 \\ {\text{b}}(4,1) + {\text{b}}(4,2) & = 1 \\ {\text{b}}(5,1) + {\text{b}}(5,2) & = 1 \\ {\text{b}}(9,1) + {\text{b}}(9,2) & = 1 \\ \end{aligned} $$
  • Equation (2) states at each control step, one operation among resource \( {\text{r}} \) can be executed among those allocated.

    $$ \sum\limits_{{{\text{i}} = 1}}^{\text{n}} {{\text{b}}_{\text{ir}} * \sum\limits_{{{\text{m = l - d}}_{\text{i}} + 1}}^{\text{l}} {{\text{X}}_{\text{im}} \le 1,\;{\text{l}}\,{ = }\, 1 , 2 ,\ldots\uplambda + 1,{\text{r}}\,{ = }\, 1 , 2 ,\ldots {\text{a}}} } $$
    (2)
    $$ {\text{b}}_{\text{ir}} \in \left\{ {0,1} \right\}\;\;,{\text{i}}\,{ = }\, 0\; , 1\ldots {\text{n;}}\;{\text{r}}\,{ = }\, 1 , 2 ,\ldots {\text{a}} $$
    (3)
  • Equation (3) constraint states decision variable \( ` {\text{B'}} \) are binate, either take (0, 1).

The resource allocation for Eq. (2) describes the summation of each multiplier operation by ‘resource 1’ with the product of each multiplier operation at scheduled time step is as follows:

$$ \begin{aligned} {\text{b(1, 1)}} * {\text{x(1, 1) + b(2, 1)}} * {\text{x(2, 1)}} \le 1\hfill \\ {\text{b(3, 1)}} * {\text{x(3, 2) + b(6, 1)}} * {\text{x(6, 1)}} \le 1\hfill \\ {\text{b(7, 1)}} * {\text{x(7, 3) + b(8, 1)}} * {\text{x(8, 3)}} \le 1\hfill \\ \end{aligned} $$
  • The resource allocation for Eq. (2) by ‘resource 2’ of multiplier is as follows:

    $$ \begin{aligned} b ( 1 , 2 )* x ( 1 , 1 ) + b ( 2 , 2 )* x ( 2 , 1 )\le 1\hfill \\ b ( 3 , 1 )* x ( 3 , 2 ) + b ( 6 , 2 )* x ( 6 , 2 )\le 1\hfill \\ b ( 7 , 1 )* x ( 7 , 3 ) + b ( 8 , 2 )* x ( 8 , 3 )\le 1\hfill \\ \end{aligned} $$
  • The resource allocation for Eq. (2) by ‘resource 1’ of ALU is as follows:

    $$ b\left( {5,1} \right) *x\left( {5,4} \right) + b\left( {9,1} \right) * x\left( {9,4} \right) \le 1 $$
  • The resource allocation for Eq. (2) by ‘resource 2’ of ALU is as follows:

    $$ b\left( {5,2} \right) *x\left( {5,4} \right) + b\left( {9,2} \right) * x\left( {9,4} \right) \le 1 $$

5 Experimental Analysis and Data

To solve ILP formulation of operation binding as constraints optimization, the nature-inspired computations evolutionary computation genetic algorithm method, and swarm intelligence method are considered to work out the inequalities constraint value. There are ‘12’ different variables for multiplier constraint equation, ‘10’ different variables for ALU constraint equation. Thus, there are total ‘22’ variables which have to be solved.

The allocation optimization specifications are as follows: Integer linear programming can be formulated for the objective function given in Eq. (4) as follows:

$$ Minimize\;f;\, `f\text{'} = resources\;sharing $$
(4)
$$ `f\text{'} = sum\left( {abs \left( { `rs\text{'}} \right)} \right) $$
(5)
$$ `rs\text{'} = \left[ {r\;\;r2} \right]; `r\text{'} = multiplier\;\;constraint\;equation, $$
$$ `r2\text{'} = ALU constraint equation $$
  • The algorithm is experienced with regular random numeral for population range (N) = 50.

  • Dimension of the search space (D) = 22.

  • Genetic Algorithm parameter setup: the crossover probability which is two-point factor = ‘1’, mutation probability factor value = 0.01. Selection method tournament is used.

  • Particle Swarm Optimization (PSO) parameter setup: Constriction factor (\( cf \)) value = 0.72, learning factor (\( c1,c2 \)) value of 2.5, inertia weight ‘w’ value is reducing from 1.2 to 0.1.

Allocation algorithm problem is solved using MATLAB.

6 Results and Discussion

6.1 Resource Binding Performance Analysis Using Genetic Algorithm

The 12 variables multiplier allocation results using GA are presented in Table 1. The 10 variables ALU allocation results are been listed as follows in Table 2.

Table 1 Results of genetic algorithms performance for multiplier allocation and binding
Table 2 Results of genetic algorithms performance for ALU allocation and binding

6.2 Discussion

In Table 1, \( b\left( {1,1} \right) = b\left( {3,1} \right) = b\left( {7,1} \right) = 1; \) indicates operation for \( (o_{1} , o_{3} , o_{7} ) \) done by ‘resource 1’ and results \( b\left( {2,2} \right) = b\left( {6,2} \right) = b\left( {8,2} \right) = 1; \) indicates \( (o_{2} , o_{6} , o_{8} ) \) operation done by ‘resource 2’.

The ALU allocation result is tabulated in Table 2. The 10 variables results for ALU resources are presented in Table 2. In Table 2, \( b\left( {10,1} \right) = b\left( {11,1} \right) = b\left( {4,1} \right) = b\left( {9,1} \right) = 1; \) indicates operation for \( \left( {o_{10} ,o_{11} ,o_{4} , o_{9} } \right) \) done by ‘resource 1’ of ALU and \( b\left( {5,2} \right) = 1; \) indicate operation \( (o_{5} ) \) done by ‘resource 2’ of ALU. In Fig. 2, the error in allocation using genetic algorithm is zero; the objective function given in Eq. (4) is minimized to zero which is the obtained optimal value.

Fig. 2
figure 2

Error in resource binding analysis for genetic algorithm

The optimal scheduled and resource-bounded sequence graph obtained by solving the ILP constraint using genetic algorithm is shown in Fig. 3. Figure 3 describes multiplier ‘resource 1’ sharing is done for operation ‘o1', ‘o3', ‘o' and indicated as (1, 1). ((1, 1) indicate multiplier operations done by multiplier ‘resource 1’).

Fig. 3
figure 3

Scheduled and resource-bounded graph obtained from GA

The multiplier ‘resource 2’ sharing is done for operation ‘o', ‘o6', ‘o8' and is indicated as (1, 2); ((1, 2) indicate multiplier operations done by multiplier ‘resource 2').

ALU ‘resource 1' sharing is done for operation ‘o10', ‘o11', ‘o4', ‘o9', and is indicated as (2, 1); ((2, 1) indicate ALU operations done by ALU ‘resource 1'). The ALU ‘resource 2' sharing done for \( o_{5} \) and is indicated as (2, 2); ((2, 2) indicate ALU operations done by ALU ‘resource 2'). Hence, the resource sharing and binding are done simultaneously for a solution under a larger set of constraints.

6.3 Resource Binding Performance Analysis Using Particle Swarm Optimization

The performances of multiplier allocation using PSO are shown in Table 3 and ALU allocation using particle swarm optimization is shown in Table 4.

Table 3 Particle swarm performance for multiplier allocation
Table 4 Particle swarm performance for ALU allocation

6.4 Discussion

The multiplier allocation results are tabulated in Table 3. The 12 variables results allocating multiplier resources are presented in Table 3. Table 3 result \( {\text{b}}\left( {2,1} \right) = {\text{b}}\left( {7,1} \right) = 1; \) indicates \( \left( {{\text{o}}_{2} , {\text{o}}_{7} } \right) \) operation done by ‘resource 1', and \( \left( {{\text{o}}_{6} , {\text{o}}_{8} ,{\text{o}}_{1} } \right) \) operation have done by ‘resource 2' and PSO fails to allocate resources sharing for operation \( ({\text{o}}_{3} ) \).

The ALU allocation result using PSO is tabulated in Table 4. The 10 variables results for ALU resources are presented in Table 4. In Table 4, \( {\text{b}}\left( {10,1} \right) = {\text{b}}\left( {4,1} \right) = 1; \) indicates operation for \( ({\text{o}}_{10} ,{\text{o}}_{4} ) \) done by ‘resource 1' of ALU and \( {\text{b}}\left( {5,2} \right) = {\text{b}}\left( {11,2} \right) = 1; \) indicates operation \( \left( {{\text{o}}_{5} ,{\text{o}}_{11} } \right) \) done by ‘resource 2' of ALU, but PSO fails to deliver the results for resources sharing for the operation \( ({\text{o}}_{9} ). \)

The objective function is minimized to the value four as shown in Fig. 4. The error in allocation using particle swarm optimization is four; PSO fails to minimize the objective function to the optimal value of zero; and struck at local minima as shown in Fig. 4.

Fig. 4
figure 4

Error in resource binding analysis for particle swarm optimization

7 Conclusion

Comparative analysis of resource allocation and binding of multiplier and ALU functional units is obtained by means of genetic algorithm which is one of the evolutionary computation methods and swarm intelligence method.

Genetic algorithm, an evolutionary method to find optimal solution for resource allocation and binding, achieves minimum objective function; i.e., ‘f' = 0; is successfully with zero error in allocation. Particle swarm optimization, a swarm intelligence method, poorly gets struck at local minima and fails to obtain minimum objective function. Error in allocation exists in PSO method. The comparison results from GA and PSO show, GA is foremost in determining the binding of allocation problem in with zero errors.