SlideShare ist ein Scribd-Unternehmen logo
1 von 148
Downloaden Sie, um offline zu lesen
From controller/filter to code:
       the optimal implementation problem
       Thibault Hilaire (thibault.hilaire@lip6.fr)




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   1/72
Context                                                                     Linear filters and equivalent realizations




     1                                           Context and
                                                 problematics




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   2/72
Context                                                                     Linear filters and equivalent realizations



Outline




     1 Context




     2 Linear filters and equivalent realizations




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   3/72
Context                                                                                  Linear filters and equivalent realizations



Context
                                                                                                                       0
                                                                                                                   01
                                                                                                                 01
                                                                                                           11
                                                                                                       11
                                                                                                 0   10                           0
                                                                                              00                             01
                                                                                          1                                01
                                                                                       10                              11
                                                                                    10                            11
                                                                              110                            010
                                                                           10                             00
                                                                      00                         10
                                                                                                      1
                                                                    01                        10
                                                                                         10
                                                                                     01
                                                                                0 01
                                                                             01

                                               implantation
                                               Implementation
                                                 implantation

                 Filters/Controllers
                 algorithmes TS                                                      Cibles
                                                                                      Targets
                      Algorithms
                     algorithmes TS                                                    Cibles




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)                       4/72
Context                                                                                  Linear filters and equivalent realizations



Context
                                                                                                                       0
                                                                                                                   01
                                                                                                                 01
                                                                                                           11
                                                                                                       11
                                                                                                 0   10                           0
                                                                                              00                             01
                                                                                          1                                01
                                                                                       10                              11
                                                                                    10                            11
                                                                              110                            010
                                                                           10                             00
                                                                      00                         10
                                                                                                      1
                                                                    01                        10
                                                                                         10
                                                                                     01
                                                                                0 01
                                                                             01

                                               implantation
                                               Implementation
                                                 implantation

                 Filters/Controllers
                 algorithmes TS                                                      Cibles
                                                                                      Targets
                      Algorithms
                     algorithmes TS                                                    Cibles




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)                       4/72
Context                                                                                  Linear filters and equivalent realizations



Context
                                                                                                                       0
                                                                                                                   01
                                                                                                                 01
                                                                                                           11
                                                                                                       11
                                                                                                 0   10                           0
                                                                                              00                             01
                                                                                          1                                01
                                                                                       10                              11
                                                                                    10                            11
                                                                              110                            010
                                                                           10                             00
                                                                      00                         10
                                                                                                      1
                                                                    01                        10
                                                                                         10
                                                                                     01
                                                                                0 01
                                                                             01

                                               implantation
                                               Implementation
                                                 implantation

                 Filters/Controllers
                 algorithmes TS                                                      Cibles
                                                                                      Targets
                      Algorithms
                     algorithmes TS                                                    Cibles




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)                       4/72
Context                                                                                  Linear filters and equivalent realizations



Context
                                                                                                                       0
                                                                                                                   01
                                                                                                                 01
                                                                                                           11
                                                                                                       11
                                                                                                 0   10                           0
                                                                                              00                             01
                                                                                          1                                01
                                                                                       10                              11
                                                                                    10                            11
                                                                              110                            010
                                                                           10                             00
                                                                      00                         10
                                                                                                      1
                                                                    01                        10
                                                                                         10
                                                                                     01
                                                                                0 01
                                                                             01

                                               implantation
                                               Implementation
                                                 implantation

                 Filters/Controllers
                 algorithmes TS                                                      Cibles
                                                                                      Targets
                      Algorithms
                     algorithmes TS                                                    Cibles

          • Finite precision implementation (fixed-point arithmetic)
          • LTI systems
          • hardware (FPGA, ASIC) or software (DSP, µC)




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)                       4/72
Context                                                                                  Linear filters and equivalent realizations



Context
                                                                                                                       0
                                                                                                                   01
                                                                                                                 01
                                                                                                           11
                                                                                                       11
                                                                                                 0   10                           0
                                                                                              00                             01
                                                                                          1                                01
                                                                                       10                              11
                                                                                    10                            11
                                                                              110                            010
                                                                           10                             00
                                                                      00                         10
                                                                                                      1
                                                                    01                        10
                                                                                         10
                                                                                     01
                                                                                0 01
                                                                             01

                                               implantation
                                               Implementation
                                                 implantation

                 Filters/Controllers
                 algorithmes TS                                                      Cibles
                                                                                      Targets
                      Algorithms
                     algorithmes TS                                                    Cibles

          • Finite precision implementation (fixed-point arithmetic)
          • LTI systems
          • hardware (FPGA, ASIC) or software (DSP, µC)

           Methodology for the implementation of embedded algorithms
                               (controllers/filters)
From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)                       4/72
Context                                                                     Linear filters and equivalent realizations



Implementation under constraints
      Embedded systems suffer from various constraints:

       • Cost (short Time to Market, rapid renewal, etc...)
       • Power consumption (energy-autonomous systems)
       • Resources (Limited computing resources (no FPU))




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   5/72
Context                                                                     Linear filters and equivalent realizations



Implementation under constraints
      Embedded systems suffer from various constraints:

       • Cost (short Time to Market, rapid renewal, etc...)
       • Power consumption (energy-autonomous systems)
       • Resources (Limited computing resources (no FPU))

      The implementation of a given algorithm is difficult:
          • Deal with precision problems
              • Implementation ⇒ accuracy problems
                 •     Fixed-point arithmetic

          • Area/power consumption constraints
              • multiple wordlength paradigm (ASIC and FPGA)
          • Time-consuming work




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   5/72
Context                                                                     Linear filters and equivalent realizations



Implementation under constraints
      Embedded systems suffer from various constraints:

       • Cost (short Time to Market, rapid renewal, etc...)
       • Power consumption (energy-autonomous systems)
       • Resources (Limited computing resources (no FPU))

      The implementation of a given algorithm is difficult:
          • Deal with precision problems
              • Implementation ⇒ accuracy problems
                 •     Fixed-point arithmetic

          • Area/power consumption constraints
              • multiple wordlength paradigm (ASIC and FPGA)
          • Time-consuming work

      We need tools to transform controller into code that deal with
      precision/performance/computational cost tradeoff
From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   5/72
Context                                                                     Linear filters and equivalent realizations



Objectives



      The objectives of the presentation is to give an overview of:
          • the interest and the difficulties of this problem
          • the parts already (almost) done
          • the various parts in-progress
          • some analogies with the optimal polynomial implementation
             problem




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   6/72
Context                                                                     Linear filters and equivalent realizations



Finite precision degradations
  The implementation ⇒ degradations (performances, characteristics, etc.)




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   7/72
Context                                                                     Linear filters and equivalent realizations



Finite precision degradations
  The implementation ⇒ degradations (performances, characteristics, etc.)

      Origins of the degradations
      Two sources of deteriorations are considered:
          • Roundoff errors into the computations
             → roundoff noise




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   7/72
Context                                                                     Linear filters and equivalent realizations



Finite precision degradations
  The implementation ⇒ degradations (performances, characteristics, etc.)

      Origins of the degradations
      Two sources of deteriorations are considered:
          • Roundoff errors into the computations
             → roundoff noise
          • Quantization of the coefficients
             → parametric errors




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   7/72
Context                                                                     Linear filters and equivalent realizations



Finite precision degradations
  The implementation ⇒ degradations (performances, characteristics, etc.)

      Origins of the degradations
      Two sources of deteriorations are considered:
          • Roundoff errors into the computations
             → roundoff noise
          • Quantization of the coefficients
             → parametric errors

      The degradations depends on
          • the algorithmic relationship used to compute output(s) from
             input(s)
          • the computations themselves (wordlengths, roundoff mode,
             binary point position, additions order, etc.)

From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   7/72
Context                                                                      Linear filters and equivalent realizations



Linear filters

      LTI: Linear system with known and constant coefficients
          • FIR (Finite Impulse Response) :
                                           n                                 n
                                                   −i
                           H(z) =               bi z ,    ⇒ y (k) =               bi u(k − i)
                                          i=0                             i=0

          • IIR (Infinite Impulse Response) :

                                   n        −i                           n                        n
                                   i=0 bi z
              H(z) =                 n         −i
                                                    ,    ⇒ y (k) =               bi u(k−i)−           ai y (k−i)
                            1+       i=1 ai z                           i=0                     i=1

          Filters and signal processing




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   8/72
Context                                                                                    Linear filters and equivalent realizations



Equivalent realizations
      For a given LTI controller, it exist various equivalent realizations
        • Direct Form I (2n + 1 coefs)




                                                     u(k)                u(k − 1)                                            u(k − n)
                                                                  q −1              q −1            q −1              q −1


                                                            b0             b1                 b2              bi               bn

                         n        −i
                         i=0 bi z
     H(z) =                n         −i
                    1+     i=1 ai z                                                          +                                          y(k)


              n                   n
   y (k) =          bi u(k−i)−          ai y (k−i)          −an           −ai                −a2             −a1

             i =0                i =1
                                                                  q −1              q −1            q −1              q −1
                                                       y(k − n)                                            y(k − 1)




From controller/filter to code: the optimal implementation problem               Thibault Hilaire (thibault.hilaire@lip6.fr)             9/72
Context                                                                     Linear filters and equivalent realizations



Equivalent realizations
      For a given LTI controller, it exist various equivalent realizations
        • Direct Form I (2n + 1 coefs)
        • Direct Form II (transposed or not) (2n + 1 coefs)




                                                         u(k)                 e(k)                  y(k)
                                                                +                          b0   +
                                                                              q −1

                                                                                e(k − 1)
                                                                +    −a1                   b1   +
                                                                              q −1

                                                                +    −a2                   b2   +
                                                                              q −1

                                                                +    −ai                   bi   +
                                                                              q −1

                                                                     −an                   bn
                                                                            e(k − n)




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   9/72
Context                                                                     Linear filters and equivalent realizations



Equivalent realizations
      For a given LTI controller, it exist various equivalent realizations
        • Direct Form I (2n + 1 coefs)
        • Direct Form II (transposed or not) (2n + 1 coefs)
        • State-space (depend on the basis) ((n + 1)2 coefs)




          X (k + 1) = AX (k) + Bu(k)
               y (k) = CX (k) + Du(k)
                                                                                A
          X (k) → T .X (k)                         U (k)                                                  Y (k)
                                                           B         +         q −1          C        +

                                                                    X(k + 1)          X(k)


                                                                               D




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   9/72
Context                                                                     Linear filters and equivalent realizations



Equivalent realizations
      For a given LTI controller, it exist various equivalent realizations
        • Direct Form I (2n + 1 coefs)
        • Direct Form II (transposed or not) (2n + 1 coefs)
        • State-space (depend on the basis) ((n + 1)2 coefs)
        • δ-operator         δ q−1  ∆


                                                                                 Aδ

                                                   U (k)                                                   Y (k)
                ∆          +   q −1
                                                           Bδ        +         δ −1          Cδ       +

                                                                    X(k + 1)          X(k)
                    δ −1


                                                                               Dδ
          δ[X (k)] = Aδ X (k) + Bδ u(k)
             y (k) = Cδ X (k) + Dδ u(k)




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    9/72
Context                                                                     Linear filters and equivalent realizations



Equivalent realizations
      For a given LTI controller, it exist various equivalent realizations
        • Direct Form I (2n + 1 coefs)
        • Direct Form II (transposed or not) (2n + 1 coefs)
        • State-space (depend on the basis) ((n + 1)2 coefs)
        • δ-operator         δ q−1  ∆
        • Cascad and/or parallel decompositions



                                                                              H1



                                                                              H2

                                                                                        +
          H1       H2       Hi        Hm                                      Hi


                                  H
                                                                              Hm
                                                                                         H




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   9/72
Context                                                                           Linear filters and equivalent realizations



