HDL Coder giving Conformance error due to fi division

2 ビュー (過去 30 日間)
Varuna De Silva
Varuna De Silva 2014 年 6 月 25 日
回答済み: Kiran Kintali 2021 年 6 月 22 日
I am trying to convert a matlab code to HDL using the HDL coder.
In my matlab file the following lines
NP_b = bitand(bitshift(uint16(16384), -6), 3);
full_bits = 2;
are converted to fixed point equivalent of
fm = fimath('RoundingMethod', 'Nearest', 'OverflowAction', 'Wrap', 'ProductMode', 'SpecifyPrecision', 'SumMode', 'FullPrecision', 'ProductWordLength', 32, 'ProductFractionLength', 30);
np_b = fi(fi_div(fi(1, 0, 1, 0, fm), full_bits^(NP_b + 1)), 0, 1, 0, fm);
function c = fi_div(a,b)
coder.inline( 'always' );
if isfi( a ) && isfi( b )
a1 = fi( a, 'RoundMode', 'fix' );
b1 = fi( b, 'RoundMode', 'fix' );
c1 = divide( divideType( a1, b1 ), a1, b1 );
c = fi( c1, numerictype( c1 ), fimath( a ) );
c = a/b;
At the HDL code generation step there is an error that is thrown, which says "Found an unsupported unbounded loop structure. This loop may be user written or automatically generated due to the use of specific vector expressions or functions."
Could any of you kindly help me with this error please?
  2 件のコメント
Walter Roberson
Walter Roberson 2016 年 3 月 1 日
That seems a rather round-about way of writing
np_b = 1/2;


回答 (1 件)

Kiran Kintali
Kiran Kintali 2021 年 6 月 22 日
Without dut.m and testbench.m files and a MATLAB HDL Coder project it woudl be difficult to do further analysis.
running the following code through fixed-point conversion does not product any error


Community Treasure Hunt

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

Start Hunting!

Translated by