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

We study modular, automatic code generation from hierarchical block diagrams with synchronous semantics. Such diagrams are the fundamental model behind widespread tools such as Simulink and SCADE. Modularity means code is generated for a given composite block independently from context, that is, without knowing in which diagrams this block is going to be used. This can be achieved by abstracting a given macro (i.e., composite) block into a set of interface functions plus a set of dependencies between these functions. These two pieces of information form the exported interface for a block. This approach allows modularity to be quantified, in terms of the size of the interface, that is, the number of interface functions that are generated per block. The larger this number, the less modular the code is. This definition reveals a fundamental trade-off between modularity and reusability (set of diagrams the block can be used in): using an abstraction that is too coarse (i.e., too few interface functions) may create false input-output dependencies and result in dependency cycles due to feedback loops. In this paper we explore this and other trade-offs. We also show how the method can be extended from a purely synchronous block diagram model to triggered and timed block diagrams, which allow for modeling multi-rate systems.

[1]  Stephen A. Edwards,et al.  The semantics and execution of a synchronous block-diagram language , 2003, Sci. Comput. Program..

[2]  Stavros Tripakis,et al.  Modularity vs. Reusability: Code Generation from Synchronous Block Diagrams , 2008, 2008 Design, Automation and Test in Europe.

[3]  Laurent Pautet,et al.  Cronos: A Separate Compilation Toolset for Modular Esterel Applications , 1999, World Congress on Formal Methods.

[4]  Edward A. Lee,et al.  Leveraging synchronous language principles for heterogeneous modeling and design of embedded systems , 2007, EMSOFT '07.

[5]  Sharad Malik Analysis of cyclic combinational circuits , 1994, IEEE Trans. Comput. Aided Des. Integr. Circuits Syst..

[6]  Thomas R. Shiple,et al.  Constructive analysis of cyclic circuits , 1996, Proceedings ED&TC European Design and Test Conference.

[7]  Stavros Tripakis,et al.  Modular Code Generation from Triggered and Timed Block Diagrams , 2008, 2008 IEEE Real-Time and Embedded Technology and Applications Symposium.

[8]  Paul Le Guernic,et al.  Distributed Implementation of SIGNAL: Scheduling & Graph Clustering , 1994, FTRTFT.

[9]  P.J. Mosterman,et al.  Using interleaved execution to resolve cyclic dependencies in time-based block diagrams , 2004, 2004 43rd IEEE Conference on Decision and Control (CDC) (IEEE Cat. No.04CH37601).

[10]  Stavros Tripakis,et al.  Modular code generation from synchronous block diagrams: modularity vs. code size , 2009, POPL '09.

[11]  Pascal Aubry,et al.  Synchronous distribution of SIGNAL programs , 1996, Proceedings of HICSS-29: 29th Hawaii International Conference on System Sciences.

[12]  Albert Benveniste,et al.  Compositionality in Dataflow Synchronous Languages: Specification and Code Generation , 1997, COMPOS.