メインコンテンツ

許容誤差の値

指定した浮動小数点許容誤差チェックの設定に基づいて許容誤差の値を入力する

R2024b 以降

モデル コンフィギュレーション ペイン: テスト ベンチ

説明

指定した浮動小数点許容誤差チェックの設定に基づいて許容誤差の値を入力します。

依存関係

このパラメーターは、[テスト ベンチを生成] によって有効になります。このパラメーターを有効にするには、HDL ワークフロー アドバイザーの [検証][HLS テスト ベンチによる検証][出力設定] ペインで [テスト ベンチを生成] をクリックします。

設定

1e-07 (既定の設定) | 0

この浮動小数点許容誤差チェックの設定を使用する場合は、許容誤差の値を double として指定します。

すべて展開する

たとえば、次の MATLAB® コードでは、高位合成の HDL 構成オブジェクトを構成し、生成されたコードを検証するためのテスト ベンチとして mlhdlc_sfir_tb を使用しています。また、FPToleranceStrategyULP Error として指定し、FPToleranceValue1 に設定しています。

% Create HDLConfig object and set the workflow as "High Level Synthesis"
cfg = coder.config("hdl");
cfg.Workflow = "High Level Synthesis";
 
% Test bench options
cfg.TestBenchName = "mlhdlc_sfir_tb";
cfg.GenerateHDLTestBench = true;
 
% Specify the FPToleranceStrategy as "ULP Error"
cfg.FPToleranceStrategy = "ULP Error";
 
% Specify the FPToleranceValue as an integer for "ULP Error" strategy
cfg.FPToleranceValue = 1;
 
codegen -config cfg mlhdlc_sfir -report
### Begin MATLAB to HLS Code Generation...
### Working on DUT: mlhdlc_sfir.
### Using TestBench: mlhdlc_sfir_tb.
### Begin HLS Code Generation
### Generating Resource Utilization Report resource_report.html.
### Working on mlhdlc_sfirClass.hpp as mlhdlc_sfirClass.hpp.
### Working on mlhdlc_sfirModule.hpp as mlhdlc_sfirModule.hpp.
### To rerun codegen evaluate the following commands...

---------------------
cgi    = load('/tmp/Bdoc25b_2988451_717888/tpbd4a220f/hdlcoder-ex34814788/codegen/mlhdlc_sfir/hdlsrc/codegen_info.mat');
inVals = cgi.CodeGenInfo.inVals;
cfg    = cgi.CodeGenInfo.codegenSettings;
codegen -config cfg -args inVals -report
---------------------


### Begin TestBench generation.
Code generation successful.

Figure mlhdlc_sfir_tb_plot contains 3 axes objects. Axes object 1 with title Input Signal (with noise), xlabel Time (ms), ylabel Amplitude contains an object of type line. Axes object 2 with title Output Signal (filtered), xlabel Time (ms), ylabel Amplitude contains an object of type line. Axes object 3 with title Input and Output Signals (Frequency domain), xlabel Frequency (Hz), ylabel Amplitude (dB) contains 2 objects of type line. These objects represent FilterIn, FilterOut.

### Collecting data...
### Begin HLS test bench file generation with logged samples
### Generating test bench data file: x_in.dat.
### Generating test bench data file: y_out_expected.dat.
### Generating test bench data file: delayed_xout_expected.dat.
### Generating test bench file: mlhdlc_sfirClass_tb.hpp
### Generating test bench module file: mlhdlc_sfirModule_tb.hpp
### Generating HLS Conformance Report mlhdlc_sfir_hdl_conformance_report.html.
### HLS Conformance check complete with 0 errors, 0 warnings, and 0 messages.
### Code generation successful: View report

推奨設定

推奨なし。

プログラムでの使用

パラメーター: FPToleranceValue
型: double | 整数
既定の設定: 1e-07

バージョン履歴

R2024b で導入