Why does my simulink chart generate an error with data type fixdt(0,8,0) or fixdt(0,16,0) but not other sizes 7,9,10 etc.
6 ビュー (過去 30 日間)
古いコメントを表示
I have a project that I am writing for HDL coder and I am useing a Mealy Chart within simulink.
I have set the following into the Matlab workspace to configure the chart:
Word_Size = 8; % bits : The size of the word ( eg 8-bits, 9-bits)
MY_Type = fixdt(0,Word_Size,0);
Then in the model explorer I have set the DataType to MY_Type for my variable RegIn. I get the following errors when Word_Size = 8 but not if Word_Size = 9.
"This assignment writes a 'uint8' value into a 'embedded.fi {ufix1}' type. Code generation does not support changing types through assignment. Check preceding assignments or input type specifications for type mismatches. Transition in Chart 'Bla?Bla?Bla?': {S_Out=bitget(RegIn,8);}"
I have set the chart properties "treat these inherited Simulink signal types as fi objects" to "Fixed-point & Integer"
In Model Explore is shows that the variable RegIn has a DataType of "MY_Type" but a CompiledType of uint8 when Word_Size is 8 and a CompliedType of ufix9.
Any Idea what I am missing?
0 件のコメント
回答 (1 件)
Ryan Baird
2022 年 11 月 18 日
As a workaround, you may be able to define the type directly inside of the symbols pane, or if it is an input set the type to inherited and define the type on the simulink side.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で User-Defined MATLAB Functions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!