Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

hdlcoder.FloatingPointTargetConfig クラス

名前空間: hdlcoder

浮動小数点ライブラリの浮動小数点ターゲット構成

説明

hdlcoder.FloatingPointTargetConfig クラスのオブジェクトを使用して浮動小数点ライブラリの浮動小数点ターゲットを構成します。ネイティブ浮動小数点構成オブジェクト、またはネイティブ浮動小数点と以下のベンダー固有の浮動小数点ライブラリのベンダー固有の浮動小数点の組み合わせのターゲット構成オブジェクトのいずれかを作成できます。

  • Altera® Megafunctions (ALTERA FP Functions)

  • Altera Megafunctions (ALTFP)

  • Xilinx® LogiCORE®

作成

createFloatingPointTargetConfig メソッドを使用して hdlcoder.FloatingPointTargetConfig オブジェクトを作成します。

プロパティ

すべて展開する

ベンダー固有の浮動小数点ライブラリ

ベンダー固有の浮動小数点ライブラリの名前。"None""ALTERAFPFUNCTIONS""ALTFP"、または "XILINXLOGICORE" として指定します。ネイティブ浮動小数点 (NFP) ライブラリと組み合わせて使用するベンダー固有のライブラリを指定します。

ベンダー固有の浮動小数点ライブラリのプロパティを設定するには、hdlcoder.FloatingPointTargetConfig オブジェクトを使用します。

例: "ALTFP"

データ型: char | string

ネイティブ浮動小数点

HDL Coder™ が設計で非正規数を処理するかどうかを指定します。このプロパティは string 配列または文字ベクトルとして指定します。非正規数は、最小の正規数未満の非ゼロ数です。

データ型: char | string

HDL Coder が、設計で使用する浮動演算子の最大レイテンシ設定を使用するのか、最小レイテンシ設定を使用するのかを指定します。このプロパティは string 配列または文字ベクトルとして指定します。

データ型: char | string

HDL Coder で設計の浮動小数点乗算器用の仮数乗算プロセスを実装する方法を指定します。設計に対してターゲット プラットフォームでのデジタル信号プロセッサ (DSP) の使用を制御できます。詳細については、仮数乗算器手法を参照してください。

データ型: char | string

Altera FP Functions

Altera Megafunction IP のパイプライン レジスタをゼロに初期化するかどうか。logical として指定します。HDL シミュレーションでの潜在的な数値の不一致を回避するには、InitializeIPPipelinesToZerotrue に設定します。このプロパティを指定するには、VendorFloatingPointLibrary"ALTERAFPFUNCTIONS" に設定します。

データ型: logical

ALTFP および Xilinx LogiCORE

設計を FPGA 浮動小数点ターゲット ライブラリにマッピングする際に最小レイテンシを使用するのか最大レイテンシを使用するのか。"MIN" または "MAX" として指定します。このプロパティを指定するには、VendorFloatingPointLibrary"ALTFP" または "XILINXLOGICORE" に設定します。

データ型: char | string

設計を FPGA 浮動小数点ターゲット ライブラリにマッピングするときに設計を速度と面積のどちらに対して最適化するのか。"SPEED" または "AREA" として指定します。このプロパティを指定するには、VendorFloatingPointLibrary"ALTFP" または "XILINXLOGICORE" に設定します。

データ型: char | string

メソッド

すべて展開する

すべて折りたたむ

この例では、HDL Coder のネイティブ浮動小数点サポートを使用して浮動小数点ターゲット構成を作成してからコードを生成する方法を示します。

浮動小数点ターゲット構成の作成

ネイティブ浮動小数点構成を作成するには、関数 hdlcoder.createFloatingPointTargetConfig を使用します。

fpconfig = hdlcoder.createFloatingPointTargetConfig("NativeFloatingPoint")
fpconfig = 

  FloatingPointTargetConfig with properties:

                  Library: 'NATIVEFLOATINGPOINT'
          LibrarySettings: [1x1 fpconfig.NFPLatencyDrivenMode]
                 IPConfig: [1x1 hdlcoder.FloatingPointTargetConfig.IPConfig]
            VendorLibrary: []
    VendorLibrarySettings: []
           VendorIPConfig: []