Equivalent realizations
      For a given LTI controller, it exist various equivalent realizations
        • Direct Form I (2n + 1 coefs)
        • Direct Form II (transposed or not) (2n + 1 coefs)
        • State-space (depend on the basis) ((n + 1)2 coefs)
        • δ-operator         δ q−1  ∆
        • Cascad and/or parallel decompositions
        • ρDirect Form II transposed (5n + 1 ou 4n + 1 coefs) ρDFIIt

                                                   u(k)


                                                      βn            βn−1             βi           β1           β0


              +     z   −1   ∆i

                                                            ρ−1            ρ−1             ρ−1          ρ−1
                                                      +



                                                                    +



                                                                                     +



                                                                                                 +



                                                                                                              +
                                                             n              i+1             i            1
                        γi         −1
                                  ρi


                                                      αn            αn−1             αi           α1

                                                                                                                y(k)


From controller/filter to code: the optimal implementation problem     Thibault Hilaire (thibault.hilaire@lip6.fr)      9/72
Context                                                                     Linear filters and equivalent realizations



Equivalent realizations
      For a given LTI controller, it exist various equivalent realizations
        • Direct Form I (2n + 1 coefs)
        • Direct Form II (transposed or not) (2n + 1 coefs)
        • State-space (depend on the basis) ((n + 1)2 coefs)
        • δ-operator         δ q−1  ∆
        • Cascad and/or parallel decompositions
        • ρDirect Form II transposed (5n + 1 ou 4n + 1 coefs) ρDFIIt
        • lattice, ρ-modale, LGC et LCW-structures, sparse state-space,
           etc.



      Each of these realizations uses different coefficients.
      They are equivalent in infinite precision, but no more in finite
      precision. The finite precision degradation (parametric errors and
      roundoff noises) depends on the realization.

From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   9/72
Context                                                                      Linear filters and equivalent realizations



Comparison with polynomials – 1

      It is very interesting to compare filter realizations and polynomial
      evaluation:
                                          z −1
          • The shift operator                                • The multiplication by x




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   10/72
Context                                                                      Linear filters and equivalent realizations



Comparison with polynomials – 1

      It is very interesting to compare filter realizations and polynomial
      evaluation:
                                          z −1
          • The shift operator                                • The multiplication by x
          • Direct forms                                      • Horner’s method




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   10/72
Context                                                                      Linear filters and equivalent realizations



Comparison with polynomials – 1

      It is very interesting to compare filter realizations and polynomial
      evaluation:
                                          z −1
          • The shift operator                                • The multiplication by x
          • Direct forms                                      • Horner’s method
          • ρ-operator                                        • Newton’s basis
                                  n
                                        z − γj                            Pi = Πik=1 (X − xk )
                    i (z)   =
                                          ∆j
                                j=i+1




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   10/72
Context                                                                      Linear filters and equivalent realizations



Comparison with polynomials – 1

      It is very interesting to compare filter realizations and polynomial
      evaluation:
                                          z −1
          • The shift operator                                • The multiplication by x
          • Direct forms                                      • Horner’s method
          • ρ-operator                                        • Newton’s basis
                                  n
                                        z − γj                            Pi = Πik=1 (X − xk )
                    i (z)   =
                                          ∆j
                                j=i+1


          • ρDFIIt                                            • Horner’s method with Newton’s
                                                              basis



From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   10/72
Context                                                                      Linear filters and equivalent realizations



Comparison with polynomials – 2

                                    X (k + 1)      =    AX (k) + Bu(k)
          • State-space
                                         y (k)     =    C X (k) + Du(k)
              
                   X0     =     1 0 ... 0
                                  x
              
                                             
              
              
                                1 0          
          •       Xi +1    =
                                 
                                    ..   ..    Xi
                                               
              
                                      .    . 
              
              
              
                                          1 0
                      P    =     an an−1 . . . a0 Xn




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   11/72
Context                                                                      Linear filters and equivalent realizations



Comparison with polynomials – 2

                                      X (k + 1)    =    T −1 AT X (k) + T −1 Bu(k)
          • State-space
                                           y (k)   =    C T X (k) + Du(k)
              
                   X0     =      1   0 ... 0
                                        x
              
                                                           
              
              
                                     1 0                   
          •       Xi +1    =     T −1 
                                      
                                          ..   ..             T Xi
                                                             
              
                                           .    .          
              
              
              
                                               1           0
                      P    =      an an−1 . . . a0           T Xn
          • Basis change with any T invertible




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   11/72
Context                                                                      Linear filters and equivalent realizations



Comparison with polynomials – 2

                                      X (k + 1)    =    T −1 AT X (k) + T −1 Bu(k)
          • State-space
                                           y (k)   =    C T X (k) + Du(k)
              
                   X0     =      1   0 ... 0
                                        x
              
                                                           
              
              
                                     1 0                   
          •       Xi +1    =     T −1 
                                      
                                          ..   ..             T Xi
                                                             
              
                                           .    .          
              
              
              
                                               1           0
                      P    =      an an−1 . . . a0           T Xn
          • Basis change with any T invertible


      Could it be interesting to consider other polynomial evaluation
      schemes (Estrin, Knuth&Eve, etc.) ?



From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   11/72
Context                                                                      Linear filters and equivalent realizations



HW or SW implementation

      In addition to the choice of the realization, a lot of other options:
         • Fixed-point evaluation schemes
                 • order of the operations
                 • fixed-point alignments
                 • quantization modes, etc.




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   12/72
Context                                                                      Linear filters and equivalent realizations



HW or SW implementation

      In addition to the choice of the realization, a lot of other options:
         • Fixed-point evaluation schemes
                 • order of the operations
                 • fixed-point alignments
                 • quantization modes, etc.
          • Software implementation (µC, DSP, etc.):
              • Parallelization
              • Ressource allocations




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   12/72
Context                                                                      Linear filters and equivalent realizations



HW or SW implementation

      In addition to the choice of the realization, a lot of other options:
         • Fixed-point evaluation schemes
                 • order of the operations
                 • fixed-point alignments
                 • quantization modes, etc.
          • Software implementation (µC, DSP, etc.):
              • Parallelization
              • Ressource allocations
          • Hardware implementation (FPGA, ASIC)
              • Multiple word-length paradigm
              • Operators optimizations (multiplications by constant, etc.)
              • Hardware-oriented arithmetic
              • Operators regroupment




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   12/72
Context                                                                      Linear filters and equivalent realizations



HW or SW implementation

      In addition to the choice of the realization, a lot of other options:
         • Fixed-point evaluation schemes
                 • order of the operations
                 • fixed-point alignments
                 • quantization modes, etc.
          • Software implementation (µC, DSP, etc.):
              • Parallelization
              • Ressource allocations
          • Hardware implementation (FPGA, ASIC)
              • Multiple word-length paradigm
              • Operators optimizations (multiplications by constant, etc.)
              • Hardware-oriented arithmetic
              • Operators regroupment
                                Different levels of optimizations !


From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   12/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology




     2                                         Our approach




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   13/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Outline


     3 Objectives


     4 SIF


     5 Criteria


     6 Evaluation scheme


     7 Methodology




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   14/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Objectives
        Given a controller and a target, find the optimal implementation.

             • Model all the equivalent realizations
                • SIF (Specialized Implicit Form)
             • Model the fixed-point algorithms
                • depends on evaluation schemes for sum-of-products
             • Model the hardware resources
                • computational units, etc.
             • Evaluate the degradation
             • Find one/some optimal realizations
               Tradeoff between:
                 •   Performance / Accuracy (multi-criteria)
                 •   Computational cost
                 •   Area, power consumption
                 •   Computation time, reusability, off-line efforts, etc.
From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   15/72
Objectives               SIF                        Criteria                      Evaluation scheme                   Methodology



From controller to code
                                                    transfer function, state-space, etc.




                                        structure                   SIF


                                   set of equivalent realizations



                                T , ∆, γ, ...                    realization
                                                                   choice

                                                                    Z

                       abstract syntax tree
                                                                                            roundoff modes
                             word-length                       implementation               ...
                       arithmetic operators

                                       fixed-point algorithm (Z*, ...)


                                                                   code
                                         langage
                                                                 generation



                                                                    code




From controller/filter to code: the optimal implementation problem                Thibault Hilaire (thibault.hilaire@lip6.fr)   16/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



A Unifying Framework                                                                                          Realizations



      We have shown that it was possible to describe all these realizations
      in a descriptor framework called Specialized Implicit Form (SIF).
             • Macroscopic description of the computations
             • More general than state-space
             • Explicit all the operations and their linking
                                                      
                  J        0 0   T (k + 1)     0 M N    T (k)
                −K        I 0 X (k + 1) = 0 P Q  X (k)
                 −L        0 I     Y (k)       0 R S    U(k)




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   17/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



A Unifying Framework                                                                                          Realizations



      We have shown that it was possible to describe all these realizations
      in a descriptor framework called Specialized Implicit Form (SIF).
             • Macroscopic description of the computations
             • More general than state-space
             • Explicit all the operations and their linking
                                                      
                  J        0 0   T (k + 1)     0 M N    T (k)
                −K        I 0 X (k + 1) = 0 P Q  X (k)
                 −L        0 I     Y (k)       0 R S    U(k)


      → it is able to represent all the graph flows with delay, additions
      and constant multiplications

         SIF


From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   17/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



A Unifying Framework                                                                                          Realizations



      We have shown that it was possible to describe all these realizations
      in a descriptor framework called Specialized Implicit Form (SIF).
             • Macroscopic description of the computations
             • More general than state-space
             • Explicit all the operations and their linking
                                                      
                  J        0 0   T (k + 1)     0 M N    T (k)
                −K        I 0 X (k + 1) = 0 P Q  X (k)
                 −L        0 I     Y (k)       0 R S    U(k)


   We denote Z the matrix containing all the                                                     
                                                                                           −J M N
   coefficients (and the structure of the                                                    K P Q
                                                                                  Z
   realization)
                                                                                            L R S
         SIF


From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   17/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Different criteria
      We have three kinds of criteria to evaluate the finite-precision
      degradation:
        • Performance:
                 • transfer function error H − H †
                 • poles or zeros errors |λ| − |λ† |
                 • weighted errors




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   18/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Different criteria
      We have three kinds of criteria to evaluate the finite-precision
      degradation:
        • Performance:
                 • transfer function error H − H †
                 • poles or zeros errors |λ| − |λ† |
                 • weighted errors
             • Accuracy:
                 • Signal to Quantization Noise Ratio




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   18/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Different criteria
      We have three kinds of criteria to evaluate the finite-precision
      degradation:
        • Performance:
                 • transfer function error H − H †
                 • poles or zeros errors |λ| − |λ† |
                 • weighted errors
             • Accuracy:
                 • Signal to Quantization Noise Ratio
             • Computational cost:
                 • number of coefficients, number of operations
                 • area, power consumption (FPGA, ASIC)
                 • WCET
                 • complexity, etc.




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   18/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Different criteria
      We have three kinds of criteria to evaluate the finite-precision
      degradation:
        • Performance:
                 • transfer function error H − H †
                 • poles or zeros errors |λ| − |λ† |
                 • weighted errors
             • Accuracy:
                 • Signal to Quantization Noise Ratio
             • Computational cost:
                 • number of coefficients, number of operations
                 • area, power consumption (FPGA, ASIC)
                 • WCET
                 • complexity, etc.

      → These criteria require to know the exact implementation.



