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일
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
Shruthi Sampathkumar
Shruthi Sampathkumar 2016년 3월 1일
Hi Varuna,
I've the same error. Could you resolve it?
Thanks, Shruthi Sampathkumar.
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