モデル sfir_single を読み込みます。

load_system('sfir_single');

カスタム NFP ライブラリの設定の指定

ネイティブ浮動小数点構成をカスタマイズするには、カスタム ライブラリの設定を指定します。

fpconfig.LibrarySettings.HandleDenormals = 'off';
fpconfig.LibrarySettings.LatencyStrategy = 'MIN';
fpconfig.LibrarySettings.MantissaMultiplyStrategy = 'NoMultiplierFullAddShift';
fpconfig.LibrarySettings
ans = 

  NFPLatencyDrivenMode with properties:

               LatencyStrategy: 'Min'
               HandleDenormals: 'Off'
      MantissaMultiplyStrategy: 'NoMultiplierFullAddShift'
    PartAddShiftMultiplierSize: '18x24'
                       Version: '3.0.0'

ネイティブ浮動小数点演算子のレイテンシの表示

IPConfig プロパティは、ネイティブ浮動小数点演算子の最大および最小レイテンシの値を表示する IPConfig オブジェクトを格納します。

fpconfig.IPConfig
ans = 

        Name                DataType             MaxLatency    MinLatency    CustomLatency
    ____________    _________________________    __________    __________    _____________

    {'ABS'     }    {'DOUBLE'               }         0             0             -1      
    {'ABS'     }    {'SINGLE'               }         0             0             -1      
    {'ACOS'    }    {'SINGLE'               }        23            17             -1      
    {'ACOSH'   }    {'SINGLE'               }        93            93             -1      
    {'ADDSUB'  }    {'DOUBLE'               }        11             6             -1      
    {'ADDSUB'  }    {'HALF'                 }         8             4             -1      
    {'ADDSUB'  }    {'SINGLE'               }        11             6             -1      
    {'ASIN'    }    {'SINGLE'               }        23            17             -1      
    {'ASINH'   }    {'SINGLE'               }        94            94             -1      
    {'ATAN'    }    {'SINGLE'               }        36            36             -1      
    {'ATAN2'   }    {'SINGLE'               }        42            42             -1      
    {'ATANH'   }    {'SINGLE'               }        67            67             -1      
    {'CONVERT' }    {'DOUBLE_TO_NUMERICTYPE'}         6             3             -1      
    {'CONVERT' }    {'DOUBLE_TO_SINGLE'     }         6             3             -1      
    {'CONVERT' }    {'HALF_TO_NUMERICTYPE'  }         3             2             -1      
    {'CONVERT' }    {'HALF_TO_SINGLE'       }         2             1             -1      
    {'CONVERT' }    {'NUMERICTYPE_TO_DOUBLE'}         6             3             -1      
    {'CONVERT' }    {'NUMERICTYPE_TO_HALF'  }         4             2             -1      
    {'CONVERT' }    {'NUMERICTYPE_TO_SINGLE'}         6             6             -1      
    {'CONVERT' }    {'SINGLE_TO_DOUBLE'     }         5             3             -1      
    {'CONVERT' }    {'SINGLE_TO_HALF'       }         3             2             -1      
    {'CONVERT' }    {'SINGLE_TO_NUMERICTYPE'}         6             6             -1      
    {'COS'     }    {'DOUBLE'               }        48            48             -1      
    {'COS'     }    {'HALF'                 }        14             9             -1      
    {'COS'     }    {'SINGLE'               }        27            27             -1      
    {'COSH'    }    {'SINGLE'               }        27            17             -1      
    {'DIV'     }    {'DOUBLE'               }        61            31             -1      
    {'DIV'     }    {'HALF'                 }        19            10             -1      
    {'DIV'     }    {'SINGLE'               }        32            17             -1      
    {'EXP'     }    {'HALF'                 }        16             9             -1      
    {'EXP'     }    {'SINGLE'               }        26            16             -1      
    {'FIX'     }    {'DOUBLE'               }         5             3             -1      
    {'FIX'     }    {'SINGLE'               }         5             3             -1      
    {'GAINPOW2'}    {'DOUBLE'               }         2             1             -1      
    {'GAINPOW2'}    {'HALF'                 }         2             1             -1      
    {'GAINPOW2'}    {'SINGLE'               }         2             1             -1      
    {'HDLRECIP'}    {'SINGLE'               }        21            14             -1      
    {'HYPOT'   }    {'SINGLE'               }        33            17             -1      
    {'LOG'     }    {'DOUBLE'               }        44            34             -1      
    {'LOG'     }    {'HALF'                 }        17             9             -1      
    {'LOG'     }    {'SINGLE'               }        27            20             -1      
    {'LOG10'   }    {'HALF'                 }        18            10             -1      
    {'LOG10'   }    {'SINGLE'               }        27            17             -1      
    {'LOG2'    }    {'SINGLE'               }        26            16             -1      
    {'MINMAX'  }    {'SINGLE'               }         3             1             -1      
    {'MOD'     }    {'SINGLE'               }        26            16             -1      
    {'MUL'     }    {'DOUBLE'               }         9             6             -1      
    {'MUL'     }    {'HALF'                 }         6             4             -1      
    {'MUL'     }    {'SINGLE'               }         8             6             -1      
    {'MULTADD' }    {'SINGLE'               }        14             8             -1      
    {'POW'     }    {'SINGLE'               }        54            33             -1      
    {'POW10'   }    {'SINGLE'               }        26            16             -1      
    {'POW2'    }    {'SINGLE'               }        23            14             -1      
    {'RECIP'   }    {'DOUBLE'               }        60            30             -1      
    {'RECIP'   }    {'HALF'                 }        19            10             -1      
    {'RECIP'   }    {'SINGLE'               }        31            16             -1      
    {'RELOP'   }    {'DOUBLE'               }         3             1             -1      
    {'RELOP'   }    {'HALF'                 }         2             1             -1      
    {'RELOP'   }    {'SINGLE'               }         3             1             -1      
    {'REM'     }    {'SINGLE'               }        24            15             -1      
    {'ROUNDING'}    {'DOUBLE'               }         5             3             -1      
    {'ROUNDING'}    {'SINGLE'               }         5             3             -1      
    {'RSQRT'   }    {'DOUBLE'               }        59            33             -1      
    {'RSQRT'   }    {'SINGLE'               }        30            16             -1      
    {'SIGNUM'  }    {'DOUBLE'               }         0             0             -1      
    {'SIGNUM'  }    {'SINGLE'               }         0             0             -1      
    {'SIN'     }    {'DOUBLE'               }        34            34             -1      
    {'SIN'     }    {'HALF'                 }        14             8             -1      
    {'SIN'     }    {'SINGLE'               }        27            27             -1      
    {'SINCOS'  }    {'SINGLE'               }        27            27             -1      
    {'SINH'    }    {'SINGLE'               }        30            18             -1      
    {'SQRT'    }    {'DOUBLE'               }        58            36             -1      
    {'SQRT'    }    {'HALF'                 }        12             6             -1      
    {'SQRT'    }    {'SINGLE'               }        28            16             -1      
    {'TAN'     }    {'SINGLE'               }        33            33             -1      
    {'TANH'    }    {'SINGLE'               }        43            25             -1      
    {'UMINUS'  }    {'DOUBLE'               }         0             0             -1      
    {'UMINUS'  }    {'HALF'                 }         0             0             -1      
    {'UMINUS'  }    {'SINGLE'               }         0             0             -1      