From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   18/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Different criteria
      We have three kinds of criteria to evaluate the finite-precision
      degradation:
        • Performance:
                 • transfer function error H − H †
                 • poles or zeros errors |λ| − |λ† |
                 • weighted errors
             • Accuracy:
                 • Signal to Quantization Noise Ratio
             • Computational cost:
                 • number of coefficients, number of operations
                 • area, power consumption (FPGA, ASIC)
                 • WCET
                 • complexity, etc.

      → These criteria require to know the exact implementation.
      So we extend them in a priori criteria (that do not depend on
      implementation) and a posteriori criteria.
From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   18/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



a priori criteria – 1                                                                                              a priori
                                                                                                                  measures




      These criteria come from control:
      a priori measures
             • sensitivity with respect to the coefficients Z
                 • transfer function sensitivity : ∂H
                                                   ∂Z




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    19/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



a priori criteria – 1                                                                                              a priori
                                                                                                                  measures




      These criteria come from control:
      a priori measures
             • sensitivity with respect to the coefficients Z
                 • transfer function sensitivity : ∂H
                                                   ∂Z
                 • poles or zeros sensitivity : ∂|λk |
                                                 ∂Z




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    19/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



a priori criteria – 1                                                                                              a priori
                                                                                                                  measures




      These criteria come from control:
      a priori measures
             • sensitivity with respect to the coefficients Z
                 • transfer function sensitivity : ∂H
                                                   ∂Z
                 • poles or zeros sensitivity : ∂|λk |
                                                 ∂Z
             • Roundoff Noise Gain
               we suppose here that each quantization error leads to the addition of a
               white independent uniform noise
               → Gain from these noises to the output




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    19/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



a priori criteria – 2                                                                                              a priori
                                                                                                                  measures



      The idea is to approximate how much the transfer function is
      modified by the coefficients’ quantization.
      Denote

                         0 if Zi,j could be exactly implemented ∈ {2p |p ∈ Z}
        (δZ )i,j =
                         1 else

      Then, the transfer function error is approached by the L2 -sensitivity
      measure
      L2 -sensitivity measure
                                                                       2
                                                       ∂H
                                         ML2 =            × δZ
                                                       ∂Z              2




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    20/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



a priori criteria – 3                                                                                              a priori
                                                                                                                  measures
      In a same way, the pole error is approached by a pole-sensitivity
      measured.
      pole-sensitivity
                                             n                               2
                                                        ∂ |λk |
                                   Ψ             ωk             × δZ
                                                         ∂Z                  F
                                           k=1

      where λk are the poles, and ωk some wieghting parameters (usually
             1
      ωk = 1−|λ | )
                     k




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    21/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



a priori criteria – 3                                                                                              a priori
                                                                                                                  measures
      In a same way, the pole error is approached by a pole-sensitivity
      measured.
      pole-sensitivity
                                             n                               2
                                                        ∂ |λk |
                                   Ψ             ωk             × δZ
                                                         ∂Z                  F
                                           k=1

      where λk are the poles, and ωk some wieghting parameters (usually
              1
      ωk = 1−|λ | )
                k
      →In closed-loop, Ψ is related to the distance to instability.




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    21/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



a priori criteria – 3                                                                                              a priori
                                                                                                                  measures
      In a same way, the pole error is approached by a pole-sensitivity
      measured.
      pole-sensitivity
                                             n                               2
                                                        ∂ |λk |
                                   Ψ             ωk             × δZ
                                                         ∂Z                  F
                                           k=1

      where λk are the poles, and ωk some wieghting parameters (usually
              1
      ωk = 1−|λ | )
                k
      →In closed-loop, Ψ is related to the distance to instability.

      These measures have been developed for the SIF:
             • MIMO case
             • open and closed-loop cases
             • analytical expressions
                                                                                                         2
      And extended with more accurate fixed-point considerations                                         σδH


From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    21/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



a posteriori measure                                                                                              a posteriori
                                                                                                                   measures




      The main measure based on exact implementation is the Signal to
      Quantization Noise Ratio SQNR :
      a posteriori measure
     It measures the noise on the output produced by the implementation
        • bit-accurate measure
        • depends on HW/SW
                 • wordlength
                 • evaluation scheme (order, roundoff mode, etc.)
             • an optimization on the word-length can be done

      → For that purpose, we need to generate bit-accurate fixed-point
      algorithms



From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)     22/72
Objectives               SIF                Criteria                   Evaluation scheme                    Methodology



Sum-of-products evaluation scheme – 1                                                                                fixed-point
                                                                                                                     evaluation
                                                                                                                      schemes


      The only operations needed are sum-of-products:
                                                        n
                                              S=             ci · xi
                                                       i=1

      where ci are known constants and xi variables (inputs, state or
      intermediate variables).
      We have developed technics to transform real sum-of-products into
      fixed-point algorithms:
             • we consider the Πn (2i − 1) possible ordered-sum-of-products
                                i=1
               (assuming the fixed-point addition is commutative but not associative)
             • given the various word-lengths (operators, constants), we
               propagate fixed-point rules among the abstract syntax tree
             • we consider various scheme (RBM/RAM, no-shifts, etc.)


From controller/filter to code: the optimal implementation problem      Thibault Hilaire (thibault.hilaire@lip6.fr)    23/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Sum-of-products evaluation scheme – 2                                                                             fixed-point
                                                                                                                  evaluation
                                                                                                                   schemes


      S = 1.524·X0 +4.89765·X1 −42.3246·X2 +58.35498·X3 +2.857·X4 −49.3246·X5 +24.3468·X6

             • 8-bit coefficients, 16-bit additions
             • Q6.2 for xi and s




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)    24/72
Objectives               SIF                                Criteria                                   Evaluation scheme                                  Methodology
Sujet de la Th`se
              e                                                                                                                                  Travaux r´alis´s jusqu’ici
                                                                                                                                                          e e


Sum-of-products evaluation scheme – 2
Ordered Sum of Products                                                                                                                                           fixed-point
                                                                                                                                                                  evaluation
                                                                                                                                                                   schemes


       S = 1.524·X0 +4.89765·Xe−42.3246·X2 +58.35498·X3 +2.857·X4 −49.3246·X5 +24.3468·X6
       On fixe ici les repr´sentations virgule fixe :
                              1

               8 bits sign´s pour les coefficients
                          e
           • 8-bit coefficients, 16-bit additions
               Q6, 2 pour les Xi et S.
           • Q6.2 for xi and s
                                                                                             S


                                                                                             +


                                                                 +                                                             +


                                       >> 4                                             +                             ×             >> 1


                                        +                                                                                               ×
                                                                          +                            ×        117       X3

                          >> 1                     ×                                                                               97
                                                             >> 3                   ×                                                       X6
                                                                                                 -99       X5
                              ×
                                              91       X4        ×
                                                                              -85       X2

                         98       X0                        78       X1




                                        Roundoff After Multiplication
                                         Roundoff After Multiplication

       →The roundoff noise is then deduced
From controller/filter to code: the optimal implementation problem                                      Thibault Hilaire (thibault.hilaire@lip6.fr)                 24/72
Objectives               SIF                                Criteria                                Evaluation scheme                                      Methodology
 Sujet de la Th`se
               e                                                                                                                                   Travaux r´alis´s jusqu’ici
                                                                                                                                                            e e

 Ordered Sum of Products
Sum-of-products evaluation scheme – 2                                                                                                                             fixed-point
                                                                                                                                                                  evaluation
                                                                                                                                                                   schemes


      S On fixe 0 +4.89765·X1 −42.3246·X2 +58.35498·X3 +2.857·X4 −49.3246·X5 +24.3468·X6
        = 1.524·X ici les repr´sentations virgule fixe :
                              e
                8 bits sign´s pour les coefficients
                           e
          • 8-bit coefficients, 16-bit additions
                Q6, 2 pour les Xi et S.
          • Q6.2 for xi and s
                                                                                              S


                                                                                              +


                                                                  +                                                             +


                                         >> 4                                            +                             ×                  ×

                                          +                                                                                         >> 1
                                                                           +                            ×        117       X3                 X6

                                ×                    ×                                                                               97
                                                                  ×                  ×            -99       X5

                          >> 1                  91
                                    X0                   X4 >> 3
                                                                      X1       -85       X2

                           98
                                                             78




                                         Roundoff Before Multiplication
                                         Roundoff Before Multiplication

      →The roundoff noise is then deduced
From controller/filter to code: the optimal implementation problem                                  Thibault Hilaire (thibault.hilaire@lip6.fr)                     24/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



State-space example




              
                                         0.58399 −0.42019            0.64635
                  X (k + 1)      =                         X (k) +
              
                                         0.42019  0.1638             −0.23982
                        Y (k)    =      0.64635 0.23982 X (k) + 0.13111U(k)
              




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   25/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



State-space example
              
                                         0.58399 −0.42019            0.64635
                  X (k + 1)      =                         X (k) +
              
                                         0.42019  0.1638             −0.23982
                        Y (k)    =      0.64635 0.23982 X (k) + 0.13111U(k)
              

   16-bit input, output, states
   16-bit coefficients
   32-bit accumulators
   max
    U = 10




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   25/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



State-space example
              
                                         0.58399 −0.42019            0.64635
                  X (k + 1)      =                         X (k) +
              
                                         0.42019  0.1638             −0.23982
                        Y (k)    =      0.64635 0.23982 X (k) + 0.13111U(k)
              

   16-bit input, output, states
   16-bit coefficients                                       Roundoff After Multiplication
   32-bit accumulators                                     Intermediate variables
   max                                                     Acc ← (xn(1) ∗ 19136);
    U = 10 ⇒ γU = 11
                                                          Acc ← Acc + (xn(2) ∗ −27537) >> 1;
              26                                           Acc ← Acc + (u ∗ 21179);
                                                           xnp(1) ← Acc >> 15;
   γADD = 27                                             Acc ← (xn(1) ∗ 27537);
              26                                           Acc ← Acc + (xn(2) ∗ 21470) >> 1;
                                                         Acc ← Acc + (u ∗ −31433) >> 1;
            15 16 15                                       xnp(2) ← Acc >> 16;
                                                           Outputs
   γZ = 16 17 17                                         Acc ← (xn(1) ∗ 21179);
            15 17 17                                       Acc ← Acc + (xn(2) ∗ 31433) >> 2;
                                                           Acc ← Acc + (u ∗ 17184) >> 2;
           11                                              y ← Acc >> 15;
   γX =                                                    Permutations
           11                                              xn ← xnp;




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   25/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology

                                                                                                                   realization

Optimal realization                                                                                               optimization




      A 1st possible optimization concerns the realization




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)     26/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology

                                                                                                                   realization

Optimal realization                                                                                               optimization




      A 1st possible optimization concerns the realization
      Let H be a given controller, we denote RH the set of equivalent
      realizations (with H as transfer function).
                                                         2
      Let J be an a priori criterion (sensibility, RNG, σ∆H , ...).

      The optimal realization problem
      The optimal realization problem consists in finding a realization
      that minimizes J
                             Ropt = arg min J (R)
                                                       R∈RH




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)     26/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology

                                                                                                                   realization

Optimal realization                                                                                               optimization




      A 1st possible optimization concerns the realization
      Let H be a given controller, we denote RH the set of equivalent
      realizations (with H as transfer function).
                                                         2
      Let J be an a priori criterion (sensibility, RNG, σ∆H , ...).

      The optimal realization problem
      The optimal realization problem consists in finding a realization
      that minimizes J
                             Ropt = arg min J (R)
                                                       R∈RH

      RH is too large, so pratically we only considered structured
      realizations (state-space, ρ-forms, etc.)


From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)     26/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Example – 1


      We consider the following transfer function:

                               38252z 3 − 101878z 2 + 91135z − 27230
               H:z →
                          z 4 − 2.3166z 3 + 2.1662z 2 − 0.96455z + 0.17565

                                           ¯
             • Closed-loop L2 -sensitivity ML2
                                              ¯
             • Closed-loop pole-sensitivity : Ψ
                                          ¯
             • Roundoff Noise Gain (RNG) : G




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   27/72
Objectives               SIF                  Criteria              Evaluation scheme                    Methodology



