error in conversion to hdl code"Persistent variable 'y' must be assigned before it is used. The only exception is a check using 'isempty(y)' that can be performed prior to assignment."
조회 수: 5 (최근 30일)
이전 댓글 표시
hello i am trying to convert the following code into hdl but i am receiving the above error please help me with this. my input is [20385 1] and output 200
function result_k1 = tryf_fixpt(sout2)
%#codegen
persistent y
window_width=50;
if isempty(y)
for j=1:200
window_m1=sout2((j:window_width+(j-1)));
window_m11=window_m1(:);
y(j)=skewness(window_m11);
end
end
result_k1=fi(y);
댓글 수: 0
답변 (1개)
Kiran Kintali
2022년 10월 6일
You have too much IO on the DUT.
(20385 + 200)*dataWordLength ==> too many IO pins.
Either you need to stream the inputs and outputs manually as shown in this example
or consider automatic IO optimization described below.
HDL Code Generation from Frame-Based Algorithms
https://www.mathworks.com/help/hdlcoder/ug/frame-to-sample-or-pixel-conversion-to-target-stream-based-hardware.html
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 HDL Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!