Flatten Hierachy for MATLAB functions used in SIMULINK when Generating HDL code

1 次查看(过去 30 天)
Hi, I am using few MATLAB functions in my SIMULINK model and then generate an HDL code (Verilog in particular) from it. The problem I am having is that it generates different Verilog files for each function and I can't find an option to flatten the hierarchy for the functions. Is it possible to flatten the hierarchy for the functions?
Many Thanks, Kamyar

回答(1 个)

Yousef B Bedoustani
编辑:Yousef B Bedoustani 2018-10-5
1. Right click on the subsystem
2. Chose HDL code\ HDL Block Properties
3. In General section: change FlattenHierarchy = on
  2 个评论
Kamyar Khosravi
Kamyar Khosravi 2018-10-8
Hi Yousef,
Thank you for the reply. But my question was for MATLAB function and not the subsystem. Even when I put the function within the subsystem and flatten hierarchy as you mentioned, I still receive additional file for that function.
Peyman K. Reghbati
Peyman K. Reghbati 2020-2-14
编辑:Peyman K. Reghbati 2020-2-14
It is possible that you have the MATLAB function Synchronous in State Control of your function. See Below:
imitations For Hierarchy Flattening
A subsystem cannot be flattened if the subsystem is:
  • A Synchronous Subsystem or uses the State Control block in Synchronous mode.
  • A black box implementation or model reference.
  • A Triggered Subsystem when Use trigger signal as clock is enabled.
  • A masked subsystem that contains any of the following:
  • Bus.
  • Enumerated data type.
  • Lookup table blocks: 1-D Lookup Table, 2-D Lookup Table, Cosine HDL Optimized, Direct LookupTable (n-D), Prelookup, Sine HDL Optimized, n-D Lookup Table.
  • MATLAB System block.
  • Stateflow blocks: Chart, State Transition Table, Sequence Viewer.
  • Blocks with a pass-through or no-op implementation. See Pass through, No HDL, and Cascade Implementations.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Code Generation 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by