Research Article

Using Genetic Algorithms for Hardware Core Placement and Mapping in NoC-Based Reconfigurable Systems

Algorithm 1

Pseudocode of a GA for reconfigurable placement and mapping in NoCs.
(1) best_solution =
(2) population = generate_random_population(PZ)
(3) population, fitness = 1/comm_cost
(4) while generation ≤ NG do
(5)  while ≤ PZ do
(6)   cr_sel1, cr_sel2 = roulette(population, fitness)
(7)   if (crossover) then
(8)    Offspring() = Crossover(cr_sel1, cr_sel2)
(9)    Offspring() = Crossover(cr_sel2, cr_sel1)
(10)  else
(11)    Offspring() = cr_sel1
(12)   Offspring() = cr_sel2
(13)  end if
(14)  if (mutation) then
(15)   Offspring() = mutate(cr_sel1)
(16)   Offspring() = mutate(cr_sel2)
(17)   end if
(18)   for , do
(19)    if offspring().maps then
(20)    fitness = 1/comm_cost
(21)   else
(22)    fitness = 0
(23)   end if
(24)   end for
(25)  end while
(26)  population = offspring
(27)  if fittest(generation) < best_solution then
(28)   best_solution = fittest(generation)
(29)  end if
(30)  generation++
(31) end while
(32) return best_solution