 |
|
|
|
 |
 |
 |
|
 |
|
 |
|
|
苏卓,王东艳,杨镒箫,张明睿,姜宇,孙家广.基于分支标记的数据流模型的代码生成方法.软件学报,2021,32(6):17-0 |
基于分支标记的数据流模型的代码生成方法 |
Code Generation Method of Data Flow Model Based on Branch Marking |
投稿时间:2020-08-26 修订日期:2020-12-19 |
DOI:10.13328/j.cnki.jos.006242 |
中文关键词: 模型驱动开发 数据流 代码生成 分支 嵌入式系统 |
英文关键词:model-driven development data flow code generation branch embedded system |
基金项目:国家自然科学基金(62022046,U1911401,61802223);科技部重点研发计划(2019YFB1706200);华为清华可信研究项目(20192000794) |
作者 | 单位 | E-mail | 苏卓 | 清华大学 软件学院, 北京 北京 100084 教育部信息系统安全重点实验室(清华大学), 北京 北京 100084 | | 王东艳 | 北京大学 信息科学技术学院, 北京 北京 100871 | | 杨镒箫 | 清华大学 软件学院, 北京 北京 100084 教育部信息系统安全重点实验室(清华大学), 北京 北京 100084 | | 张明睿 | 清华大学 软件学院, 北京 北京 100084 教育部信息系统安全重点实验室(清华大学), 北京 北京 100084 | | 姜宇 | 清华大学 软件学院, 北京 北京 100084 教育部信息系统安全重点实验室(清华大学), 北京 北京 100084 | jiangyu198964@126.com | 孙家广 | 清华大学 软件学院, 北京 北京 100084 教育部信息系统安全重点实验室(清华大学), 北京 北京 100084 | |
|
摘要点击次数: 51 |
全文下载次数: 23 |
中文摘要: |
模型驱动开发以其低错误率,易仿真,易验证的特点在嵌入式软件开发中被广泛应用.近年来,基于模型的嵌入式软件开发方法及相应工具也在逐渐发展和完善.数据流模型是各种建模工具中使用最为频繁的语义模型,然而各种工具对于数据流模型的代码生成能力却参差不齐,特别是对于数据分支组件的支持,当前主流的建模工具都采用各种方式来回避复杂的分支建模及对应的代码生成.但是,分支建模是非常重要的,使用分支组件可以更清晰地表现出数据流的数据传递逻辑.为了解决复杂分支建模带来的代码生成难题,本文针对具有复杂分支组合的数据流模型提出了一种基于分支调度标记的代码生成方法.在本文提出的算法中,首先通过拓扑排序确定模型的调度顺序,再根据不同分支的影响对组件进行分支标记,之后根据组件的分支标记构造一个基于控制流的代码生成位置表,最后即可根据代码生成位置表进行各种主流语言的代码生成.本文通过构造四个具有复杂分支的数据流模型实例进行代码生成,并在生成代码行数和运行时间等方面与Simulink和Ptolemy进行对比,进一步说明了我们的代码生成方法在复杂分支组合情况下的通用性以及本文工作的价值和意义. |
英文摘要: |
Model-driven development is widely used in embedded software development because it has a low error rate while it is easy to simulate and verify. In recent years, model-based embedded software development methods and their corresponding tools are also gradually developing and improving. Data flow model is the most frequently used semantic model among all kinds of modeling tools. Nonetheless, the code generation ability of various tools for data flow model is uneven, especially for the branching actors. It is well known that current mainstream modeling tools adopt various ways to avoid complex branch modeling and the generation of its corresponding code. However, branch modeling is very important, and it makes the data transfer logic of the data flow more clearly by using branch actors. In order to solve the problem of code generation caused by complex branch modeling, this paper proposed a code generation method based on branch schedule marking for data flow model aimed at complex branch combinations. As for the algorithm proposed in this paper, firstly, the scheduling order of the model was determined by topological sorting. Secondly, a code generation location table based on control flow was constructed according to the branch marks which marked by the influence of different branches. Finally, code generation of various mainstream languages could be carried out in terms of the code generation location table. By constructing four instances of data flow models with complex branches for code generation and comparing them with Simulink and Ptolemy in terms of lines of code generation and elapsed time, this paper further illustrates the universality of our code generation methods in complex branch combinations and the value and significance of this work. |
HTML 下载PDF全文 查看/发表评论 下载PDF阅读器 |
|
|
|
|
|
|
 |
|
|
|
|
 |
|
 |
|
 |
|