コードの生成

sfir_single モデルでは、浮動小数点ターゲット構成オブジェクト fpconfig を使用するように FloatingPointTargetConfiguration プロパティを設定します。

hdlset_param('sfir_single',FloatingPointTargetConfiguration=fpconfig);

makehdl コマンドを使用して HDL コードを生成します。生成されたコード ファイルは、TargetDirectory 設定で指定されたディレクトリ パスに保存されます。この例では、生成された VHDL コードは C:/NativeFloatingPoint/hdlsrc フォルダーに保存されます。

makehdl('sfir_single/symmetric_fir', ...
                    TargetDirectory='C:/NativeFloatingPoint/hdlsrc')
### Generating HDL for 'sfir_single/symmetric_fir'.
### Using the config set for model <a href="matlab:configset.showParameterGroup('sfir_single', { 'HDL Code Generation' } )">sfir_single</a> for HDL code generation parameters.
### Running HDL checks on the model 'sfir_single'.
### Begin compilation of the model 'sfir_single'...
### Working on the model 'sfir_single'...
### The code generation and optimization options you have chosen have introduced additional pipeline delays.
### The delay balancing feature has automatically inserted matching delays for compensation.
### The DUT requires an initial pipeline setup latency. Each output port experiences these additional delays.
### Output port 1: 25 cycles.
### Output port 2: 25 cycles.
### Working on... <a href="matlab:configset.internal.open('sfir_single', 'GenerateModel')">GenerateModel</a>
### Begin model generation 'gm_sfir_single' ....
### Rendering DUT with optimization related changes (IO, Area, Pipelining)...
### Model generation complete.
### Begin VHDL Code Generation for 'sfir_single'.
### Working on sfir_single/symmetric_fir/nfp_add_single as C:/NativeFloatingPoint/hdlsrc/sfir_single/nfp_add_single.vhd.
### Working on sfir_single/symmetric_fir/nfp_mul_single as C:/NativeFloatingPoint/hdlsrc/sfir_single/nfp_mul_single.vhd.
### Working on sfir_single/symmetric_fir as C:/NativeFloatingPoint/hdlsrc/sfir_single/symmetric_fir.vhd.
### Generating package file C:/NativeFloatingPoint/hdlsrc/sfir_single/symmetric_fir_pkg.vhd.
### Code Generation for 'sfir_single' completed.
### Creating HDL Code Generation Check Report file:///tmp/Bdoc23b_2395265_1831170/tpd472ae00/hdlcoder-ex93289075/C:/NativeFloatingPoint/hdlsrc/sfir_single/symmetric_fir_report.html
### HDL check for 'sfir_single' complete with 0 errors, 0 warnings, and 0 messages.
### HDL code generation complete.

