Error: variable-size matrix type is not supported for HDL code
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I use the fixed-point tool to fixed-point the subsystem and then generate Verilog, but the following error occurs.
The model contains constructs that are unsupported for HDL code generation. HDL Coder 'c' : Error: variable-size matrix type is not supported for HDL code generation. Function 'eml_fixpt_times' (#33554529.1887.1910), line 65, column 5 Function 'times' (#33554530.5290.5318), line 146, column 27 Function 'mtimes' (#33554528.2252.2264), line 62, column 9 Function 'forSubsystem/MATLAB Function1/MATLAB Function1_FixPt' (#369.531.542), line 23, column 13
In #369.531.542, the error is related to miu*x*en(i), i tried to use sss=miu*x*en(i) instead, but it ended up showing Subscripted assignment dimension mismatch: [1] ~= [5]. Error in 'testfixed/testforSubsystem/MATLAB Function' (line 23) sss = miu*x*en(i);
I fixed the above problem,
sss= zeros(1,5);
sss = miu*x*en(i);
wn(:)=wn+sss;
but still failed to generate Verilog,
The model contains constructs that are unsupported for HDL code generation. HDL Coder 'c' : Error: variable-size matrix type is not supported for HDL code generation. Function 'eml_fixpt_times' (#33554529.1887.1910), line 65, column 5 Function 'times' (#33554530.5290.5318), line 146, column 27 Function 'mtimes' (#33554528.2252.2264), line 62, column 9 Function 'forsubsystem/MATLAB Function' (#998.580.591), line 23, column 1
The key to the error is on en(i), why does it cause this error?
2 Commenti
Walter Roberson
il 18 Apr 2023
Note that it is typically possible to use coder.varsize() provided that a fixed maximum size for the array is specified. When HDL is generated, it needs to know the maximum amount of memory that will be used for the array, and must always generate enough memory cells to allow for the worst-case situation. Indefinitely-large arrays are not permitted because that would require generating countable-infinity hardware memory cells.
shubin
il 14 Ago 2024 alle 12:31
Spostato: Walter Roberson
il 14 Ago 2024 alle 19:08
Hello, may I ask if your issue has been resolved? I also encountered the same problem while dealing with LMS. How was it resolved? Could you share it to me?Thank you very much。
Risposte (1)
Kiran Kintali
il 18 Apr 2023
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1360248/image.png)
Variable dimensions are not synthesizable to hardware and hence not supported for HDL Code generation.
>> mlhdlc_demo_setup('lms')
This example shows how to code LMS filter using basic MATLAB operations without needing variable dimensions.
Consider following the best practices in the example to code your adaptive filter.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!