Error with HDL Coder ( size array )

조회 수: 4 (최근 30일)
thang
thang 2014년 11월 27일
댓글: thang 2014년 12월 2일
Hi all, I tried the matlab about HDL Code generation from matlab code. And i met error. here, this is my function code ( about qpsk function ):
When i convert it to vhdl code, this error about size of array was appeared :
So, i am trying repair but it's just not done! please, help me !!! thanks.

채택된 답변

Tim McBrayer
Tim McBrayer 2014년 12월 1일
You have declared y, y_in, and y_qd as being 0x0 arrays. You are then assigning them arrays with different dimensions. This is not supported for HDL Coder. Each variable must have a single fixed size that does not change during the evaluation of the function. These sizes must be statically determinable at compile time. These requirements exist because the MATLAB code is being turned into hardware; you can't dynamically change the size of hardware!
Examining your code, the three arrays in question grow with each loop execution. This also is not supported. You need to figure out what your final size of the arrays is, most likely in relation to length(data) from the look of the code. Declare your three arrays to be this size at the start, and use array indexing to store the data calculated in each loop into the correct index. In addition to being supported for HDL code generation, this style of array creation will execute faster in MATLAB, as the MATLAB execution engine doesn't have to keep reallocating the array each time the loop executes. This is pointed out to you by the Mlint warnings in your source code.
  댓글 수: 1
thang
thang 2014년 12월 2일
Thanks for your answer. According to your intimation, i am rewriting my code. Hope it will be done.

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

추가 답변 (0개)

카테고리

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