当前位置:网站首页>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 .
边栏推荐
- Insight into cloud native | microservices and microservice architecture
- Microservice practice | fuse hytrix initial experience
- 一篇详解带你再次重现《统计学习方法》——第二章、感知机模型
- 自定義Redis連接池
- BugkuCTF-web21(详细解题思路及步骤)
- JVM指令助记符
- Mysql默认事务隔离级别及行锁
- Number structure (C language -- code with comments) -- Chapter 2, linear table (updated version)
- 洞见云原生|微服务及微服务架构浅析
- Read 30 minutes before going to bed every day_ day4_ Files
猜你喜欢

kinect dk 获取CV::Mat格式的彩色RGB图像(openpose中使用)

破茧|一文说透什么是真正的云原生

逆变器simulink模型——处理器在环测试(PIL)

Break the cocoon | one article explains what is the real cloud primordial

Insight into cloud native | microservices and microservice architecture

Microservice practice | declarative service invocation openfeign practice

三相并网逆变器PI控制——离网模式

MySQL default transaction isolation level and row lock

一篇详解带你再次重现《统计学习方法》——第二章、感知机模型

Solutions to Chinese garbled code in CMD window
随机推荐
每天睡觉前30分钟阅读_day3_Files
个人经历&&博客现状
Read Day6 30 minutes before going to bed every day_ Day6_ Date_ Calendar_ LocalDate_ TimeStamp_ LocalTime
web安全与防御
Operation and application of stack and queue
洞见云原生|微服务及微服务架构浅析
逆变器simulink模型——处理器在环测试(PIL)
Fragmenttabhost implements the interface of housing loan calculator
tinyxml2 读取和修改文件
Redis installation and deployment (windows/linux)
Oracle modifies tablespace names and data files
Chrome browser plug-in fatkun installation and introduction
Required request body is missing: (cross domain problem)
Who is better for Beijing software development? How to find someone to develop system software
Chrome浏览器标签管理插件–OneTab
Micro service practice | introduction and practice of zuul, a micro service gateway
zk配置中心---Config Toolkit配置与使用
Amq6126 problem solving ideas
Ora-12514 problem solving method
因上努力,果上随缘