Example – 2
                     ¯W
                     ML2                  ¯
                                          Ψ                 ¯
                                                            G                    ¯
                                                                                TO               Nb. op.
         Z1      1.9046e+7          3.3562e+7            1.186e+6                                7 + 8×




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   28/72
Objectives               SIF                  Criteria              Evaluation scheme                    Methodology



Example – 2
                     ¯W
                     ML2                  ¯
                                          Ψ                 ¯
                                                            G                    ¯
                                                                                TO               Nb. op.
         Z1      1.9046e+7          3.3562e+7             1.186e+6         3.6764e+8            7 + 8×
         Z2      3.6427e+5          6.5007e+5            3.6582e+2                             19 + 24×




      Z1 : canonical form
      Z2 : balanced state-space




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   28/72
Objectives               SIF                  Criteria              Evaluation scheme                    Methodology



Example – 2
                     ¯W
                     ML2                  ¯
                                          Ψ                 ¯
                                                            G                    ¯
                                                                                TO               Nb. op.
         Z1      1.9046e+7          3.3562e+7             1.186e+6         3.6764e+8            7 + 8×
         Z2      3.6427e+5          6.5007e+5            3.6582e+2                             19 + 24×
         Z3      1.5267e+3          1.6689e+4            1.7455e+2                             19 + 24×




           ¯
      Z3 : ML2 -optimal state-space




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   28/72
Objectives               SIF                  Criteria              Evaluation scheme                    Methodology



Example – 2
                     ¯W
                     ML2                  ¯
                                          Ψ                 ¯
                                                            G                    ¯
                                                                                TO               Nb. op.
         Z1      1.9046e+7          3.3562e+7             1.186e+6         3.6764e+8            7 + 8×
         Z2      3.6427e+5          6.5007e+5            3.6582e+2                             19 + 24×
         Z3      1.5267e+3          1.6689e+4            1.7455e+2                             19 + 24×
         Z4      1.6272e+3          2.7425e+3            1.1778e+2                             19 + 24×



           ¯
      Z4 : Ψ-optimal state-space




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   28/72
Objectives               SIF                  Criteria              Evaluation scheme                    Methodology



Example – 2
                     ¯W
                     ML2                  ¯
                                          Ψ                 ¯
                                                            G                    ¯
                                                                                TO               Nb. op.
         Z1      1.9046e+7         3.3562e+7              1.186e+6         3.6764e+8            7 + 8×
         Z2     3.6427e+5          6.5007e+5             3.6582e+2                             19 + 24×
         Z3     1.5267e+3          1.6689e+4             1.7455e+2                             19 + 24×
         Z4     1.6272e+3          2.7425e+3             1.1778e+2                             19 + 24×
         Z5     1.9474e+13         1.2294e+13            3.2261e−3                             19 + 24×


           ¯
      Z5 : G -optimal state-space




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   28/72
Objectives               SIF                  Criteria              Evaluation scheme                    Methodology



Example – 2
                     ¯W
                     ML2                  ¯
                                          Ψ                 ¯
                                                            G                    ¯
                                                                                TO               Nb. op.
         Z1      1.9046e+7         3.3562e+7              1.186e+6         3.6764e+8            7 + 8×
         Z2     3.6427e+5          6.5007e+5             3.6582e+2         1.1387e+5           19 + 24×
         Z3     1.5267e+3          1.6689e+4             1.7455e+2         5.4111e+4           19 + 24×
         Z4     1.6272e+3          2.7425e+3             1.1778e+2         3.6512e+4           19 + 24×
         Z5     1.9474e+13         1.2294e+13            3.2261e−3        1.7239e+10           19 + 24×
         Z6     2.8696e+3          4.5371e+3             7.9809e−3        6.0078e+0            19 + 24×

      Tradeoff measure: we are looking for a good enough realization:
                                              ¯W        ¯       ¯
                                              ML2 (Z ) Ψ(Z ) G (Z )
                                ¯
                               TO(Z )                 + ¯ opt + ¯ opt
                                              ¯W
                                              ML opt    Ψ       G
                                                   2


            ¯
      Z6 : TO-optimal state-space




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   28/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Example – 3


                       ¯W
                       ML2                ¯
                                          Ψ                 ¯
                                                            G                   ¯
                                                                               TO              Nb. op.
             Z7    1.5342e−2         8.1051e−2         2.8082e−8          4.5466e+0           11 + 12×
             Z8    1.5341e−2         8.089e−2          4.217e−8           4.8783e+0           11 + 16×
             Z9    1.1388e−1         2.8203e−2         3.7783e−6          9.8937e+1           11 + 16×
             Z10   1.5342e−2         8.0015e−2         4.1742e−8          4.8371e+0           11 + 16×
             Z11   1.6065e−2         3.8802e−2         4.7451e−8          3.5597e+0           11 + 16×


      Z7 : γ = 1111 : δ-Direct Form II
            ¯W
      Z8 : ML2 -optimal ρDFIIt
           ¯
      Z9 : Ψ-optimal ρDFIIt
            ¯
      Z10 : G -optimal ρDFIIt
             ¯
      Z11 : TO-optimal ρDFIIt



From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   29/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Word-lengths optimization                                                                                     word-length
                                                                                                              optimization




      A 2nd possible optimization concerns the hardware implementation
      On FPGA or ASIC, one can use multiple wordlength paradigm
      Optimal word-length
      Let Z be a realization and β = (βZ , βT , βX , βY , βADD ) the
      word-length
      We consider J a computational cost (area, power consumption,
      WCET, etc.). The optimal wordlength problem is:

                      β opt = arg min J (β) with SQNR                          SQNRmin
                                    β∈B




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   30/72
Objectives                     SIF                             Criteria         Evaluation scheme                    Methodology



Global methodology
                                               transfer function


             a)                                 b)
                                   structure
                  Structure
                                                        SIF
                   catalog

                                     set of equivalent
                                       realizations
                                                c)
                                                       optimal
                  a priori measure
                                                     realization

                                          realization                              a) Choose a structure
                                               d)
                  implementation
                     scheme
                                                 fixed-point                        (state-space, ρDFIIt, ...)
                                               implementation

                              fixed-point realization               wordlength

                                               e)
                                                   optimal
                                               implementation



                                               f)
                                                       code
                          language
                                                     generation


                                                        code


From controller/filter to code: the optimal implementation problem               Thibault Hilaire (thibault.hilaire@lip6.fr)   31/72
Objectives                     SIF                             Criteria         Evaluation scheme                    Methodology



Global methodology
                                               transfer function


             a)                                 b)
                                   structure
                  Structure
                                                        SIF
                   catalog

                                     set of equivalent
                                       realizations
                                                c)
                                                       optimal
                  a priori measure
                                                     realization

                                          realization                               b) Formalization SIF and
                                               d)
                  implementation
                     scheme
                                                 fixed-point                        set of equivalent
                                               implementation
                                                                                   realizations
                              fixed-point realization               wordlength

                                               e)
                                                   optimal
                                               implementation



                                               f)
                                                       code
                          language
                                                     generation


                                                        code


From controller/filter to code: the optimal implementation problem               Thibault Hilaire (thibault.hilaire@lip6.fr)   31/72
Objectives                     SIF                             Criteria         Evaluation scheme                    Methodology



Global methodology
                                               transfer function


             a)                                 b)
                                   structure
                  Structure
                                                        SIF
                   catalog

                                     set of equivalent
                                       realizations
                                                c)
                                                       optimal
                  a priori measure
                                                     realization

                                          realization

                                               d)
                                                                                     c) Optimization of an a
                  implementation                 fixed-point
                     scheme                    implementation                      priori criterion
                              fixed-point realization               wordlength

                                               e)
                                                   optimal
                                               implementation



                                               f)
                                                       code
                          language
                                                     generation


                                                        code


From controller/filter to code: the optimal implementation problem               Thibault Hilaire (thibault.hilaire@lip6.fr)   31/72
Objectives                     SIF                             Criteria         Evaluation scheme                    Methodology



Global methodology
                                               transfer function


             a)                                 b)
                                   structure
                  Structure
                                                        SIF
                   catalog

                                     set of equivalent
                                       realizations
                                                c)
                                                       optimal
                  a priori measure
                                                     realization
                                                                                     d) Given some
                                          realization                              word-lengths and an
                  implementation
                                               d)
                                                 fixed-point                        sum-of-products evaluation
                     scheme                    implementation
                                                                                   scheme, the fixed-point
                              fixed-point realization               wordlength
                                                                                   representation are defined
                                               e)
                                                   optimal
                                               implementation



                                               f)
                                                       code
                          language
                                                     generation


                                                        code


From controller/filter to code: the optimal implementation problem               Thibault Hilaire (thibault.hilaire@lip6.fr)   31/72
Objectives                     SIF                             Criteria         Evaluation scheme                    Methodology



Global methodology
                                               transfer function


             a)                                 b)
                                   structure
                  Structure
                                                        SIF
                   catalog

                                     set of equivalent
                                       realizations
                                                c)
                                                       optimal
                  a priori measure
                                                     realization                      e) Optimization of the
                                          realization
                                                                                   implementation:
                                               d)                                  optimization of a
                  implementation                 fixed-point
                     scheme                    implementation                      computational cost under
                              fixed-point realization               wordlength      a priori criterion constraint
                                               e)
                                                   optimal
                                               implementation



                                               f)
                                                       code
                          language
                                                     generation


                                                        code


From controller/filter to code: the optimal implementation problem               Thibault Hilaire (thibault.hilaire@lip6.fr)   31/72
Objectives                     SIF                             Criteria         Evaluation scheme                    Methodology



Global methodology
                                               transfer function


             a)                                 b)
                                   structure
                  Structure
                                                        SIF
                   catalog

                                     set of equivalent
                                       realizations
                                                c)
                                                       optimal
                  a priori measure
                                                     realization

                                          realization

                                               d)
                                                                                      f) Fixed-point code
                  implementation                 fixed-point
                     scheme                    implementation                      generation (C, VHDL, ...)
                              fixed-point realization               wordlength

                                               e)
                                                   optimal
                                               implementation



                                               f)
                                                       code
                          language
                                                     generation


                                                        code


From controller/filter to code: the optimal implementation problem               Thibault Hilaire (thibault.hilaire@lip6.fr)   31/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Example – 1

      An other example to be implemented on 8-bit device (with 16-bit
      accumulator)

                                      0.02088z 2 + 0.04176z + 0.02088
                         H(z) =
                                           z 2 − 1.651z + 0.7342




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   32/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Example – 1

      An other example to be implemented on 8-bit device (with 16-bit
      accumulator)

                                      0.02088z 2 + 0.04176z + 0.02088
                         H(z) =
                                           z 2 − 1.651z + 0.7342
      Some possible realizations:
     R1 : Direct Form I
     R2 : Direct Form II
     R3 : Balanced state-space
           2
     R4 : σ∆H -optimal state-space
     R5 : optimal state-space with δ-optimal
     R6 : optimal ρ-Direct Form II


From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   32/72
Objectives               SIF                Criteria                Evaluation scheme                    Methodology



Example – 2


      Roundoff Before Multiplication - 8 bits

             realisation     2
                           σ∆H                   H − H† 2     σξ2    Nb + ×
                 R1      114.8242                0.024423  0.0092127 4 + 5×
                 R2       51.0143                0.02797   0.017759  4 + 6×
                 R3       8.7612                 0.012219  0.0012579 6 + 9×
                 R4       11.3538               0.0089503 0.0012985 6 + 9×
                 R5       4.6303                0.0040723 0.0037008 8 + 11×
                 R6       7.3958                 0.010575 0.00064769 6 + 7×




