当前位置:网站首页>2837xd code generation - Summary
2837xd code generation - Summary
2022-07-02 09:37:00 【Quikk】
2837xd Code generation —— Conclusion
Code generation is a huge system , It took a long time to sort out the conditioning . This article will also focus on what was not mentioned before Simulink Coder Conduct actual measurement and explain usage .
1 Code generation
The emergence of code generation technology is in recent years , Increasingly popular MBD(model basic design) It is an important part of birth and evolution . At present, more and more algorithms need to pass CAE Analyze , Then develop products . How to quickly design model Transforming into products has become one of the main directions for software engineers , If you can generate code directly from the model, you will reduce a lot of unnecessary human and material resources to the repeated development of the bottom .
2 Code generation process
At this stage, code generation technology is mainly divided into stages :1) Demand analysis 2) Model design 3) Simulation verification 4) Convert to product
Demand analysis is not explained in detail here , It is not the focus of research at this stage .
Model design is mainly based on demand modeling , Simulate and verify whether the algorithm meets the requirements .
Simulation verification is mainly divided into SIL( Software in the loop )、PIL( Processor in loop )、HIL( Hardware in the loop ) Three blocks are tested .
1)SIL Mainly responsible for verifying model The simulation and generated code operation results are in PC Verify whether the results are consistent .
2)PIL It refers to burning the generated code to the processor device (DSP、ARM etc. ), Then the operation result is returned to PC End ,PC The end combines its operation result with model The simulation results are compared to check whether there is error .
3)HIL Is to utilize more complex external hardware , Simulate the controlled object . Controller use DSP or ARM Burn the program . Observe whether the external hardware can achieve the desired effect . After this step is completed , It is proved that the designed controller can better complete the control task . The next step is to go to the physical platform for physical experiments .
3 A little supplement to code generation
Detailed code generation has been groping forward in the previous article . Another piece of content is Simulink Provides the official library Simulink Coder Add your own written files for compatibility . On the one hand, it can provide functions that are not involved in some modules for code use , At the same time, compatibility has been verified c Language algorithms .
Simulink Coder There is one in the library Custom Code, It contains several library files :

Here is a table excerpted from an official document : The official link

The main thing that I feel has practical effect is , The following test findings :
1)System Initialize: Whether inside the module or on the top module System Initialize modular . It is only executed once in the system initialization function .
2)Model Source: Will be generated in .c Add the written code to the corresponding part of the document , Generally, it is the declaration and implementation of functions .
3)Model Header: Will be generated in .h Add the written code to the corresponding part of the document , Generally, it is the definition of function 、 Definition of data type .
4)System Updata And System Output: In the step function, each step will be executed ,Output The code segment in will precede Updata To perform . The function part of which module will be executed in which module .Ouput Of header and body Will add code at the beginning of the sub module , That is, execute before the module ,Output Of bottom Code will be added at the end of the sub module , That is, execute after executing the module . and Updata The module will execute all the sub module contents ( Include Output Of bottom completion of enforcement ) Separately header、body、bottom Code at .
5)System Start And System Enable: System Start Code will be added at the beginning of the initialization function , No matter where it is placed, it is only executed once .System Enable Add code at the end of the initialization function , No matter where it is placed, it is only executed once .
边栏推荐
- zk配置中心---Config Toolkit配置与使用
- 互联网API接口幂等设计
- How to install PHP in CentOS
- Double non undergraduate students enter the factory, while I am still quietly climbing trees at the bottom (Part 1)
- Statistical learning methods - Chapter 5, decision tree model and learning (Part 1)
- 三相逆变器离网控制——PR控制
- Required request body is missing: (cross domain problem)
- Alibaba / popular JSON parsing open source project fastjson2
- Who is better for Beijing software development? How to find someone to develop system software
- Chrome视频下载插件–Video Downloader for Chrome
猜你喜欢

Chrome用户脚本管理器-Tampermonkey 油猴

互联网API接口幂等设计

Machine learning practice: is Mermaid a love movie or an action movie? KNN announces the answer

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd

Supplier selection and prequalification of Oracle project management system

Idea view bytecode configuration

三相逆变器离网控制——PR控制

c语言编程题

BugkuCTF-web24(解题思路及步骤)

Difference between redis serialization genericjackson2jsonredisserializer and jackson2jsonredisserializer
随机推荐
Chrome视频下载插件–Video Downloader for Chrome
C语言之到底是不是太胖了
VIM操作命令大全
分享一篇博客(水一篇博客)
Typeerror: X () got multiple values for argument 'y‘
C语言之数据插入
Insight into cloud native | microservices and microservice architecture
图像识别-数据清洗
分布式锁的这三种实现方式,如何在效率和正确性之间选择?
Solution to amq4036 error in remote connection to IBM MQ
Chrome用户脚本管理器-Tampermonkey 油猴
QT QLabel样式设置
idea查看字节码配置
概念到方法,绝了《统计学习方法》——第三章、k近邻法
FragmentTabHost实现房贷计算器界面
三相逆变器离网控制——PR控制
Required request body is missing:(跨域问题)
Actual combat of microservices | discovery and invocation of original ecosystem implementation services
TD联合Modelsim进行功能仿真
Microservice practice | fuse hytrix initial experience