Research Article

High-Level Synthesis under Fixed-Point Accuracy Constraint

Algorithm 3

Tabu search for solution improvement in WL optimization.
(1): 𝐰 = 𝐰 m i n
(2): 𝐢 o p t = 𝐢 ( 𝐰 )
(3): 𝐰 o p t ← βˆ…
(4): 𝑇 ← βˆ… { t a b u o p e r a t o r s }
(5): d ← ( πœ† ( 𝐰 ) > πœ† m i n ) ? βˆ’ 1 ∢ 1 { d i r e c t i o n s e l e c t i o n }
(6): while   | 𝑇 | < 𝑁   do
(7): for  all   1 ≀ π‘˜ βˆ‰ 𝑇 ≀ 𝑁   do   { c o m p u t a t i o n o f βˆ‡ π‘˜ }
(8):   𝐰 Ξ” ← 𝐰
(9):  if   d > 0 ∧ 𝐰 ( π‘˜ ) < 𝐰 m a x ( π‘˜ )   then
(10):    𝐰 Ξ” ( π‘˜ ) ← 𝐰 ( π‘˜ ) + 1
(11):  else  if d < 0 ∧ 𝐰 ( π‘˜ ) > 𝐰 m i n ( π‘˜ )   then
(12):    𝐰 Ξ” ( π‘˜ ) ← 𝐰 ( π‘˜ ) βˆ’ 1
(13):  else
(14):    𝑇 ← 𝑇 βˆͺ { π‘˜ }
(15):  end  if
(16):  if   π‘˜ βˆ‰ 𝑇   then   { C o m p u t a t i o n o f t h e m e t r i c f o r d i r e c t i o n s e l e c t i o n }
(17):    βˆ‡ π‘˜ ← 𝑓 d i r ( 𝐰 Ξ” , 𝐰 )
(18):   if   πœ† ( 𝐰 Ξ” ) > πœ† m i n   then
(19):    update of   𝐢 o p t and 𝐰 o p t   if necessary
(20):   end  if
(21):  end  if
(22): end  for
(23): if   | 𝑇 | = 𝑁   then   { a l l t h e v a r i a b l e a r e i n t h e t a b u l i s t }
(24):   stop
(25): end  if
(26): if   d > 0   then   { s e l e c t i o n o f t h e b e s t s o l u t i o n }
(27):   𝑗 ← a r g m a x βˆ‡ π‘˜
(28):   𝐰 ( 𝑗 ) ← 𝐰 ( 𝑗 ) + 1
(29):  if   πœ† ( 𝐰 ) > πœ† m i n   then
(30):    d ← βˆ’ 1 { c h a n g e o f d i r e c t i o n i f πœ† m i n i s n o w f u l fi l l e d }
(31):    𝑇 ← 𝑇 βˆͺ { 𝑗 }
(32):  end  if
(33): else
(34):   𝑗 ← a r g m i n βˆ‡ π‘˜
(35):   𝐰 ( 𝑗 ) ← 𝐰 ( 𝑗 ) βˆ’ 1
(36):  if   πœ† ( 𝐰 ) < πœ† m i n   then
(37):    𝑑 ← 1 { c h a n g e o f d i r e c t i o n i f πœ† m i n i s n o l o n g e r f u l fi l l e d }
(38):  end  if
(39):  end  if
(40): end  while
(41): return   𝐰 o p t