struct memeber can not be Simulink.Parameter?

조회 수: 3 (최근 30일)
dayu lai
dayu lai 2021년 7월 29일
댓글: dayu lai 2021년 8월 5일
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개)

Kiran Kintali
Kiran Kintali 2021년 8월 1일
Can you share a sample model?
  댓글 수: 1
dayu lai
dayu lai 2021년 8월 5일
Hi, I use the same demo in other question
The demo above can generate RTL successfully. However, if I change the parameter of constant before comparator into structure memeber. The compile of MDL is fail.
See the attached png for detail.
In reality, there will be a lot of tunable value in my design. I just want them to be members of structure, like reg.tunable_value0, reg.tunable_value1 and etc. Otherwise my workspace would be full filled with the global tunable value.
How I can do it?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 HDL Coder에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by