optimal word length allocation for the fixed point
play

Optimal word-length allocation for the fixed-point implementation of - PowerPoint PPT Presentation

Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Optimal word-length allocation for the fixed-point implementation of linear filters and controllers Thibault Hilaire , Hacne Ouzia and


  1. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Optimal word-length allocation for the fixed-point implementation of linear filters and controllers Thibault Hilaire , Hacène Ouzia and Benoit Lopez Sorbonne Université, France Inria, Paris Saclay ARITH26 2019, June 2019, Kyoto Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 1/19

  2. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Context imp Filters/Controllers Algorithms Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 2/19

  3. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Context 0 1 0 1 0 1 1 1 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 imp on Filters/Controllers Embedded Algorithms Hardware Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 2/19

  4. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Context 0 1 0 1 0 1 1 1 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 imp Implementation on Filters/Controllers Embedded Algorithms Hardware � implementation : transformation of the mathematical object into finite precision operations to be performed on a specific target Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 2/19

  5. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Context 0 1 0 1 0 1 1 1 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 imp Implementation on Filters/Controllers Embedded Algorithms Hardware � implementation : transformation of the mathematical object into finite precision operations to be performed on a specific target Specially for Fixed-Point arithmetic, the implementation process is: • time-consuming and error-prone We need a code • provides no guaranty on the the errors generator! • potentially non- optimal Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 2/19

  6. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Word-length optimization for FPGA/ASIC We will here focus on • State-Space systems Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 3/19

  7. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Word-length optimization for FPGA/ASIC We will here focus on • State-Space systems • the first parts of the flow, except the code generation Error Code MSB Sum-of- determination analysis generation Products Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 3/19

  8. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Word-length optimization for FPGA/ASIC We will here focus on • State-Space systems • the first parts of the flow, except the code generation • for FPGAs or ASICs (multiple word-length paradigm) w : word-lengths Error Code MSB Sum-of- determination analysis generation Products w w w Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 3/19

  9. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Word-length optimization for FPGA/ASIC We will here focus on • State-Space systems • the first parts of the flow, except the code generation • for FPGAs or ASICs (multiple word-length paradigm) w : word-lengths • optimal word-length allocation Word- Error MSB Sum-of- Code length analysis generation determination Products Optimization w opt We also want it to be reliable: � classical Signal Processing approach models errors as noises and perform statistical error analysis � we want to use worst case analysis (rigorous bounds) Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 3/19

  10. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Outline 1 Introduction Context State-Space systems 2 Fixed-Point implementation Determining the Fixed-Point Formats Sum-of-Products by real Constants 3 Word-length optimization under accuracy constraint Error analysis Word-length allocation problem Examples 4 Conclusions and Perspectives Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 4/19

  11. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions State-Space We consider Linear Time Invariant filters (or controllers) expressed with State-Space systems: � x ( k + 1 ) = Ax ( k ) + Bu ( k ) H y ( k ) = Cx ( k ) + Du ( k ) where • u ( k ) and y ( k ) are the input and output vector at time k ; • x ( k ) is the state vector ; • A , B , C and D are matrices defining the system. Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 5/19

  12. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Worst-Case Peak Gain Input u ( k ) Output y ( k ) Stable filter Amplitude Amplitude u ( k ) y ( k ) H Temps Temps Time Time 1 Volkova, H., and Lauter, “Reliable evaluation of the Worst-Case Peak Gain matrix in multiple precision,” in 22nd IEEE Symposium on Computer Arithmetic, 2015 Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 6/19

  13. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Worst-Case Peak Gain Input u ( k ) Output y ( k ) Stable filter Amplitude Amplitude u ( k ) y ( k ) H Temps Temps Time Time ∀ k , | u ( k ) | � ¯ u 1 Volkova, H., and Lauter, “Reliable evaluation of the Worst-Case Peak Gain matrix in multiple precision,” in 22nd IEEE Symposium on Computer Arithmetic, 2015 Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 6/19

  14. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Worst-Case Peak Gain Input u ( k ) Output y ( k ) Stable filter Amplitude Amplitude u ( k ) y ( k ) H Temps Temps Time Time ∀ k , | u ( k ) | � ¯ ∀ k , | y ( k ) | � � u � H � � ¯ u � � � ∞ � CA k B � Worst-Case Peak Gain: � � H � � = | D | + k = 0 The WCPG matrix can be computed at any arbitrary precision 1 . 1 Volkova, H., and Lauter, “Reliable evaluation of the Worst-Case Peak Gain matrix in multiple precision,” in 22nd IEEE Symposium on Computer Arithmetic, 2015 Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 6/19

  15. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Outline 1 Introduction 2 Fixed-Point implementation Determining the Fixed-Point Formats Sum-of-Products by real Constants 3 Word-length optimization under accuracy constraint 4 Conclusions and Perspectives Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 7/19

  16. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Fixed-Point Arithmetic 2 0 2 − 1 − 2 m 2 m − 1 2 ℓ s m + 1 − ℓ w x = M · 2 ℓ M : mantissa (two’s complement) ∈ [ − 2 w − 1 ; 2 w − 1 − 1 ] Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 8/19

  17. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Fixed-Point Arithmetic 2 0 2 − 1 − 2 m 2 m − 1 2 ℓ s m + 1 − ℓ w w = m − ℓ + 1 w wordlength m Most Significant Bit ℓ Least Significant Bit Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 8/19

  18. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Fixed-Point Arithmetic 2 0 2 − 1 − 2 m 2 m − 1 2 ℓ s m + 1 − ℓ w w = m − ℓ + 1 w wordlength m Most Significant Bit ℓ Least Significant Bit The MSB/LSB (or MSB/word-length) must be chosen carefully: • we choose MSB such that no overflow occurs: ∀ k , x ( k ) ∈ [ − 2 m ; 2 m − 2 ℓ ] • we choose LSB such that we achieve a certain accuracy Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 8/19

  19. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Determining the MSB position � x ( k ) � We consider the vector of our variables ζ ( k ) = . y ( k ) We want to determine their MSB m such that ζ i ( k ) ∈ [ − 2 m i , 2 m i ( 1 − 2 1 − w i )] . ∀ k , Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 9/19

  20. Introduction Fixed-Point implementation Word-length optimization under accuracy constraint Conclusions Determining the MSB position � x ( k ) � We consider the vector of our variables ζ ( k ) = . y ( k ) We want to determine their MSB m such that ζ i ( k ) ∈ [ − 2 m i , 2 m i ( 1 − 2 1 − w i )] . ∀ k , Our system is rewritten as � x ( k + 1 ) = Ax ( k ) + Bu ( k ) H ζ ζ ( k ) = M 1 x ( k ) + M 2 u ( k ) , Optimal word-length allocation for fixed-point filters T. Hilaire, H. Ouzia, B. Lopez 9/19

Recommend


More recommend