この例では、HDL Coder™ でネイティブ浮動小数点 (NFP) ライブラリとベンダー固有の浮動小数点ライブラリを使用して混合モードの浮動小数点ターゲット構成を作成し、コードを生成する方法を示します。この例のベンダー ライブラリは Altera® Megafunctions (ALTERAFPFUNCTIONS) ライブラリです。

浮動小数点ターゲット構成の作成

浮動小数点構成を作成するには、関数 hdlsetuptoolpath を使用して合成ツールのパスを設定します。この例では、合成ツールとして Altera Quartus II を使用します。環境内でツールを設定するには、コンピューター上の固有の合成ツールのパスを指定して hdlsetuptoolpath コマンドを実行します。たとえば、関数 quartuspath は Altera Quartus II 合成ツールのパスを返します。

hdlsetuptoolpath('ToolName', 'Altera Quartus II','ToolPath', quartuspath);
Prepending following Altera Quartus II path(s) to the system path:
B:\share\apps\HDLTools\Altera\21.1-mw-0\Windows\quartus\bin64

モデル sfir_single を読み込みます。

load_system('sfir_single')

関数 hdlcoder.createFloatingPointTargetConfig を使用して混合モードの浮動小数点構成 fpconfig を作成します。構成 fpconfig には NFP ライブラリと Altera Megafunctions ライブラリの構成が含まれます。NFP とベンダー固有の IP を一緒に使用することで、強化された DSP 浮動小数点の加算器や乗算器のプリミティブ型など、FPGA のリソースがより効率的に使用されるようになり、より大きな設計を FPGA ファブリックに当てはめることができます。

fpconfig = hdlcoder.createFloatingPointTargetConfig("NativeFloatingPoint",VendorFloatingPointLibrary="ALTERAFPFUNCTIONS")
fpconfig = 

  FloatingPointTargetConfig with properties:

                  Library: 'NATIVEFLOATINGPOINT'
          LibrarySettings: [1×1 fpconfig.NFPLatencyDrivenMode]
                 IPConfig: [1×1 hdlcoder.FloatingPointTargetConfig.IPConfig]
            VendorLibrary: 'ALTERAFPFUNCTIONS'
    VendorLibrarySettings: [1×1 fpconfig.FrequencyDrivenMode]
           VendorIPConfig: [1×1 hdlcoder.FloatingPointTargetConfig.IPConfig]

