HDL code Generation Error. Error in conformation report- "coder", "fi" error

3 visualizzazioni (ultimi 30 giorni)
I was converting MATLAB code to HDL code using HDL coder and I am getting error while HDL code generation, After HDL code generation I got the conformation report where there was one error "ErrorMATLAB HDL Coder failed in the code generation phase. See HDL Coder conformance report.".
List mentioned in that report is.
  1. Toolbox Function Usage: Supported List- Here supported functions were mentioned
  2. Toolbox Function Usage: Unsupported List- Here i am getting this -
coder/matlabcoder - "coder"
3. Function calls requiring attention- Here i am getting these three in matlab generated file after fixpoint conversion
loramod_fixpt - "coder"
"divide"
"fi"
After searching i got some information that these "coder" are not supported by the HDL coder conversion. but these were automatically created while fix point conversion (file is loramod_fixpt, coder.inline function were used in the file and divide and fi also). fi was written at the start of each line. part of the code is this.
function c = fi_div(a,b)
coder.inline( 'always' );
a1 = fi( a, 'RoundMode', 'fix' );
b1 = fi( b, 'RoundMode', 'fix' );
nType = divideType( a1, b1 );
if isfi( a ) && isfi( b ) && isscalar( b )
c1 = divide( nType, a1, b1 );
c = fi( c1, numerictype( c1 ), fimath( a ) );
else
c = fi( a / b, nType );
end
end
function y = fi_div_by_shift(a,shift_len)
coder.inline( 'always' );
if isfi( a )
nt = numerictype( a );
fm = fimath( a );
nt_bs = numerictype( nt.Signed, nt.WordLength + shift_len, nt.FractionLength + shift_len );
y = bitsra( fi( a, nt_bs, fm ), shift_len );
else
y = a / 2 ^ shift_len;
end
end
Please provide me some information, how can i solve these issue. Are these actually some errors or i am mistaking somewhere in my matlab code.

Risposte (1)

Brandon Stevens
Brandon Stevens il 15 Nov 2022
Hi Vivek, the errors you are experiencing can depend on what options you have selected when you are using the HDL Workflow Advisor. One troubleshooting step you can try is to disable the option for 'Aggressive Dataflow Conversion' if you have it selected. In the HDL Code Generation options under 'Optimization' you can find a checkbox for this option.
This 'Aggressive Dataflow Conversion' property transforms the control flow algorithm of the MATLAB code inside the MATLAB function to a dataflow representation.
If you have any follow-up questions or need further assistance, please contact Technical Support.

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by