MATLAB Answers

HDL Coder Error: variable-size matrix type is not supported for HDL code generation

17 ビュー (過去 30 日間)
suneel kumar Gaddam
suneel kumar Gaddam 2016 年 11 月 11 日
コメント済み: suneel kumar Gaddam 2016 年 11 月 23 日
I am using HDL coder for converting Conventional encoding code to HDL Code. I started with fixed point conversion and serialized the input data, but during code generataion it is throwing a lot of errors as listed below
HDL Code Generation Check Report for 'getcodeparameters_fixpt'
Generated on 2016-11-11 10:30:16
HDL Conformance check complete with 64 errors, 0 warnings, and 1 messages.
Function Location Level Description
getcodeparameters_fixpt:150 Error 'x' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'g' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:109 Error '' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:109 Error '' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:0 Error 'y' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'value' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'y1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'value' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:0 Error 'c' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:0 Error 'a0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'c' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'a0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'out' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:0 Error 'idx' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'out' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'idx' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'var1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'x' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:143 Error 'var1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:148 Error 'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:148 Error 'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:148 Error 'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:148 Error 'varargin_1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:148 Error 'var1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:148 Error 'g' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:148 Error 'var1' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:0 Error 'c' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'a0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'b0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'c' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'a0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'b0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'c' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'a' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'b' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'c' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'a' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'b' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:0 Error 'X' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'X' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'X' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'X' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'X' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:150 Error 'X' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:126 Error 'x' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:126 Error 'x' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:126 Error 'a0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:126 Error 'a0' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:126 Error 'a' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:126 Error 'a' : Error: variable-size matrix type is not supported for HDL code generation.
getcodeparameters_fixpt:0 Error MATLAB HDL Coder failed in the code generation phase. See HDL Coder conformance report.
i haven't declared most of the Error variables here shown in the list. I am not able to follow up further how to continue further and listed the functions i am using in the code as attachments.Please let me know what is the error here.
Thank you

  2 件のコメント

Bharath Venkataraman
Bharath Venkataraman 2016 年 11 月 11 日
Instead of building it out, you can use the Convolutional Encoder System object or block to generate HDL.
suneel kumar Gaddam
suneel kumar Gaddam 2016 年 11 月 18 日
I am not familiar with that process of implemntation?

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 11 月 12 日
You need to be marking up your code with items such as coder.varsize and https://www.mathworks.com/help/fixedpoint/ug/defining-variable-size-data-for-code-generation.html. (Though you cannot really use full varsize in HDL.)
Basically you should mark it up like you would if you were writing a MATLAB Function Block, initializing variables before you assign the results of calls.
If your Gpoly input might vary in size, then it is important that in your getcodeparameters.m routine that you mark up with a maximum supported size. This is crucial because HDL has to allocate hardware to hold the maximum arrays, possibly after it does flow analysis to determine which variables are no longer needed in the routine so that it can minimize the amount of hardware it has to allocate. So you cannot use coder.varsize without explicit upper bounds, because that would use dynamic memory and HDL does not have dynamic memory.
If your Gpoly is fixed size, then write your code around that fixed size.
Using maximum-size markups do not mean that you are not permitted to call the routine with smaller arrays. Using something like
[k, m] = size(something)
and using k to allocate arrays below is fine: the routine just has to know the maximum it might have to deal with.
You might want to also consider using assert() for this purpose:
assert( size(something, 1) <= 207 )
is logically equivalent to using coder.varsize to give a maximum of 207 rows -- though I am no completely sure that HDL coder is smart enough to notice it.

  4 件のコメント

表示 1 件の古いコメント
suneel kumar Gaddam
suneel kumar Gaddam 2016 年 11 月 18 日
Hi Mr.Robinson, I implemented all of your suggestions and streamlined the code based on a single polynomial. I also defined coder.varsize where the matrix size is changing,but i still get the same errors . Is the code good enough for HDL generation or not ?
Walter Roberson
Walter Roberson 2016 年 11 月 18 日
Have you posted the updated code?
suneel kumar Gaddam
suneel kumar Gaddam 2016 年 11 月 23 日
Sorry forgot to add updated code. Here is the updated code

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by