Borrar filtros
Borrar filtros

Error with HDL Coder ( size array )

3 visualizaciones (últimos 30 días)
thang
thang el 27 de Nov. de 2014
Comentada: thang el 2 de Dic. de 2014
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.

Respuesta aceptada

Tim McBrayer
Tim McBrayer el 1 de Dic. de 2014
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 comentario
thang
thang el 2 de Dic. de 2014
Thanks for your answer. According to your intimation, i am rewriting my code. Hope it will be done.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Code Generation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by