当前位置:网站首页>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 .
边栏推荐
- Matplotlib swordsman line - first acquaintance with Matplotlib
- Chrome视频下载插件–Video Downloader for Chrome
- Elastic Stack之Beats(Filebeat、Metricbeat)、Kibana、Logstash教程
- 每天睡觉前30分钟阅读_day4_Files
- Methods of classfile
- BugkuCTF-web24(解题思路及步骤)
- Statistical learning methods - Chapter 5, decision tree model and learning (Part 1)
- Beats (filebeat, metricbeat), kibana, logstack tutorial of elastic stack
- Oracle modify database character set
- Demand delineation executive summary
猜你喜欢
Microservice practice | Eureka registration center and cluster construction
Micro service practice | introduction and practice of zuul, a micro service gateway
c语言编程题
告别996,IDEA中必装插件有哪些?
Say goodbye to 996. What are the necessary plug-ins in idea?
Timed thread pool implements request merging
自定义Redis连接池
vs+qt 设置应用程序图标
Enterprise level SaaS CRM implementation
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd
随机推荐
[go practical basis] how to verify request parameters in gin
BugkuCTF-web21(详细解题思路及步骤)
JDBC回顾
并网逆变器PI控制(并网模式)
AMQ 4043 solution for errors when using IBM MQ remote connection
道阻且长,行则将至
记录一下初次使用Xray的有趣过程
Methods of classfile
Probability is not yet. Look at statistical learning methods -- Chapter 4, naive Bayesian method
Double non undergraduate students enter the factory, while I am still quietly climbing trees at the bottom (Part 1)
Say goodbye to 996. What are the necessary plug-ins in idea?
Matplotlib swordsman line - first acquaintance with Matplotlib
概念到方法,绝了《统计学习方法》——第三章、k近邻法
Chrome browser plug-in fatkun installation and introduction
JDBC review
上班第一天的报错(Nessus安装winpcap报错)
Enterprise level SaaS CRM implementation
[go practical basis] gin efficient artifact, how to bind parameters to structures
Microservice practice | fuse hytrix initial experience
Demand delineation executive summary