カスタム NFP ライブラリの設定の指定

ネイティブ浮動小数点構成をカスタマイズするには、カスタム ライブラリの設定を指定します。

fpconfig.LibrarySettings.HandleDenormals = 'off';
fpconfig.LibrarySettings.LatencyStrategy = 'MIN';
fpconfig.LibrarySettings.MantissaMultiplyStrategy = 'NoMultiplierFullAddShift';
fpconfig.LibrarySettings
ans = 

  NFPLatencyDrivenMode with properties:

               LatencyStrategy: 'Min'
               HandleDenormals: 'Off'
      MantissaMultiplyStrategy: 'NoMultiplierFullAddShift'
    PartAddShiftMultiplierSize: '18x24'
                       Version: '3.0.0'

カスタムのベンダー固有ライブラリの設定の指定

ベンダー固有の浮動小数点構成をカスタマイズするには、カスタムのベンダー ライブラリの設定を指定します。

fpconfig.VendorLibrarySettings.InitializeIPPipelinesToZero = true;
fpconfig.VendorLibrarySettings
ans = 

  FrequencyDrivenMode with properties:

    InitializeIPPipelinesToZero: 1

浮動小数点 IP のレイテンシの表示

IPConfig プロパティは、ネイティブ浮動小数点演算子の最大および最小レイテンシの値を表示する IPConfig オブジェクトを格納します。

