Multi-threaded code generation from Signal program to OpenMP
Kai HU, Teng ZHANG, Zhibin YANG
Multi-threaded code generation from Signal program to OpenMP
The use of multi-core processors will become a trend in safety critical systems. For safe execution of multithreaded code, automatic code generation from formal specification is a desirable method. Signal, a synchronous language dedicated for the functional description of safety critical systems, provides soundness semantics for deterministic concurrency. Although sequential code generation of Signal has been implemented in Polychrony compiler, deterministic multi-threaded code generation strategy is still far from mature. Moreover, existing code generation methods use certain multi-thread library, which limits the cross platform executions. OpenMP is an application program interface (API) standard for parallel programming, supported by several mainstream compilers from different platforms. This paper presents a methodology translating Signal program to OpenMP-based multi-threaded C code. First, the intermediate representation of the core syntax of Signal using synchronous guarded actions is defined. Then, according to the compositional semantics of Signal equations, the Signal program is synthesized to dependency graph (DG). After parallel tasks are extracted from dependency graph, the Signal program can be finally translated into OpenMP-based C code which can be executed on multiple platforms.
multi-thread / synchronous language / Signal / code generation / OpenMP
[1] |
IEEE POSIX standardization authority.
|
[2] |
Microsoft windows threads.
|
[3] |
MPI: A message-passing interface standard version 3.0.
|
[4] |
The OpenMP API specification for parallel programming.
|
[5] |
Intel thread building blocks.
|
[6] |
Lee E A. The problem with threads. Computer, 2006, 39(5): 33−42
CrossRef
Google scholar
|
[7] |
Benveniste A,Berry G. The synchronous approach to reactive and realtime systems. Proceedings of the IEEE, 1991, 79(9): 1270−1282
CrossRef
Google scholar
|
[8] |
Benveniste A, Caspi P, Edwards S A, Halbwachs N, Le Guernic P, De Simone R. . The synchronous languages 12 years later. Proceedings of the IEEE, 2003, 91(1): 64−83
CrossRef
Google scholar
|
[9] |
Berry G, Gonthier G. The esterel synchronous programming language: design, semantics, implementation. Science of Computer Programming, 1992, 19(2): 87−152
CrossRef
Google scholar
|
[10] |
Halbwachs N, Caspi P, Raymond P, Pilaud D. The synchronous data flow programming language lustre. Proceedings of the IEEE, 1991, 79(9): 1305−1320
CrossRef
Google scholar
|
[11] |
Le Guernic P, Gautier T, Le Borgne M, Le Maire C. . Programming realtime applications with signal. Proceedings of the IEEE, 1991, 79(9): 1321−1336
CrossRef
Google scholar
|
[12] |
Le Guernic P, Talpin J P, Le Lann J C. Polychrony for system design. Journal of Circuits, Systems, and Computers, 2003, 12(3): 261−303
CrossRef
Google scholar
|
[13] |
Potop-Butucaru D, Caillaud B, Benveniste A. Concurrency in synchronous systems. Formal Methods in System Design, 2006, 28(2): 111−130
CrossRef
Google scholar
|
[14] |
Besnard L, Gautier T, Talpin J P. Code generation strategies in the polychrony environment.
|
[15] |
Besnard L, Gautier T, Le Guernic P, Talpin J P. Compilation of polychromous data flow equations. In: Synthesis of Embedded Software, 1−40. Springer, 2010
|
[16] |
Talpin J P, Ouy J, Gautier T, Besnard L, Le Guernic P. Compositional design of isochronous systems. Science of Computer Programming, 2012, 77(2): 113−128
CrossRef
Google scholar
|
[17] |
Benveniste A, Caillaud B, Le Guernic P. Compositionality in dataflow synchronous languages: specification and distributed code generation. Information and Computation, 2000, 163(1): 125−171
CrossRef
Google scholar
|
[18] |
Jose B A, Shukla S K, Patel H D, Talpin J P. On the deterministic multithreaded software synthesis from polychronous specifications. In: Proceedings of the 6th ACM/IEEE International Conference on Formal Methods and Models for Co-Design. 2008, 129−138
CrossRef
Google scholar
|
[19] |
Maffeïs O, Le Guernic P. Combining dependability with architectural adaptability by means of the signal language. In: Static Analysis, 99−110. Springer, 1993
|
[20] |
Potop-Butucaru D, Sorel Y, Simone d R, Talpin J P. From concurrent multi-clock programs to deterministic asynchronous implementations. Fundamenta Informaticae, 2011, 108(1): 91−118
|
[21] |
Papailiopoulou V, Potop-Butucaru D, Sorel Y, Simone d R, Besnard L, Talpin J. From design-time concurrency to effective implementation parallelism: The multi-clock reactive case. In: Proceedings of the 2011 Electronic System Level Synthesis Conference. 2011, 1−6
CrossRef
Google scholar
|
[22] |
Baudisch D, Brandt J, Schneider K. Multithreaded code from synchronous programs: extracting independent threads for openmp. In: Proceedings of the 2010 Conference on Design, Automation, and Test in Europe. 2010, 949−952
CrossRef
Google scholar
|
[23] |
Besnard L, Gautier T, Le Guernic P. Signal v4-Inria version: reference manual, 2008
|
[24] |
Gamatie A. Designing embedded systems with the signal programming language. Springer, 2010
CrossRef
Google scholar
|
[25] |
RT-builder, geensys.
|
[26] |
Polychrony.
|
/
〈 | 〉 |