![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1422408/image.png)
Can't generate Simulink model from Simulink function block
조회 수: 1 (최근 30일)
이전 댓글 표시
I was using HDL code generation , for making a generated model for my Simulink model containing a Matlab function block, but in the generated model , there is the same function block , is there a way it can be converted to a Simulink block version?.
댓글 수: 0
채택된 답변
Shubh Pareek
2023년 6월 29일
From what I understood you can't see the Simulink version of your Function Block ,
Try this method ,right click on your function block and on HDL Code properties set architechture as MATLAB datapath and then try to make the generated model .
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1422408/image.png)
I hope this helps with your query .
댓글 수: 2
Kiran Kintali
2023년 6월 29일
Select HDL Block Properties on MATLAB Function Block and choose MATLAB Datapath architecture. If the MATLAB code is data path compliant it can be expanded to Simulink blocks in the generated model. During code generation the the contents of the MATLAB Code are optimized with the rest of the Simulink blocks. For example you do resource sharing of multipliers within MATLAB Block with Multiply blocks in Simulink.
추가 답변 (1개)
Kiran Kintali
2023년 6월 29일
You can convert a subset of MATLAB code into Simulink blocks in the generated model when in DataPath optimization mode.
Why Use MATLAB Datapath Architecture?
HDL code generation for a MATLAB Function block supports two HDL architectures: MATLAB Function and MATLAB Datapath. Specify the HDL Architecture in the HDL Block Properties dialog box of the MATLAB Function block.
Use the MATLAB Datapath architecture to:
- Model complex fixed-point and floating-point MATLAB algorithms inside MATLAB Function blocks and interface this algorithm with other Simulink blocks in your model.
- Improve area and timing of your design significantly by optimizing the algorithm inside the MATLAB Function block and across the MATLAB Function block boundary with other Simulink blocks in your model.
The MATLAB Datapath architecture is the default setting for MATLAB Function blocks with floating-point types. By enabling this architecture for fixed-point operations, you can use various optimizations that include:
- Hierarchy flattening
- Resource sharing and streaming
- Clock-rate pipelining
- Adaptive pipelining
- Distributed pipelining
- Critical path estimation
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!