fpconfig.IPConfig
ans = 

        Name                DataType             MaxLatency    MinLatency    CustomLatency
    ____________    _________________________    __________    __________    _____________

    {'ABS'     }    {'DOUBLE'               }         0             0             -1      
    {'ABS'     }    {'SINGLE'               }         0             0             -1      
    {'ACOS'    }    {'SINGLE'               }        23            17             -1      
    {'ACOSH'   }    {'SINGLE'               }        93            93             -1      
    {'ADDSUB'  }    {'DOUBLE'               }        11             6             -1      
    {'ADDSUB'  }    {'HALF'                 }         8             4             -1      
    {'ADDSUB'  }    {'SINGLE'               }        11             6             -1      
    {'ASIN'    }    {'SINGLE'               }        23            17             -1      
    {'ASINH'   }    {'SINGLE'               }        94            94             -1      
    {'ATAN'    }    {'SINGLE'               }        36            36             -1      
    {'ATAN2'   }    {'SINGLE'               }        42            42             -1      
    {'ATANH'   }    {'SINGLE'               }        67            67             -1      
    {'CONVERT' }    {'DOUBLE_TO_NUMERICTYPE'}         6             3             -1      
    {'CONVERT' }    {'DOUBLE_TO_SINGLE'     }         6             3             -1      
    {'CONVERT' }    {'HALF_TO_NUMERICTYPE'  }         3             2             -1      
    {'CONVERT' }    {'HALF_TO_SINGLE'       }         2             1             -1      
    {'CONVERT' }    {'NUMERICTYPE_TO_DOUBLE'}         6             3             -1      
    {'CONVERT' }    {'NUMERICTYPE_TO_HALF'  }         4             2             -1      
    {'CONVERT' }    {'NUMERICTYPE_TO_SINGLE'}         6             6             -1      
    {'CONVERT' }    {'SINGLE_TO_DOUBLE'     }         5             3             -1      
    {'CONVERT' }    {'SINGLE_TO_HALF'       }         3             2             -1      
    {'CONVERT' }    {'SINGLE_TO_NUMERICTYPE'}         6             6             -1      
    {'COS'     }    {'DOUBLE'               }        48            48             -1      
    {'COS'     }    {'HALF'                 }        14             9             -1      
    {'COS'     }    {'SINGLE'               }        27            27             -1      
    {'COSH'    }    {'SINGLE'               }        27            17             -1      
    {'DIV'     }    {'DOUBLE'               }        61            31             -1      
    {'DIV'     }    {'HALF'                 }        19            10             -1      
    {'DIV'     }    {'SINGLE'               }        32            17             -1      
    {'EXP'     }    {'HALF'                 }        16             9             -1      
    {'EXP'     }    {'SINGLE'               }        26            16             -1      
    {'FIX'     }    {'DOUBLE'               }         5             3             -1      
    {'FIX'     }    {'SINGLE'               }         5             3             -1      
    {'GAINPOW2'}    {'DOUBLE'               }         2             1             -1      
    {'GAINPOW2'}    {'HALF'                 }         2             1             -1      
    {'GAINPOW2'}    {'SINGLE'               }         2             1             -1      
    {'HDLRECIP'}    {'SINGLE'               }        21            14             -1      
    {'HYPOT'   }    {'SINGLE'               }        33            17             -1      
    {'LOG'     }    {'DOUBLE'               }        44            34             -1      
    {'LOG'     }    {'HALF'                 }        17             9             -1      
    {'LOG'     }    {'SINGLE'               }        27            20             -1      
    {'LOG10'   }    {'HALF'                 }        18            10             -1      
    {'LOG10'   }    {'SINGLE'               }        27            17             -1      
    {'LOG2'    }    {'SINGLE'               }        26            16             -1      
    {'MINMAX'  }    {'SINGLE'               }         3             1             -1      
    {'MOD'     }    {'SINGLE'               }        26            16             -1      
    {'MUL'     }    {'DOUBLE'               }         9             6             -1      
    {'MUL'     }    {'HALF'                 }         6             4             -1      
    {'MUL'     }    {'SINGLE'               }         8             6             -1      
    {'MULTADD' }    {'SINGLE'               }        14             8             -1      
    {'POW'     }    {'SINGLE'               }        54            33             -1      
    {'POW10'   }    {'SINGLE'               }        26            16             -1      
    {'POW2'    }    {'SINGLE'               }        23            14             -1      
    {'RECIP'   }    {'DOUBLE'               }        60            30             -1      
    {'RECIP'   }    {'HALF'                 }        19            10             -1      
    {'RECIP'   }    {'SINGLE'               }        31            16             -1      
    {'RELOP'   }    {'DOUBLE'               }         3             1             -1      
    {'RELOP'   }    {'HALF'                 }         2             1             -1      
    {'RELOP'   }    {'SINGLE'               }         3             1             -1      
    {'REM'     }    {'SINGLE'               }        24            15             -1      
    {'ROUNDING'}    {'DOUBLE'               }         5             3             -1      
    {'ROUNDING'}    {'SINGLE'               }         5             3             -1      
    {'RSQRT'   }    {'DOUBLE'               }        59            33             -1      
    {'RSQRT'   }    {'SINGLE'               }        30            16             -1      
    {'SIGNUM'  }    {'DOUBLE'               }         0             0             -1      
    {'SIGNUM'  }    {'SINGLE'               }         0             0             -1      
    {'SIN'     }    {'DOUBLE'               }        34            34             -1      
    {'SIN'     }    {'HALF'                 }        14             8             -1      
    {'SIN'     }    {'SINGLE'               }        27            27             -1      
    {'SINCOS'  }    {'SINGLE'               }        27            27             -1      
    {'SINH'    }    {'SINGLE'               }        30            18             -1      
    {'SQRT'    }    {'DOUBLE'               }        58            36             -1      
    {'SQRT'    }    {'HALF'                 }        12             6             -1      
    {'SQRT'    }    {'SINGLE'               }        28            16             -1      
    {'TAN'     }    {'SINGLE'               }        33            33             -1      
    {'TANH'    }    {'SINGLE'               }        43            25             -1      
    {'UMINUS'  }    {'DOUBLE'               }         0             0             -1      
    {'UMINUS'  }    {'HALF'                 }         0             0             -1      
    {'UMINUS'  }    {'SINGLE'               }         0             0             -1      

VendorIPConfig プロパティは、ベンダー固有の浮動小数点演算子の最大および最小レイテンシの値を表示する IPConfig オブジェクトを格納します。

