フィルターのクリア

Generating math expression LUT using variable from workspace

5 ビュー (過去 30 日間)
Eirik Nordeng
Eirik Nordeng 2023 年 12 月 20 日
回答済み: Andy Bartlett 2023 年 12 月 20 日
I am following this guide for creating a LUT for a custom math function: Replace a Custom Function with a Lookup Table - MATLAB & Simulink - MathWorks Nordic
I must ensure consistency between the model and the HDL code and therefore wish to pass a confgiuration parameter from the workspace to the math function, but the approach for doing this is unclear to me.
I see that the -globals flag is not supported by "fiaccel -float2fixed". I tried using the -args option, but this does not seem like the correct approach.
How can I pass a constant configuration parameter to the function used for generating the LUT?

採用された回答

Andy Bartlett
Andy Bartlett 2023 年 12 月 20 日
I assume you are modeling your design in Simulink.
I suggest you look at using the Function Approximation tooling to create an approximation using a Simulink Lookup Table block.
This tooling provides several optimizations such as data types, size of lookup table, etc. Please check out the optimization options, especially this one.
HDLOptimized — Whether to generate HDL-optimized approximate
If you need a MATLAB based approximation instead of one using the Simulink Lookup Table, change the default for this option.
ApproximateSolutionType — How to output optimized lookup table
'Simulink' (default) | 'MATLAB'

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by