HDL Coder giving Conformance error due to fi division

2 visualizzazioni (ultimi 30 giorni)
Hi,
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;
np_b=1/full_bits^(NP_b+1);
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 ) );
else
c = a/b;
end
end
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 Commenti
Shruthi Sampathkumar
Shruthi Sampathkumar il 1 Mar 2016
Hi Varuna,
I've the same error. Could you resolve it?
Thanks, Shruthi Sampathkumar.
Walter Roberson
Walter Roberson il 1 Mar 2016
That seems a rather round-about way of writing
np_b = 1/2;
??

Accedi per commentare.

Risposte (1)

Kiran Kintali
Kiran Kintali il 22 Giu 2021
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