struct memeber can not be Simulink.Parameter?
이전 댓글 표시
hi,
I am using HDL Coder to generate RTL code from simulink.
While I want some signal internal a simulink to be tunable, which names 'bp' for example. So I wrote following code:
bp = Simulink.Parameter;
bp.Value = [0;0;0];
bp.CoderInfo.StorageClass = 'ExportedGlobal';
Then the bp signal will appeared as a input port in RTL.
However, if I wrote like this:
reg.bp = Simulink.Parameter;
reg.bp.Value = [0;0;0];
reg.bp.CoderInfo.StorageClass = 'ExportedGlobal';
While generate RTL, it comes out error:
Invalid setting in '<some_block>' for parameter 'Value'.
error using slhdlcoder.SimulinkConnection/initModel
Expression 'reg.bp' for block '<some_block>' returns a Simulink.Parameter object that has property values that need to be evaluated. This object should be instantiated in a workspace and referenced by name in Simulink
So it seems struct member can not be simulink parameter?
댓글 수: 1
Parker
2024년 9월 11일
I hope the Mathworks team will revisit this question and give an explanation for why this is not allowed. I have run into the same thing, where our team would like to store our parameters in a structure and use them in constant and gain blocks in our model, but Mathworks appears to have disallowed this starting with MATLAB r14sp3, per this older question
채택된 답변
추가 답변 (2개)
Kiran Kintali
2021년 8월 1일
0 개 추천
Can you share a sample model?
Kiran Kintali
2024년 9월 11일
0 개 추천
These pages contain good info on allowed ExportedGlobal usage in HDL Coder
카테고리
도움말 센터 및 File Exchange에서 Code Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!