fpconfig.VendorIPConfig
ans = 

       Name                DataType             Latency    ExtraArgs 
    ___________    _________________________    _______    __________

    {'ABS'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'ABS'    }    {'SINGLE'               }      -1       {0×0 char}
    {'ADDSUB' }    {'DOUBLE'               }      -1       {0×0 char}
    {'ADDSUB' }    {'SINGLE'               }      -1       {0×0 char}
    {'CONVERT'}    {'DOUBLE_TO_NUMERICTYPE'}      -1       {0×0 char}
    {'CONVERT'}    {'NUMERICTYPE_TO_DOUBLE'}      -1       {0×0 char}
    {'CONVERT'}    {'NUMERICTYPE_TO_SINGLE'}      -1       {0×0 char}
    {'CONVERT'}    {'SINGLE_TO_NUMERICTYPE'}      -1       {0×0 char}
    {'COS'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'COS'    }    {'SINGLE'               }      -1       {0×0 char}
    {'DIV'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'DIV'    }    {'SINGLE'               }      -1       {0×0 char}
    {'EXP'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'EXP'    }    {'SINGLE'               }      -1       {0×0 char}
    {'LOG'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'LOG'    }    {'SINGLE'               }      -1       {0×0 char}
    {'MUL'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'MUL'    }    {'SINGLE'               }      -1       {0×0 char}
    {'MULTADD'}    {'SINGLE'               }      -1       {0×0 char}
    {'RECIP'  }    {'DOUBLE'               }      -1       {0×0 char}
    {'RECIP'  }    {'SINGLE'               }      -1       {0×0 char}
    {'RELOP'  }    {'DOUBLE'               }      -1       {0×0 char}
    {'RELOP'  }    {'SINGLE'               }      -1       {0×0 char}
    {'RSQRT'  }    {'DOUBLE'               }      -1       {0×0 char}
    {'RSQRT'  }    {'SINGLE'               }      -1       {0×0 char}
    {'SIN'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'SIN'    }    {'SINGLE'               }      -1       {0×0 char}
    {'SQRT'   }    {'DOUBLE'               }      -1       {0×0 char}
    {'SQRT'   }    {'SINGLE'               }      -1       {0×0 char}

ADDSUB ベンダー IP のレイテンシのカスタマイズ

IPConfig オブジェクトのいずれかの customize メソッドを使用して、浮動小数点 IP のレイテンシをカスタマイズし、任意の追加の引数を指定できます。この例では、VendorIPConfig.customize メソッドを使用してベンダー IP のレイテンシをカスタマイズします。

fpconfig.VendorIPConfig.customize('ADDSUB','Single','Latency',6);
fpconfig.VendorIPConfig
ans = 

       Name                DataType             Latency    ExtraArgs 
    ___________    _________________________    _______    __________

    {'ABS'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'ABS'    }    {'SINGLE'               }      -1       {0×0 char}
    {'ADDSUB' }    {'DOUBLE'               }      -1       {0×0 char}
    {'ADDSUB' }    {'SINGLE'               }       6       {0×0 char}
    {'CONVERT'}    {'DOUBLE_TO_NUMERICTYPE'}      -1       {0×0 char}
    {'CONVERT'}    {'NUMERICTYPE_TO_DOUBLE'}      -1       {0×0 char}
    {'CONVERT'}    {'NUMERICTYPE_TO_SINGLE'}      -1       {0×0 char}
    {'CONVERT'}    {'SINGLE_TO_NUMERICTYPE'}      -1       {0×0 char}
    {'COS'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'COS'    }    {'SINGLE'               }      -1       {0×0 char}
    {'DIV'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'DIV'    }    {'SINGLE'               }      -1       {0×0 char}
    {'EXP'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'EXP'    }    {'SINGLE'               }      -1       {0×0 char}
    {'LOG'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'LOG'    }    {'SINGLE'               }      -1       {0×0 char}
    {'MUL'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'MUL'    }    {'SINGLE'               }      -1       {0×0 char}
    {'MULTADD'}    {'SINGLE'               }      -1       {0×0 char}
    {'RECIP'  }    {'DOUBLE'               }      -1       {0×0 char}
    {'RECIP'  }    {'SINGLE'               }      -1       {0×0 char}
    {'RELOP'  }    {'DOUBLE'               }      -1       {0×0 char}
    {'RELOP'  }    {'SINGLE'               }      -1       {0×0 char}
    {'RSQRT'  }    {'DOUBLE'               }      -1       {0×0 char}
    {'RSQRT'  }    {'SINGLE'               }      -1       {0×0 char}
    {'SIN'    }    {'DOUBLE'               }      -1       {0×0 char}
    {'SIN'    }    {'SINGLE'               }      -1       {0×0 char}
    {'SQRT'   }    {'DOUBLE'               }      -1       {0×0 char}
    {'SQRT'   }    {'SINGLE'               }      -1       {0×0 char}

