Error with HDL Coder ( size array )
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!