From controller/filter to code: the optimal implementation problem   Thibault Hilaire (thibault.hilaire@lip6.fr)   33/72
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code
From controller to code

Weitere ähnliche Inhalte

Was ist angesagt?

២១ ខេត្តតាកែវ
២១ ខេត្តតាកែវ២១ ខេត្តតាកែវ
២១ ខេត្តតាកែវsam seyla hun
 
Math1003 1.10 - Binary to Hex Conversion
Math1003 1.10 - Binary to Hex ConversionMath1003 1.10 - Binary to Hex Conversion
Math1003 1.10 - Binary to Hex Conversiongcmath1003
 
Math1003 1.11 - Hex to Binary Conversion
Math1003 1.11 - Hex to Binary ConversionMath1003 1.11 - Hex to Binary Conversion
Math1003 1.11 - Hex to Binary Conversiongcmath1003
 
០៥ ខេត្តកំពង់ស្ពឺ
០៥ ខេត្តកំពង់ស្ពឺ០៥ ខេត្តកំពង់ស្ពឺ
០៥ ខេត្តកំពង់ស្ពឺsam seyla hun
 
១៤ ខេត្តព្រៃវែង
១៤ ខេត្តព្រៃវែង១៤ ខេត្តព្រៃវែង
១៤ ខេត្តព្រៃវែងsam seyla hun
 
Graphic Storytelling in New Media
Graphic Storytelling in New MediaGraphic Storytelling in New Media
Graphic Storytelling in New MediaTyler Sticka
 
១៧ ខេត្តសៀមរាប
១៧ ខេត្តសៀមរាប១៧ ខេត្តសៀមរាប
១៧ ខេត្តសៀមរាបsam seyla hun
 
១៣ ខេត្តព្រះវិហារ
១៣ ខេត្តព្រះវិហារ១៣ ខេត្តព្រះវិហារ
១៣ ខេត្តព្រះវិហារsam seyla hun
 
២០ ស្វាយរៀង
២០ ស្វាយរៀង២០ ស្វាយរៀង
២០ ស្វាយរៀងsam seyla hun
 
ML7 in Clinical Use
ML7 in Clinical UseML7 in Clinical Use
ML7 in Clinical Usejdennewill
 
All india gsm figures july 2012 final (2)
All india gsm figures july 2012   final (2)All india gsm figures july 2012   final (2)
All india gsm figures july 2012 final (2)vineet agarwal
 
'Abacus' - future of personal finance project
'Abacus' - future of personal finance project'Abacus' - future of personal finance project
'Abacus' - future of personal finance projectFraser
 
Jan. 5 Similar Polygons
Jan. 5 Similar PolygonsJan. 5 Similar Polygons
Jan. 5 Similar PolygonsRyanWatt
 

Was ist angesagt? (17)

២១ ខេត្តតាកែវ
២១ ខេត្តតាកែវ២១ ខេត្តតាកែវ
២១ ខេត្តតាកែវ
 
Math1003 1.10 - Binary to Hex Conversion
Math1003 1.10 - Binary to Hex ConversionMath1003 1.10 - Binary to Hex Conversion
Math1003 1.10 - Binary to Hex Conversion
 
Math1003 1.11 - Hex to Binary Conversion
Math1003 1.11 - Hex to Binary ConversionMath1003 1.11 - Hex to Binary Conversion
Math1003 1.11 - Hex to Binary Conversion
 
០៥ ខេត្តកំពង់ស្ពឺ
០៥ ខេត្តកំពង់ស្ពឺ០៥ ខេត្តកំពង់ស្ពឺ
០៥ ខេត្តកំពង់ស្ពឺ
 
១៤ ខេត្តព្រៃវែង
១៤ ខេត្តព្រៃវែង១៤ ខេត្តព្រៃវែង
១៤ ខេត្តព្រៃវែង
 
Graphic Storytelling in New Media
Graphic Storytelling in New MediaGraphic Storytelling in New Media
Graphic Storytelling in New Media
 
១៧ ខេត្តសៀមរាប
១៧ ខេត្តសៀមរាប១៧ ខេត្តសៀមរាប
១៧ ខេត្តសៀមរាប
 
១៣ ខេត្តព្រះវិហារ
១៣ ខេត្តព្រះវិហារ១៣ ខេត្តព្រះវិហារ
១៣ ខេត្តព្រះវិហារ
 
២០ ស្វាយរៀង
២០ ស្វាយរៀង២០ ស្វាយរៀង
២០ ស្វាយរៀង
 
Modeling & Simulation
Modeling & SimulationModeling & Simulation
Modeling & Simulation
 
01 - Software
01 - Software01 - Software
01 - Software
 
ML7 in Clinical Use
ML7 in Clinical UseML7 in Clinical Use
ML7 in Clinical Use
 
Education 3.0: Better Learning Through Technology
Education 3.0:  Better Learning Through TechnologyEducation 3.0:  Better Learning Through Technology
Education 3.0: Better Learning Through Technology
 
All india gsm figures july 2012 final (2)
All india gsm figures july 2012   final (2)All india gsm figures july 2012   final (2)
All india gsm figures july 2012 final (2)
 
'Abacus' - future of personal finance project
'Abacus' - future of personal finance project'Abacus' - future of personal finance project
'Abacus' - future of personal finance project
 
Cômoda para Bebê Magia
Cômoda para Bebê MagiaCômoda para Bebê Magia
Cômoda para Bebê Magia
 
Jan. 5 Similar Polygons
Jan. 5 Similar PolygonsJan. 5 Similar Polygons
Jan. 5 Similar Polygons
 

Andere mochten auch

Andere mochten auch (14)

Raybiztech Mobile Solutions
Raybiztech Mobile SolutionsRaybiztech Mobile Solutions
Raybiztech Mobile Solutions
 
Raybiztech PHP Capabilities
Raybiztech PHP CapabilitiesRaybiztech PHP Capabilities
Raybiztech PHP Capabilities
 
RayBiztech One View HRM
RayBiztech One View HRMRayBiztech One View HRM
RayBiztech One View HRM
 
Raybiztech V Tiger Competency
Raybiztech V Tiger CompetencyRaybiztech V Tiger Competency
Raybiztech V Tiger Competency
 
Raybiztech Engagement Modules
Raybiztech Engagement ModulesRaybiztech Engagement Modules
Raybiztech Engagement Modules
 
Betalingsbalans
BetalingsbalansBetalingsbalans
Betalingsbalans
 
Les 5
Les 5Les 5
Les 5
 
photo chemistry of ligand in coordination compound
 photo chemistry of ligand in coordination compound photo chemistry of ligand in coordination compound
photo chemistry of ligand in coordination compound
 
Les 1
Les 1Les 1
Les 1
 
Ray Business Technologies Company Profile - Presentation
Ray Business Technologies Company Profile - PresentationRay Business Technologies Company Profile - Presentation
Ray Business Technologies Company Profile - Presentation
 
Introduction to Global Perspectives at Headstart
Introduction to Global Perspectives at HeadstartIntroduction to Global Perspectives at Headstart
Introduction to Global Perspectives at Headstart
 
Skillsume brochure
Skillsume brochureSkillsume brochure
Skillsume brochure
 
Ss notes ( sri lanka )
Ss notes ( sri lanka )Ss notes ( sri lanka )
Ss notes ( sri lanka )
 
EPR spectroscopy.
EPR spectroscopy.EPR spectroscopy.
EPR spectroscopy.
 

Ähnlich wie From controller to code

Ashley Carroll Design
Ashley Carroll DesignAshley Carroll Design
Ashley Carroll DesignAshley Baker
 
Effective and Efficient Shape-Based Pattern Detection over Streaming Time Series
Effective and Efficient Shape-Based Pattern Detection over Streaming Time SeriesEffective and Efficient Shape-Based Pattern Detection over Streaming Time Series
Effective and Efficient Shape-Based Pattern Detection over Streaming Time Seriesambitlick
 
Effective and efficient shape based pattern
Effective and efficient shape based patternEffective and efficient shape based pattern
Effective and efficient shape based patternambitlick
 
Measuring and Monitoring Foot and Mouth Disease Occurrence Melissa McLaws EuFMD
Measuring and Monitoring Foot and Mouth Disease Occurrence Melissa McLaws EuFMDMeasuring and Monitoring Foot and Mouth Disease Occurrence Melissa McLaws EuFMD
Measuring and Monitoring Foot and Mouth Disease Occurrence Melissa McLaws EuFMDFAO
 
Building a better web
Building a better webBuilding a better web
Building a better webBen Schwarz
 
Chemical Supply Chain
Chemical Supply ChainChemical Supply Chain
Chemical Supply ChainNatashaS7
 
Medical Device Integration - Alliance Of Chicago UIC Team Analysis
Medical Device Integration - Alliance Of Chicago UIC Team AnalysisMedical Device Integration - Alliance Of Chicago UIC Team Analysis
Medical Device Integration - Alliance Of Chicago UIC Team AnalysisDinesh Jayapathy
 

Ähnlich wie From controller to code (7)

Ashley Carroll Design
Ashley Carroll DesignAshley Carroll Design
Ashley Carroll Design
 
Effective and Efficient Shape-Based Pattern Detection over Streaming Time Series
Effective and Efficient Shape-Based Pattern Detection over Streaming Time SeriesEffective and Efficient Shape-Based Pattern Detection over Streaming Time Series
Effective and Efficient Shape-Based Pattern Detection over Streaming Time Series
 
Effective and efficient shape based pattern
Effective and efficient shape based patternEffective and efficient shape based pattern
Effective and efficient shape based pattern
 
Measuring and Monitoring Foot and Mouth Disease Occurrence Melissa McLaws EuFMD
Measuring and Monitoring Foot and Mouth Disease Occurrence Melissa McLaws EuFMDMeasuring and Monitoring Foot and Mouth Disease Occurrence Melissa McLaws EuFMD
Measuring and Monitoring Foot and Mouth Disease Occurrence Melissa McLaws EuFMD
 
Building a better web
Building a better webBuilding a better web
Building a better web
 
Chemical Supply Chain
Chemical Supply ChainChemical Supply Chain
Chemical Supply Chain
 
Medical Device Integration - Alliance Of Chicago UIC Team Analysis
Medical Device Integration - Alliance Of Chicago UIC Team AnalysisMedical Device Integration - Alliance Of Chicago UIC Team Analysis
Medical Device Integration - Alliance Of Chicago UIC Team Analysis
 

Kürzlich hochgeladen

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Kürzlich hochgeladen (20)

A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

