A New Multi-threaded Code Synthesis Methodology and Tool for Correct-by-Construction Synthesis from Polychronous Specifications

Embedded software systems respond to multiple events coming from various sources - some temporally regular (ex: periodic sampling of continuous time signals) and some intermittent (ex: interrupts, exception events etc.). Timely response to such events while executing complex computation, might require multi-threaded implementation. For example, overlapping I/O of various types of events, and computation on such events may be delegated to different threads. However, manual programming of multi-threaded programs is error-prone, and proving correctness is computationally expensive. In order to guarantee safety of such implementations, we believe that a correct-by-construction synthesis of multi-threaded software from formal specification is required. It is also imperative that the multiple threads are capable of making progress asynchronous to each other, only synchronizing when shared data is involved or information requires to be passed from one thread to other. Especially on a multi-core platform, lesser the synchronization between threads, better will be the performance. Also, the ability of the threads to make asynchronous progress, rather than barrier synchronize too often, would allow better real-time schedulability. In this work, we describe our technique for multi-threaded code synthesis from a variant of the polychronous programming language SIGNAL, namely MRICDF. Through a series of experimental benchmarks we show the efficacy of our synthesis technique. Our tool EmCodeSyn which was built originally for sequential code synthesis from MRICDF models has been now extended with multi-threaded code synthesis capability. Our technique first checks the concurrent implementability of the given MRICDF model. For implementable models, we further compute the execution schedule and generate multi-threaded code with appropriate synchronization constructs so that the behavior of the implementation is latency equivalent to that of the original MRICDF model.

[1]  Pascal Raymond,et al.  The synchronous data flow programming language LUSTRE , 1991, Proc. IEEE.

[2]  Y. Sorel,et al.  From design-time concurrency to effective implementation parallelism: The multi-clock reactive case , 2011, 2011 Electronic System Level Synthesis Conference (ESLsyn).

[3]  Klaus Schneider,et al.  Efficient code generation from synchronous programs , 2006, Fourth ACM and IEEE International Conference on Formal Methods and Models for Co-Design, 2006. MEMOCODE '06. Proceedings..

[4]  Klaus Schneider,et al.  Multithreaded code from synchronous programs: Extracting independent threads for OpenMP , 2010, 2010 Design, Automation & Test in Europe Conference & Exhibition (DATE 2010).

[5]  Robert de Simone,et al.  From Concurrent Multi-clock Programs to Deterministic Asynchronous Implementations , 2009, ACSD.

[6]  Sandeep K. Shukla,et al.  SMT based false causal loop detection during code synthesis from Polychronous specifications , 2011, Ninth ACM/IEEE International Conference on Formal Methods and Models for Codesign (MEMPCODE2011).

[7]  Paul Le Guernic,et al.  Compositional design of isochronous systems , 2008, 2008 Design, Automation and Test in Europe.

[8]  Sandeep K. Shukla,et al.  Generating Multi-Threaded code from Polychronous Specifications , 2009, Electron. Notes Theor. Comput. Sci..

[9]  Partha S. Roop,et al.  Compiling Esterel for Multi-core Execution , 2011, 2011 14th Euromicro Conference on Digital System Design.

[10]  Sandeep K. Shukla,et al.  An alternative polychronous model and synthesis methodology for model-driven embedded software , 2010, 2010 15th Asia and South Pacific Design Automation Conference (ASP-DAC).

[11]  Sandeep K. Shukla,et al.  EmCodeSyn: A visual framework for multi-rate data flow specifications and code synthesis for embedded applications , 2009, 2009 Forum on Specification & Design Languages (FDL).

[12]  Mahesh Nanjundappa,et al.  Synthesizing embedded software with safety wrappers through polyhedral analysis in a polychronous framework , 2012, 2012 Electronic System Level Synthesis Conference.