コードの生成

sfir_single モデルでは、浮動小数点ターゲット構成オブジェクト fpconfig を使用するように FloatingPointTargetConfiguration プロパティを設定します。

hdlset_param('sfir_single',FloatingPointTargetConfiguration=fpconfig);

指定したシミュレーション ツールで生成されたコードをコンパイルしてシミュレートするためにシミュレーション ライブラリのパスを設定します。

hdlset_param('sfir_single','SimulationLibPath',alterasimulationlibpath);

SynthesisToolChipFamily プロパティを Arria10 に設定し、makehdl コマンドを使用して HDL コードを生成します。生成されたコード ファイルは、TargetDirectory プロパティで指定されたディレクトリ パスに保存されます。この例では、生成された VHDL コードは C:/MixedModeFloatingPoint/hdlsrc フォルダーに保存されます。

makehdl('sfir_single/symmetric_fir',SynthesisToolChipFamily='Arria10',...
   TargetDirectory='C:/MixedModeFloatingPoint/hdlsrc')
### Generating HDL for 'sfir_single/symmetric_fir'.
### Using the config set for model <a href="matlab:configset.showParameterGroup('sfir_single', { 'HDL Code Generation' } )">sfir_single</a> for HDL code generation parameters.
### Running HDL checks on the model 'sfir_single'.
### Begin compilation of the model 'sfir_single'...
### Working on the model 'sfir_single'...
### Using B:\share\apps\HDLTools\Altera\21.1-mw-0\Windows\quartus\bin64\..\sopc_builder\bin\ip-generate for the selected floating point IP library.
### Generating Altera(R) megafunction: alterafpf_mul_single for target frequency of 200 MHz.
### Found an existing generated file in a previous session: (C:\MixedModeFloatingPoint\hdlsrc\sfir_single\Altera\Arria10\unspecified\F200\synth\alterafpf_mul_single.vhd). Reusing the generated file.
### alterafpf_mul_single takes 3 cycles.
### Done.
### The code generation and optimization options you have chosen have introduced additional pipeline delays.
### The delay balancing feature has automatically inserted matching delays for compensation.
### The DUT requires an initial pipeline setup latency. Each output port experiences these additional delays.
### Output port 1: 21 cycles.
### Output port 2: 21 cycles.
### Working on... <a href="matlab:configset.internal.open('sfir_single', 'GenerateModel')">GenerateModel</a>
### Begin model generation 'gm_sfir_single' ....
### Rendering DUT with optimization related changes (IO, Area, Pipelining)...
### Model generation complete.
### Generating Altera(R) megafunction: alterafpf_add_single for latency of 6.
### Found an existing generated file in a previous session: (C:\MixedModeFloatingPoint\hdlsrc\sfir_single\Altera\Arria10\unspecified\L6\synth\alterafpf_add_single.vhd). Reusing the generated file.
### Done.
### Begin VHDL Code Generation for 'sfir_single'.
### Working on sfir_single/symmetric_fir as C:\MixedModeFloatingPoint\hdlsrc\sfir_single\symmetric_fir.vhd.
### Generating package file C:\MixedModeFloatingPoint\hdlsrc\sfir_single\symmetric_fir_pkg.vhd.
### Code Generation for 'sfir_single' completed.
### Creating HDL Code Generation Check Report file:///C:/MixedModeFloatingPoint/hdlsrc/sfir_single/symmetric_fir_report.html
### HDL check for 'sfir_single' complete with 0 errors, 0 warnings, and 0 messages.
### HDL code generation complete.

ADDSUB IP のレイテンシは 6 であり、最大レイテンシ値 14 ではありません。

バージョン履歴

R2016b で導入

すべて展開する