Modular code generation from synchronous block diagrams: modularity vs. code size

Modular code generation from synchronous block diagrams: modularity vs. code size
复制标题

从同步框图生成模块化代码:模块化与代码大小

DOI:
--
复制
发表时间:
2009
期刊:
ACM-SIGACT Symposium on Principles of Programming Languages
影响因子:
--
通讯作者:
S. Tripakis
S. Tripakis
中科院分区:
--
文献类型:
--
作者:
Roberto Lublinerman;Christian Szegedy;S. Tripakis

文献摘要

被引文献

相似文献

我们研究了从具有同步语义的分层方框图中进行模块化、自动的代码生成。这些图是嵌入式软件领域中广泛使用的工具(如Simulink和SCADE)背后的基本模型。从某种意义上说,代码是模块化的,它是为独立于上下文的给定组合块生成的(即,不知道要在哪个图中使用该块),并且使用关于块内部的最小信息。在之前的工作中,我们已经展示了如何通过计算每个块的一组接口函数和这些函数之间的一组依赖关系来生成模块化代码,这些函数与接口一起导出。我们还根据每个块生成的接口函数的数量介绍了模块化的量化概念,并展示了如何最小化这个数量,这对可伸缩性至关重要。最后,我们揭示了模块化和可重用性(可以在其中使用块的一组图)之间的基本权衡。
We study modular, automatic code generation from hierarchical block diagrams with synchronous semantics. Such diagrams are the fundamental model behind widespread tools in the embedded software domain, such as Simulink and SCADE. Code is modular in the sense that it is generated for a given composite block independently from context (i.e., without knowing in which diagrams the block is to be used) and using minimal information about the internals of the block. In previous work, we have shown how modular code can be generated by computing a set of interface functions for each block and a set of dependencies between these functions that is exported along with the interface. We have also introduced a quantified notion of modularity in terms of the number of interface functions generated per block, and showed how to minimize this number, which is essential for scalability. Finally, we have exposed the fundamental trade-off between modularity and reusability (set of diagrams the block can be used in). In this paper we explore another trade-off: modularity vs. code size. We show that our previous technique, although it achieves maximal reusability and is optimal in terms of modularity, may result in code replication and therefore large code sizes, something often unacceptable in an embedded system context. We propose to remedy this by generating code with no replication, and show that this generally results in some loss of modularity. We show that optimizing modularity while maintaining maximal reusability and zero replication is an intractable problem (NP-complete). We also show that this problem can be solved using a simple iterative procedure that checks satisfiability of a sequence of propositional formulas. We report on a new prototype implementation and experimental results. The latter demonstrate the practical interest in our methods.