Matlab 2014b HDL coder, code generation failed.
古いコメントを表示
I've been quickly testing out MATLAB HDL coder to determine how suitable it is to make some very simple VHDL signal processing components. Unfortunately it seems that the fixed point code it generates as part of the process fails to pass its own error checking when it reaches the HDL conversion stage.
The function below its just a quadrature demodulator with a complex input. This is MATLAB's auto generated fixed point version of my original function (which used doubles).
function out_var = quad_demod_fixpt(input_var)
fm = fimath('RoundingMethod', 'Nearest', 'OverflowAction', 'Wrap', 'ProductMode', 'FullPrecision', 'sumMode', 'FullPrecision');
persistent previous
if isempty(previous)
previous = fi(0 + 0I, 1, 16, 14, fm);
end
multi_result = fi(input_var * conj(previous), 1 ,16 ,14, fm);
out_var = fi(atan2( imag(multi_result), real(multi_result)), 1, 16, 13, fm);
previous(:) = input_var;
end
Error line 11: "HDL code generation for fixed point division is only supported when RoundingMethod is Zero or Nearest." As far as I can tell it is using a RoundingMethod of Nearest. This is just one of several errors we've encountered where on examination of the code there does not seem to be an issue.
Any ideas on what is going wrong (or what I'm doing wrong!) ?
回答 (1 件)
Kiran Kintali
2015 年 5 月 27 日
0 投票
Hello,
Thank you for your question; we would like to investigate further on this issue and provide a workaround.
Can you tell us what release of MATLAB you are using? Can you share your design, testbench and MATLAB to HDL project files so that we can reproduce this issue?
Thank you again for your feedback.
カテゴリ
ヘルプ センター および File Exchange で Get Started with HDL Coder についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!