基于分支标记的数据流模型的代码生成方法
作者:
作者单位:

作者简介:

苏卓(1995-),男,博士,CCF学生会员,主要研究领域为模型驱动开发.
张明睿(1997-),男,博士,主要研究领域为测试驱动生成.
王东艳(1996-),女,硕士,CCF学生会员,主要研究领域为计算机系统结构,数字图像处理.
姜宇(1989-),男,博士,副教授,博士生导师,CCF专业会员,主要研究领域为软件工程,物理信息融合系统.
杨镒箫(1991-),男,博士后,主要研究领域为嵌入式建模仿真开发.
孙家广(1946-),男,教授,博士生导师,主要研究领域为计算机图形学,计算机辅助设计,软件工程与系统.

通讯作者:

姜宇,jiangyu198964@126.com

中图分类号:

基金项目:

国家自然科学基金(62022046,U1911401,61802223);科技部重点研发计划(2019YFB1706200);华为清华可信研究项目(20192000794)


Code Generation Method of Data Flow Model Based on Branch Marking
Author:
Affiliation:

Fund Project:

National Natural Science Foundation of China (62022046, U1911401, 61802223); National Key Research and Development Project (2019YFB1706200); Huawei-Tsinghua Trustworthy Research Project (20192000794)

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    模型驱动开发以其低错误率、易仿真、易验证的特点,在嵌入式软件开发中被广泛应用.近年来,基于模型的嵌入式软件开发方法及相应工具也在逐渐发展和完善.数据流模型是各种建模工具中使用最为频繁的语义模型,然而,各种工具对于数据流模型的代码生成能力却参差不齐,特别是对于数据分支组件的支持,当前主流的建模工具都采用各种方式来回避复杂的分支建模及对应的代码生成.但是,分支建模是非常重要的,使用分支组件可以更清晰地表现出数据流的数据传递逻辑.为了解决复杂分支建模带来的代码生成难题,针对具有复杂分支组合的数据流模型.提出了一种基于分支调度标记的代码生成方法.在所提出的算法中,首先通过拓扑排序确定模型的调度顺序,再根据不同分支的影响对组件进行分支标记;之后,根据组件的分支标记构造一个基于控制流的代码生成位置表;最后,即可根据代码生成位置表进行各种主流语言的代码生成.通过构造4个具有复杂分支的数据流模型实例进行代码生成,并在生成代码行数和运行时间等方面与Simulink和Ptolemy进行对比,进一步说明该代码生成方法在复杂分支组合情况下的通用性以及所做工作的价值和意义.

    Abstract:

    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 study 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 study, 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 study further illustrates the universality of proposed code generation methods in complex branch combinations and the value and significance of this work.

    参考文献
    相似文献
    引证文献
引用本文

苏卓,王东艳,杨镒箫,张明睿,姜宇,孙家广.基于分支标记的数据流模型的代码生成方法.软件学报,2021,32(6):1647-1662

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2020-08-26
  • 最后修改日期:2020-12-19
  • 录用日期:
  • 在线发布日期: 2021-02-07
  • 出版日期: 2021-06-06
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号