From controller to code

  • 1. From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 1/72
  • 2. Context Linear filters and equivalent realizations 1 Context and problematics From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 2/72
  • 3. Context Linear filters and equivalent realizations Outline 1 Context 2 Linear filters and equivalent realizations From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 3/72
  • 4. Context Linear filters and equivalent realizations Context 0 01 01 11 11 0 10 0 00 01 1 01 10 11 10 11 110 010 10 00 00 10 1 01 10 10 01 0 01 01 implantation Implementation implantation Filters/Controllers algorithmes TS Cibles Targets Algorithms algorithmes TS Cibles From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 4/72
  • 5. Context Linear filters and equivalent realizations Context 0 01 01 11 11 0 10 0 00 01 1 01 10 11 10 11 110 010 10 00 00 10 1 01 10 10 01 0 01 01 implantation Implementation implantation Filters/Controllers algorithmes TS Cibles Targets Algorithms algorithmes TS Cibles From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 4/72
  • 6. Context Linear filters and equivalent realizations Context 0 01 01 11 11 0 10 0 00 01 1 01 10 11 10 11 110 010 10 00 00 10 1 01 10 10 01 0 01 01 implantation Implementation implantation Filters/Controllers algorithmes TS Cibles Targets Algorithms algorithmes TS Cibles From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 4/72
  • 7. Context Linear filters and equivalent realizations Context 0 01 01 11 11 0 10 0 00 01 1 01 10 11 10 11 110 010 10 00 00 10 1 01 10 10 01 0 01 01 implantation Implementation implantation Filters/Controllers algorithmes TS Cibles Targets Algorithms algorithmes TS Cibles • Finite precision implementation (fixed-point arithmetic) • LTI systems • hardware (FPGA, ASIC) or software (DSP, µC) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 4/72
  • 8. Context Linear filters and equivalent realizations Context 0 01 01 11 11 0 10 0 00 01 1 01 10 11 10 11 110 010 10 00 00 10 1 01 10 10 01 0 01 01 implantation Implementation implantation Filters/Controllers algorithmes TS Cibles Targets Algorithms algorithmes TS Cibles • Finite precision implementation (fixed-point arithmetic) • LTI systems • hardware (FPGA, ASIC) or software (DSP, µC) Methodology for the implementation of embedded algorithms (controllers/filters) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 4/72
  • 9. Context Linear filters and equivalent realizations Implementation under constraints Embedded systems suffer from various constraints: • Cost (short Time to Market, rapid renewal, etc...) • Power consumption (energy-autonomous systems) • Resources (Limited computing resources (no FPU)) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 5/72
  • 10. Context Linear filters and equivalent realizations Implementation under constraints Embedded systems suffer from various constraints: • Cost (short Time to Market, rapid renewal, etc...) • Power consumption (energy-autonomous systems) • Resources (Limited computing resources (no FPU)) The implementation of a given algorithm is difficult: • Deal with precision problems • Implementation ⇒ accuracy problems • Fixed-point arithmetic • Area/power consumption constraints • multiple wordlength paradigm (ASIC and FPGA) • Time-consuming work From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 5/72
  • 11. Context Linear filters and equivalent realizations Implementation under constraints Embedded systems suffer from various constraints: • Cost (short Time to Market, rapid renewal, etc...) • Power consumption (energy-autonomous systems) • Resources (Limited computing resources (no FPU)) The implementation of a given algorithm is difficult: • Deal with precision problems • Implementation ⇒ accuracy problems • Fixed-point arithmetic • Area/power consumption constraints • multiple wordlength paradigm (ASIC and FPGA) • Time-consuming work We need tools to transform controller into code that deal with precision/performance/computational cost tradeoff From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 5/72
  • 12. Context Linear filters and equivalent realizations Objectives The objectives of the presentation is to give an overview of: • the interest and the difficulties of this problem • the parts already (almost) done • the various parts in-progress • some analogies with the optimal polynomial implementation problem From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 6/72
  • 13. Context Linear filters and equivalent realizations Finite precision degradations The implementation ⇒ degradations (performances, characteristics, etc.) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 7/72
  • 14. Context Linear filters and equivalent realizations Finite precision degradations The implementation ⇒ degradations (performances, characteristics, etc.) Origins of the degradations Two sources of deteriorations are considered: • Roundoff errors into the computations → roundoff noise From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 7/72
  • 15. Context Linear filters and equivalent realizations Finite precision degradations The implementation ⇒ degradations (performances, characteristics, etc.) Origins of the degradations Two sources of deteriorations are considered: • Roundoff errors into the computations → roundoff noise • Quantization of the coefficients → parametric errors From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 7/72
  • 16. Context Linear filters and equivalent realizations Finite precision degradations The implementation ⇒ degradations (performances, characteristics, etc.) Origins of the degradations Two sources of deteriorations are considered: • Roundoff errors into the computations → roundoff noise • Quantization of the coefficients → parametric errors The degradations depends on • the algorithmic relationship used to compute output(s) from input(s) • the computations themselves (wordlengths, roundoff mode, binary point position, additions order, etc.) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 7/72
  • 17. Context Linear filters and equivalent realizations Linear filters LTI: Linear system with known and constant coefficients • FIR (Finite Impulse Response) : n n −i H(z) = bi z , ⇒ y (k) = bi u(k − i) i=0 i=0 • IIR (Infinite Impulse Response) : n −i n n i=0 bi z H(z) = n −i , ⇒ y (k) = bi u(k−i)− ai y (k−i) 1+ i=1 ai z i=0 i=1 Filters and signal processing From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 8/72
  • 18. Context Linear filters and equivalent realizations Equivalent realizations For a given LTI controller, it exist various equivalent realizations • Direct Form I (2n + 1 coefs) u(k) u(k − 1) u(k − n) q −1 q −1 q −1 q −1 b0 b1 b2 bi bn n −i i=0 bi z H(z) = n −i 1+ i=1 ai z + y(k) n n y (k) = bi u(k−i)− ai y (k−i) −an −ai −a2 −a1 i =0 i =1 q −1 q −1 q −1 q −1 y(k − n) y(k − 1) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 9/72
  • 19. Context Linear filters and equivalent realizations Equivalent realizations For a given LTI controller, it exist various equivalent realizations • Direct Form I (2n + 1 coefs) • Direct Form II (transposed or not) (2n + 1 coefs) u(k) e(k) y(k) + b0 + q −1 e(k − 1) + −a1 b1 + q −1 + −a2 b2 + q −1 + −ai bi + q −1 −an bn e(k − n) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 9/72
  • 20. Context Linear filters and equivalent realizations Equivalent realizations For a given LTI controller, it exist various equivalent realizations • Direct Form I (2n + 1 coefs) • Direct Form II (transposed or not) (2n + 1 coefs) • State-space (depend on the basis) ((n + 1)2 coefs) X (k + 1) = AX (k) + Bu(k) y (k) = CX (k) + Du(k) A X (k) → T .X (k) U (k) Y (k) B + q −1 C + X(k + 1) X(k) D From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 9/72
  • 21. Context Linear filters and equivalent realizations Equivalent realizations For a given LTI controller, it exist various equivalent realizations • Direct Form I (2n + 1 coefs) • Direct Form II (transposed or not) (2n + 1 coefs) • State-space (depend on the basis) ((n + 1)2 coefs) • δ-operator δ q−1 ∆ Aδ U (k) Y (k) ∆ + q −1 Bδ + δ −1 Cδ + X(k + 1) X(k) δ −1 Dδ δ[X (k)] = Aδ X (k) + Bδ u(k) y (k) = Cδ X (k) + Dδ u(k) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 9/72
  • 22. Context Linear filters and equivalent realizations Equivalent realizations For a given LTI controller, it exist various equivalent realizations • Direct Form I (2n + 1 coefs) • Direct Form II (transposed or not) (2n + 1 coefs) • State-space (depend on the basis) ((n + 1)2 coefs) • δ-operator δ q−1 ∆ • Cascad and/or parallel decompositions H1 H2 + H1 H2 Hi Hm Hi H Hm H From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 9/72
  • 23. Context Linear filters and equivalent realizations Equivalent realizations For a given LTI controller, it exist various equivalent realizations • Direct Form I (2n + 1 coefs) • Direct Form II (transposed or not) (2n + 1 coefs) • State-space (depend on the basis) ((n + 1)2 coefs) • δ-operator δ q−1 ∆ • Cascad and/or parallel decompositions • ρDirect Form II transposed (5n + 1 ou 4n + 1 coefs) ρDFIIt u(k) βn βn−1 βi β1 β0 + z −1 ∆i ρ−1 ρ−1 ρ−1 ρ−1 + + + + + n i+1 i 1 γi −1 ρi αn αn−1 αi α1 y(k) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 9/72
  • 24. Context Linear filters and equivalent realizations Equivalent realizations For a given LTI controller, it exist various equivalent realizations • Direct Form I (2n + 1 coefs) • Direct Form II (transposed or not) (2n + 1 coefs) • State-space (depend on the basis) ((n + 1)2 coefs) • δ-operator δ q−1 ∆ • Cascad and/or parallel decompositions • ρDirect Form II transposed (5n + 1 ou 4n + 1 coefs) ρDFIIt • lattice, ρ-modale, LGC et LCW-structures, sparse state-space, etc. Each of these realizations uses different coefficients. They are equivalent in infinite precision, but no more in finite precision. The finite precision degradation (parametric errors and roundoff noises) depends on the realization. From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 9/72
  • 25. Context Linear filters and equivalent realizations Comparison with polynomials – 1 It is very interesting to compare filter realizations and polynomial evaluation: z −1 • The shift operator • The multiplication by x From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 10/72
  • 26. Context Linear filters and equivalent realizations Comparison with polynomials – 1 It is very interesting to compare filter realizations and polynomial evaluation: z −1 • The shift operator • The multiplication by x • Direct forms • Horner’s method From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 10/72
  • 27. Context Linear filters and equivalent realizations Comparison with polynomials – 1 It is very interesting to compare filter realizations and polynomial evaluation: z −1 • The shift operator • The multiplication by x • Direct forms • Horner’s method • ρ-operator • Newton’s basis n z − γj Pi = Πik=1 (X − xk ) i (z) = ∆j j=i+1 From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 10/72
  • 28. Context Linear filters and equivalent realizations Comparison with polynomials – 1 It is very interesting to compare filter realizations and polynomial evaluation: z −1 • The shift operator • The multiplication by x • Direct forms • Horner’s method • ρ-operator • Newton’s basis n z − γj Pi = Πik=1 (X − xk ) i (z) = ∆j j=i+1 • ρDFIIt • Horner’s method with Newton’s basis From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 10/72
  • 29. Context Linear filters and equivalent realizations Comparison with polynomials – 2 X (k + 1) = AX (k) + Bu(k) • State-space y (k) = C X (k) + Du(k)   X0 = 1 0 ... 0 x        1 0  • Xi +1 =   .. ..  Xi     . .      1 0 P = an an−1 . . . a0 Xn From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 11/72
  • 30. Context Linear filters and equivalent realizations Comparison with polynomials – 2 X (k + 1) = T −1 AT X (k) + T −1 Bu(k) • State-space y (k) = C T X (k) + Du(k)   X0 = 1 0 ... 0 x        1 0  • Xi +1 = T −1   .. ..  T Xi     . .      1 0 P = an an−1 . . . a0 T Xn • Basis change with any T invertible From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 11/72
  • 31. Context Linear filters and equivalent realizations Comparison with polynomials – 2 X (k + 1) = T −1 AT X (k) + T −1 Bu(k) • State-space y (k) = C T X (k) + Du(k)   X0 = 1 0 ... 0 x        1 0  • Xi +1 = T −1   .. ..  T Xi     . .      1 0 P = an an−1 . . . a0 T Xn • Basis change with any T invertible Could it be interesting to consider other polynomial evaluation schemes (Estrin, Knuth&Eve, etc.) ? From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 11/72
  • 32. Context Linear filters and equivalent realizations HW or SW implementation In addition to the choice of the realization, a lot of other options: • Fixed-point evaluation schemes • order of the operations • fixed-point alignments • quantization modes, etc. From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 12/72
  • 33. Context Linear filters and equivalent realizations HW or SW implementation In addition to the choice of the realization, a lot of other options: • Fixed-point evaluation schemes • order of the operations • fixed-point alignments • quantization modes, etc. • Software implementation (µC, DSP, etc.): • Parallelization • Ressource allocations From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 12/72
  • 34. Context Linear filters and equivalent realizations HW or SW implementation In addition to the choice of the realization, a lot of other options: • Fixed-point evaluation schemes • order of the operations • fixed-point alignments • quantization modes, etc. • Software implementation (µC, DSP, etc.): • Parallelization • Ressource allocations • Hardware implementation (FPGA, ASIC) • Multiple word-length paradigm • Operators optimizations (multiplications by constant, etc.) • Hardware-oriented arithmetic • Operators regroupment From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 12/72
  • 35. Context Linear filters and equivalent realizations HW or SW implementation In addition to the choice of the realization, a lot of other options: • Fixed-point evaluation schemes • order of the operations • fixed-point alignments • quantization modes, etc. • Software implementation (µC, DSP, etc.): • Parallelization • Ressource allocations • Hardware implementation (FPGA, ASIC) • Multiple word-length paradigm • Operators optimizations (multiplications by constant, etc.) • Hardware-oriented arithmetic • Operators regroupment Different levels of optimizations ! From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 12/72
  • 36. Objectives SIF Criteria Evaluation scheme Methodology 2 Our approach From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 13/72
  • 37. Objectives SIF Criteria Evaluation scheme Methodology Outline 3 Objectives 4 SIF 5 Criteria 6 Evaluation scheme 7 Methodology From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 14/72
  • 38. Objectives SIF Criteria Evaluation scheme Methodology Objectives Given a controller and a target, find the optimal implementation. • Model all the equivalent realizations • SIF (Specialized Implicit Form) • Model the fixed-point algorithms • depends on evaluation schemes for sum-of-products • Model the hardware resources • computational units, etc. • Evaluate the degradation • Find one/some optimal realizations Tradeoff between: • Performance / Accuracy (multi-criteria) • Computational cost • Area, power consumption • Computation time, reusability, off-line efforts, etc. From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 15/72
  • 39. Objectives SIF Criteria Evaluation scheme Methodology From controller to code transfer function, state-space, etc. structure SIF set of equivalent realizations T , ∆, γ, ... realization choice Z abstract syntax tree roundoff modes word-length implementation ... arithmetic operators fixed-point algorithm (Z*, ...) code langage generation code From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 16/72
  • 40. Objectives SIF Criteria Evaluation scheme Methodology A Unifying Framework Realizations We have shown that it was possible to describe all these realizations in a descriptor framework called Specialized Implicit Form (SIF). • Macroscopic description of the computations • More general than state-space • Explicit all the operations and their linking       J 0 0 T (k + 1) 0 M N T (k) −K I 0 X (k + 1) = 0 P Q  X (k) −L 0 I Y (k) 0 R S U(k) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 17/72
  • 41. Objectives SIF Criteria Evaluation scheme Methodology A Unifying Framework Realizations We have shown that it was possible to describe all these realizations in a descriptor framework called Specialized Implicit Form (SIF). • Macroscopic description of the computations • More general than state-space • Explicit all the operations and their linking       J 0 0 T (k + 1) 0 M N T (k) −K I 0 X (k + 1) = 0 P Q  X (k) −L 0 I Y (k) 0 R S U(k) → it is able to represent all the graph flows with delay, additions and constant multiplications SIF From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 17/72
  • 42. Objectives SIF Criteria Evaluation scheme Methodology A Unifying Framework Realizations We have shown that it was possible to describe all these realizations in a descriptor framework called Specialized Implicit Form (SIF). • Macroscopic description of the computations • More general than state-space • Explicit all the operations and their linking       J 0 0 T (k + 1) 0 M N T (k) −K I 0 X (k + 1) = 0 P Q  X (k) −L 0 I Y (k) 0 R S U(k) We denote Z the matrix containing all the   −J M N coefficients (and the structure of the  K P Q Z realization) L R S SIF From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 17/72
  • 43. Objectives SIF Criteria Evaluation scheme Methodology Different criteria We have three kinds of criteria to evaluate the finite-precision degradation: • Performance: • transfer function error H − H † • poles or zeros errors |λ| − |λ† | • weighted errors From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 18/72
  • 44. Objectives SIF Criteria Evaluation scheme Methodology Different criteria We have three kinds of criteria to evaluate the finite-precision degradation: • Performance: • transfer function error H − H † • poles or zeros errors |λ| − |λ† | • weighted errors • Accuracy: • Signal to Quantization Noise Ratio From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 18/72
  • 45. Objectives SIF Criteria Evaluation scheme Methodology Different criteria We have three kinds of criteria to evaluate the finite-precision degradation: • Performance: • transfer function error H − H † • poles or zeros errors |λ| − |λ† | • weighted errors • Accuracy: • Signal to Quantization Noise Ratio • Computational cost: • number of coefficients, number of operations • area, power consumption (FPGA, ASIC) • WCET • complexity, etc. From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 18/72
  • 46. Objectives SIF Criteria Evaluation scheme Methodology Different criteria We have three kinds of criteria to evaluate the finite-precision degradation: • Performance: • transfer function error H − H † • poles or zeros errors |λ| − |λ† | • weighted errors • Accuracy: • Signal to Quantization Noise Ratio • Computational cost: • number of coefficients, number of operations • area, power consumption (FPGA, ASIC) • WCET • complexity, etc. → These criteria require to know the exact implementation. From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 18/72
  • 47. Objectives SIF Criteria Evaluation scheme Methodology Different criteria We have three kinds of criteria to evaluate the finite-precision degradation: • Performance: • transfer function error H − H † • poles or zeros errors |λ| − |λ† | • weighted errors • Accuracy: • Signal to Quantization Noise Ratio • Computational cost: • number of coefficients, number of operations • area, power consumption (FPGA, ASIC) • WCET • complexity, etc. → These criteria require to know the exact implementation. So we extend them in a priori criteria (that do not depend on implementation) and a posteriori criteria. From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 18/72
  • 48. Objectives SIF Criteria Evaluation scheme Methodology a priori criteria – 1 a priori measures These criteria come from control: a priori measures • sensitivity with respect to the coefficients Z • transfer function sensitivity : ∂H ∂Z From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 19/72
  • 49. Objectives SIF Criteria Evaluation scheme Methodology a priori criteria – 1 a priori measures These criteria come from control: a priori measures • sensitivity with respect to the coefficients Z • transfer function sensitivity : ∂H ∂Z • poles or zeros sensitivity : ∂|λk | ∂Z From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 19/72
  • 50. Objectives SIF Criteria Evaluation scheme Methodology a priori criteria – 1 a priori measures These criteria come from control: a priori measures • sensitivity with respect to the coefficients Z • transfer function sensitivity : ∂H ∂Z • poles or zeros sensitivity : ∂|λk | ∂Z • Roundoff Noise Gain we suppose here that each quantization error leads to the addition of a white independent uniform noise → Gain from these noises to the output From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 19/72
  • 51. Objectives SIF Criteria Evaluation scheme Methodology a priori criteria – 2 a priori measures The idea is to approximate how much the transfer function is modified by the coefficients’ quantization. Denote 0 if Zi,j could be exactly implemented ∈ {2p |p ∈ Z} (δZ )i,j = 1 else Then, the transfer function error is approached by the L2 -sensitivity measure L2 -sensitivity measure 2 ∂H ML2 = × δZ ∂Z 2 From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 20/72
  • 52. Objectives SIF Criteria Evaluation scheme Methodology a priori criteria – 3 a priori measures In a same way, the pole error is approached by a pole-sensitivity measured. pole-sensitivity n 2 ∂ |λk | Ψ ωk × δZ ∂Z F k=1 where λk are the poles, and ωk some wieghting parameters (usually 1 ωk = 1−|λ | ) k From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 21/72
  • 53. Objectives SIF Criteria Evaluation scheme Methodology a priori criteria – 3 a priori measures In a same way, the pole error is approached by a pole-sensitivity measured. pole-sensitivity n 2 ∂ |λk | Ψ ωk × δZ ∂Z F k=1 where λk are the poles, and ωk some wieghting parameters (usually 1 ωk = 1−|λ | ) k →In closed-loop, Ψ is related to the distance to instability. From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 21/72
  • 54. Objectives SIF Criteria Evaluation scheme Methodology a priori criteria – 3 a priori measures In a same way, the pole error is approached by a pole-sensitivity measured. pole-sensitivity n 2 ∂ |λk | Ψ ωk × δZ ∂Z F k=1 where λk are the poles, and ωk some wieghting parameters (usually 1 ωk = 1−|λ | ) k →In closed-loop, Ψ is related to the distance to instability. These measures have been developed for the SIF: • MIMO case • open and closed-loop cases • analytical expressions 2 And extended with more accurate fixed-point considerations σδH From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 21/72
  • 55. Objectives SIF Criteria Evaluation scheme Methodology a posteriori measure a posteriori measures The main measure based on exact implementation is the Signal to Quantization Noise Ratio SQNR : a posteriori measure It measures the noise on the output produced by the implementation • bit-accurate measure • depends on HW/SW • wordlength • evaluation scheme (order, roundoff mode, etc.) • an optimization on the word-length can be done → For that purpose, we need to generate bit-accurate fixed-point algorithms From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 22/72
  • 56. Objectives SIF Criteria Evaluation scheme Methodology Sum-of-products evaluation scheme – 1 fixed-point evaluation schemes The only operations needed are sum-of-products: n S= ci · xi i=1 where ci are known constants and xi variables (inputs, state or intermediate variables). We have developed technics to transform real sum-of-products into fixed-point algorithms: • we consider the Πn (2i − 1) possible ordered-sum-of-products i=1 (assuming the fixed-point addition is commutative but not associative) • given the various word-lengths (operators, constants), we propagate fixed-point rules among the abstract syntax tree • we consider various scheme (RBM/RAM, no-shifts, etc.) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 23/72
  • 57. Objectives SIF Criteria Evaluation scheme Methodology Sum-of-products evaluation scheme – 2 fixed-point evaluation schemes S = 1.524·X0 +4.89765·X1 −42.3246·X2 +58.35498·X3 +2.857·X4 −49.3246·X5 +24.3468·X6 • 8-bit coefficients, 16-bit additions • Q6.2 for xi and s From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 24/72
  • 58. Objectives SIF Criteria Evaluation scheme Methodology Sujet de la Th`se e Travaux r´alis´s jusqu’ici e e Sum-of-products evaluation scheme – 2 Ordered Sum of Products fixed-point evaluation schemes S = 1.524·X0 +4.89765·Xe−42.3246·X2 +58.35498·X3 +2.857·X4 −49.3246·X5 +24.3468·X6 On fixe ici les repr´sentations virgule fixe : 1 8 bits sign´s pour les coefficients e • 8-bit coefficients, 16-bit additions Q6, 2 pour les Xi et S. • Q6.2 for xi and s S + + + >> 4 + × >> 1 + × + × 117 X3 >> 1 × 97 >> 3 × X6 -99 X5 × 91 X4 × -85 X2 98 X0 78 X1 Roundoff After Multiplication Roundoff After Multiplication →The roundoff noise is then deduced From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 24/72
  • 59. Objectives SIF Criteria Evaluation scheme Methodology Sujet de la Th`se e Travaux r´alis´s jusqu’ici e e Ordered Sum of Products Sum-of-products evaluation scheme – 2 fixed-point evaluation schemes S On fixe 0 +4.89765·X1 −42.3246·X2 +58.35498·X3 +2.857·X4 −49.3246·X5 +24.3468·X6 = 1.524·X ici les repr´sentations virgule fixe : e 8 bits sign´s pour les coefficients e • 8-bit coefficients, 16-bit additions Q6, 2 pour les Xi et S. • Q6.2 for xi and s S + + + >> 4 + × × + >> 1 + × 117 X3 X6 × × 97 × × -99 X5 >> 1 91 X0 X4 >> 3 X1 -85 X2 98 78 Roundoff Before Multiplication Roundoff Before Multiplication →The roundoff noise is then deduced From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 24/72
  • 60. Objectives SIF Criteria Evaluation scheme Methodology State-space example  0.58399 −0.42019 0.64635 X (k + 1) = X (k) +  0.42019 0.1638 −0.23982 Y (k) = 0.64635 0.23982 X (k) + 0.13111U(k)  From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 25/72
  • 61. Objectives SIF Criteria Evaluation scheme Methodology State-space example  0.58399 −0.42019 0.64635 X (k + 1) = X (k) +  0.42019 0.1638 −0.23982 Y (k) = 0.64635 0.23982 X (k) + 0.13111U(k)  16-bit input, output, states 16-bit coefficients 32-bit accumulators max U = 10 From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 25/72
  • 62. Objectives SIF Criteria Evaluation scheme Methodology State-space example  0.58399 −0.42019 0.64635 X (k + 1) = X (k) +  0.42019 0.1638 −0.23982 Y (k) = 0.64635 0.23982 X (k) + 0.13111U(k)  16-bit input, output, states 16-bit coefficients Roundoff After Multiplication 32-bit accumulators Intermediate variables max Acc ← (xn(1) ∗ 19136); U = 10 ⇒ γU = 11  Acc ← Acc + (xn(2) ∗ −27537) >> 1; 26 Acc ← Acc + (u ∗ 21179); xnp(1) ← Acc >> 15; γADD = 27 Acc ← (xn(1) ∗ 27537); 26 Acc ← Acc + (xn(2) ∗ 21470) >> 1;   Acc ← Acc + (u ∗ −31433) >> 1; 15 16 15 xnp(2) ← Acc >> 16; Outputs γZ = 16 17 17 Acc ← (xn(1) ∗ 21179); 15 17 17 Acc ← Acc + (xn(2) ∗ 31433) >> 2; Acc ← Acc + (u ∗ 17184) >> 2; 11 y ← Acc >> 15; γX = Permutations 11 xn ← xnp; From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 25/72
  • 63. Objectives SIF Criteria Evaluation scheme Methodology realization Optimal realization optimization A 1st possible optimization concerns the realization From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 26/72
  • 64. Objectives SIF Criteria Evaluation scheme Methodology realization Optimal realization optimization A 1st possible optimization concerns the realization Let H be a given controller, we denote RH the set of equivalent realizations (with H as transfer function). 2 Let J be an a priori criterion (sensibility, RNG, σ∆H , ...). The optimal realization problem The optimal realization problem consists in finding a realization that minimizes J Ropt = arg min J (R) R∈RH From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 26/72
  • 65. Objectives SIF Criteria Evaluation scheme Methodology realization Optimal realization optimization A 1st possible optimization concerns the realization Let H be a given controller, we denote RH the set of equivalent realizations (with H as transfer function). 2 Let J be an a priori criterion (sensibility, RNG, σ∆H , ...). The optimal realization problem The optimal realization problem consists in finding a realization that minimizes J Ropt = arg min J (R) R∈RH RH is too large, so pratically we only considered structured realizations (state-space, ρ-forms, etc.) From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 26/72
  • 66. Objectives SIF Criteria Evaluation scheme Methodology Example – 1 We consider the following transfer function: 38252z 3 − 101878z 2 + 91135z − 27230 H:z → z 4 − 2.3166z 3 + 2.1662z 2 − 0.96455z + 0.17565 ¯ • Closed-loop L2 -sensitivity ML2 ¯ • Closed-loop pole-sensitivity : Ψ ¯ • Roundoff Noise Gain (RNG) : G From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 27/72
  • 67. Objectives SIF Criteria Evaluation scheme Methodology Example – 2 ¯W ML2 ¯ Ψ ¯ G ¯ TO Nb. op. Z1 1.9046e+7 3.3562e+7 1.186e+6 7 + 8× From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 28/72
  • 68. Objectives SIF Criteria Evaluation scheme Methodology Example – 2 ¯W ML2 ¯ Ψ ¯ G ¯ TO Nb. op. Z1 1.9046e+7 3.3562e+7 1.186e+6 3.6764e+8 7 + 8× Z2 3.6427e+5 6.5007e+5 3.6582e+2 19 + 24× Z1 : canonical form Z2 : balanced state-space From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 28/72
  • 69. Objectives SIF Criteria Evaluation scheme Methodology Example – 2 ¯W ML2 ¯ Ψ ¯ G ¯ TO Nb. op. Z1 1.9046e+7 3.3562e+7 1.186e+6 3.6764e+8 7 + 8× Z2 3.6427e+5 6.5007e+5 3.6582e+2 19 + 24× Z3 1.5267e+3 1.6689e+4 1.7455e+2 19 + 24× ¯ Z3 : ML2 -optimal state-space From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 28/72
  • 70. Objectives SIF Criteria Evaluation scheme Methodology Example – 2 ¯W ML2 ¯ Ψ ¯ G ¯ TO Nb. op. Z1 1.9046e+7 3.3562e+7 1.186e+6 3.6764e+8 7 + 8× Z2 3.6427e+5 6.5007e+5 3.6582e+2 19 + 24× Z3 1.5267e+3 1.6689e+4 1.7455e+2 19 + 24× Z4 1.6272e+3 2.7425e+3 1.1778e+2 19 + 24× ¯ Z4 : Ψ-optimal state-space From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 28/72
  • 71. Objectives SIF Criteria Evaluation scheme Methodology Example – 2 ¯W ML2 ¯ Ψ ¯ G ¯ TO Nb. op. Z1 1.9046e+7 3.3562e+7 1.186e+6 3.6764e+8 7 + 8× Z2 3.6427e+5 6.5007e+5 3.6582e+2 19 + 24× Z3 1.5267e+3 1.6689e+4 1.7455e+2 19 + 24× Z4 1.6272e+3 2.7425e+3 1.1778e+2 19 + 24× Z5 1.9474e+13 1.2294e+13 3.2261e−3 19 + 24× ¯ Z5 : G -optimal state-space From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 28/72
  • 72. Objectives SIF Criteria Evaluation scheme Methodology Example – 2 ¯W ML2 ¯ Ψ ¯ G ¯ TO Nb. op. Z1 1.9046e+7 3.3562e+7 1.186e+6 3.6764e+8 7 + 8× Z2 3.6427e+5 6.5007e+5 3.6582e+2 1.1387e+5 19 + 24× Z3 1.5267e+3 1.6689e+4 1.7455e+2 5.4111e+4 19 + 24× Z4 1.6272e+3 2.7425e+3 1.1778e+2 3.6512e+4 19 + 24× Z5 1.9474e+13 1.2294e+13 3.2261e−3 1.7239e+10 19 + 24× Z6 2.8696e+3 4.5371e+3 7.9809e−3 6.0078e+0 19 + 24× Tradeoff measure: we are looking for a good enough realization: ¯W ¯ ¯ ML2 (Z ) Ψ(Z ) G (Z ) ¯ TO(Z ) + ¯ opt + ¯ opt ¯W ML opt Ψ G 2 ¯ Z6 : TO-optimal state-space From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 28/72
  • 73. Objectives SIF Criteria Evaluation scheme Methodology Example – 3 ¯W ML2 ¯ Ψ ¯ G ¯ TO Nb. op. Z7 1.5342e−2 8.1051e−2 2.8082e−8 4.5466e+0 11 + 12× Z8 1.5341e−2 8.089e−2 4.217e−8 4.8783e+0 11 + 16× Z9 1.1388e−1 2.8203e−2 3.7783e−6 9.8937e+1 11 + 16× Z10 1.5342e−2 8.0015e−2 4.1742e−8 4.8371e+0 11 + 16× Z11 1.6065e−2 3.8802e−2 4.7451e−8 3.5597e+0 11 + 16× Z7 : γ = 1111 : δ-Direct Form II ¯W Z8 : ML2 -optimal ρDFIIt ¯ Z9 : Ψ-optimal ρDFIIt ¯ Z10 : G -optimal ρDFIIt ¯ Z11 : TO-optimal ρDFIIt From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 29/72
  • 74. Objectives SIF Criteria Evaluation scheme Methodology Word-lengths optimization word-length optimization A 2nd possible optimization concerns the hardware implementation On FPGA or ASIC, one can use multiple wordlength paradigm Optimal word-length Let Z be a realization and β = (βZ , βT , βX , βY , βADD ) the word-length We consider J a computational cost (area, power consumption, WCET, etc.). The optimal wordlength problem is: β opt = arg min J (β) with SQNR SQNRmin β∈B From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 30/72
  • 75. Objectives SIF Criteria Evaluation scheme Methodology Global methodology transfer function a) b) structure Structure SIF catalog set of equivalent realizations c) optimal a priori measure realization realization a) Choose a structure d) implementation scheme fixed-point (state-space, ρDFIIt, ...) implementation fixed-point realization wordlength e) optimal implementation f) code language generation code From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 31/72
  • 76. Objectives SIF Criteria Evaluation scheme Methodology Global methodology transfer function a) b) structure Structure SIF catalog set of equivalent realizations c) optimal a priori measure realization realization b) Formalization SIF and d) implementation scheme fixed-point set of equivalent implementation realizations fixed-point realization wordlength e) optimal implementation f) code language generation code From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 31/72
  • 77. Objectives SIF Criteria Evaluation scheme Methodology Global methodology transfer function a) b) structure Structure SIF catalog set of equivalent realizations c) optimal a priori measure realization realization d) c) Optimization of an a implementation fixed-point scheme implementation priori criterion fixed-point realization wordlength e) optimal implementation f) code language generation code From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 31/72
  • 78. Objectives SIF Criteria Evaluation scheme Methodology Global methodology transfer function a) b) structure Structure SIF catalog set of equivalent realizations c) optimal a priori measure realization d) Given some realization word-lengths and an implementation d) fixed-point sum-of-products evaluation scheme implementation scheme, the fixed-point fixed-point realization wordlength representation are defined e) optimal implementation f) code language generation code From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 31/72
  • 79. Objectives SIF Criteria Evaluation scheme Methodology Global methodology transfer function a) b) structure Structure SIF catalog set of equivalent realizations c) optimal a priori measure realization e) Optimization of the realization implementation: d) optimization of a implementation fixed-point scheme implementation computational cost under fixed-point realization wordlength a priori criterion constraint e) optimal implementation f) code language generation code From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 31/72
  • 80. Objectives SIF Criteria Evaluation scheme Methodology Global methodology transfer function a) b) structure Structure SIF catalog set of equivalent realizations c) optimal a priori measure realization realization d) f) Fixed-point code implementation fixed-point scheme implementation generation (C, VHDL, ...) fixed-point realization wordlength e) optimal implementation f) code language generation code From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 31/72
  • 81. Objectives SIF Criteria Evaluation scheme Methodology Example – 1 An other example to be implemented on 8-bit device (with 16-bit accumulator) 0.02088z 2 + 0.04176z + 0.02088 H(z) = z 2 − 1.651z + 0.7342 From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 32/72
  • 82. Objectives SIF Criteria Evaluation scheme Methodology Example – 1 An other example to be implemented on 8-bit device (with 16-bit accumulator) 0.02088z 2 + 0.04176z + 0.02088 H(z) = z 2 − 1.651z + 0.7342 Some possible realizations: R1 : Direct Form I R2 : Direct Form II R3 : Balanced state-space 2 R4 : σ∆H -optimal state-space R5 : optimal state-space with δ-optimal R6 : optimal ρ-Direct Form II From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 32/72
  • 83. Objectives SIF Criteria Evaluation scheme Methodology Example – 2 Roundoff Before Multiplication - 8 bits realisation 2 σ∆H H − H† 2 σξ2 Nb + × R1 114.8242 0.024423 0.0092127 4 + 5× R2 51.0143 0.02797 0.017759 4 + 6× R3 8.7612 0.012219 0.0012579 6 + 9× R4 11.3538 0.0089503 0.0012985 6 + 9× R5 4.6303 0.0040723 0.0037008 8 + 11× R6 7.3958 0.010575 0.00064769 6 + 7× From controller/filter to code: the optimal implementation problem Thibault Hilaire (thibault.hilaire@lip6.fr) 33/72