Synchronous Deterministic Parallel Programming for Multi-Cores with ForeC

Cyber-physical systems (CPSs) are embedded systems that are tightly integrated with their physical environment. The correctness of a CPS depends on the output of its computations and on the timeliness of completing the computations. The increasing use of high-performing and low-power multi-core processors in embedded systems is pushing embedded programmers to be parallel programming experts. Parallel programming is challenging because of the skills, exper ences, and knowledge needed to avoid common parallel programming traps and pitfalls. This paper proposes the ForeC language for the deterministic, parallel, and reactive programming of embedded multi-cores. The synchronous semantics of ForeC is designed to greatly simplify the understanding and debugging of parallel programs. ForeC allows programmers to express many forms of parallel patterns while ensuring that ForeC programs can be compiled efficiently for parallel execution and be amenable to static timing analysis. ForeC’s main innovation is its shared variable semantics that provides thread isolation and deterministic thread communication. All ForeC programs are correct by construction and deadlock-free because mutual exclusion constructs are not needed. Through benchmarking, we demonstrate that ForeC can achieve better parallel performance than Esterel, a widely used synchronous language for concurrent safety-critical systems, and OpenMP, a popular desktop solution for parallel programming. We demonstrate that the worst-case execution time of ForeC programs can be estimated to a high degree of precision.

[1]  Gordon D. Plotkin,et al.  A structural approach to operational semantics , 2004, J. Log. Algebraic Methods Program..

[2]  Sebastian Fischmeister,et al.  Semantics-preserving implementation of synchronous specifications over dynamic TDMA distributed architectures , 2010, EMSOFT '10.

[3]  Lothar Thiele,et al.  Timing Analysis for Resource Access Interference on Adaptive Resource Arbiters , 2011, 2011 17th IEEE Real-Time and Embedded Technology and Applications Symposium.

[4]  Alberto L. Sangiovanni-Vincentelli,et al.  Synthesis of Multitask Implementations of Simulink Models With Minimum Delays , 2010, IEEE Transactions on Industrial Informatics.

[5]  Stephen A. Edwards,et al.  A disruptive computer design idea: Architectures with repeatable timing , 2009, 2009 IEEE International Conference on Computer Design.

[6]  Bryan Ford,et al.  Deterministic OpenMP for Race-Free Parallelism , 2011, HotPar.

[7]  Paul Caspi,et al.  From Control Loops to Real-Time Programs , 2005, Handbook of Networked and Embedded Control Systems.

[8]  David Broman,et al.  WCET-aware dynamic code management on scratchpads for Software-Managed Multicores , 2014, 2014 IEEE 19th Real-Time and Embedded Technology and Applications Symposium (RTAS).

[9]  Wang Yi,et al.  Building timing predictable embedded systems , 2014, ACM Trans. Embed. Comput. Syst..

[10]  Roopak Sinha,et al.  Efficient WCRT analysis of synchronous programs using reachability , 2011, 2011 48th ACM/EDAC/IEEE Design Automation Conference (DAC).

[11]  David A. Patterson,et al.  Computer Architecture: A Quantitative Approach , 1969 .

[12]  William R. Dunn Designing Safety-Critical Computer Systems , 2003, Computer.

[13]  Charles E. McDowell,et al.  Debugging concurrent programs , 1989, ACM Comput. Surv..

[14]  John C. Knight,et al.  Safety critical systems: challenges and directions , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.

[15]  Hermann Kopetz,et al.  The Complexity Challenge in Embedded System Design , 2008, 2008 11th IEEE International Symposium on Object and Component-Oriented Real-Time Distributed Computing (ISORC).

[16]  Ben Hardekopf,et al.  Flow-sensitive pointer analysis for millions of lines of code , 2011, International Symposium on Code Generation and Optimization (CGO 2011).

[17]  Martin Schoeberl,et al.  Towards a Time-predictable Dual-Issue Microprocessor: The Patmos Approach , 2011, PPES.

[18]  Stephen A. Edwards,et al.  Compiling Esterel , 2007 .

[19]  Cormac Flanagan,et al.  Types for atomicity , 2003, TLDI '03.

[20]  Orlando Moreira,et al.  Predictable Embedded Multiprocessor System Design , 2004, SCOPES.

[21]  Daniel Kästner,et al.  Meeting Real-Time Requirements with Multi-core Processors , 2012, SAFECOMP Workshops.

[22]  Xavier Leroy,et al.  Mechanized Semantics for the Clight Subset of the C Language , 2009, Journal of Automated Reasoning.

[23]  Michael Norrish,et al.  Deterministic Expressions in C , 1999, ESOP.