POW2(A) is not supported when A is a FI object.

조회 수: 1 (최근 30일)
Athira Km
Athira Km 2021년 9월 22일
댓글: Athira Km 2021년 10월 5일
Hi Team,
I am getting the below error while doing HDL - coder conversion from MATLAB to c.
seems like both a and b in b = pow2(a,K) are fi.
POW2(A) is not supported when A is a FI object.
Could anyone help in this. Thanks
Athira KM

답변 (2개)

Kiran Kintali
Kiran Kintali 2021년 9월 23일
Please share your design.m and testbench.m and MATLAB to HDL project file.
Thanks
  댓글 수: 1
Athira Km
Athira Km 2021년 9월 23일
Attaching the latest code.
Cordinator.m is the function used and trans.m is that starting file.

댓글을 달려면 로그인하십시오.


Kiran Kintali
Kiran Kintali 2021년 9월 25일
You are using Variable dimensions and the coding style is not suitable for HDL Code generation or FPGA/ASIC synthesis.
Few other observations:
There are some comms internal toolbox functions such as "comm.internal.utilities.de2biBase2RightMSB" used in the floating point code targeted for the fixed-point conversion workflow. These functions do not support fixed-point types as inputs.
% Optimized bi2de taken from comms.internal.utilities
function dec = bi2deOptimized(bin)
dec = comm.internal.utilities.bi2deRightMSB(bin, 2);
end
% Optimized de2bi for scalar inputs taken from comms.internal.utilities
function bin = de2biOptimized(dec, n)
bin = comm.internal.utilities.de2biBase2RightMSB(dec, n);
end
You may needs to cast the inputs to double at the minimum to get through float2fixed conversion but you would be stuck in HDL code generaiton eventually; consider providing HDL friendly replacement functions with sutiable fixed-point equivalents.
You also need to manually make TimeStamp variable to 2 bits wordlength; bitshift does not support shifting 1 bit for some reason. Needs more investigation.
Please update the code to remove variable dimensions and share the attachment.
Thanks
  댓글 수: 1
Athira Km
Athira Km 2021년 10월 5일
Hi Sir,
Thank you for your verification and comments. Here by I am attaching the latest code with code changes.
I have changed all the variable dimensions into fixed and attaching the screenshot for reference
Now the error hitting is in HDL code coversion.
Could you please help here
Attaching the latest source code with this comment.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by