Execution Machine for Synchronous Languages

Execution Machine for Synchronous Languages

EXECUTION MACHINE FOR SYNCHRONOUS LANGUAGES Charles ANDRÉ Hédi BOUFAÏED Laboratoire I3S, Université de Nice/CNRS 41, Bd Napoléon III 06041 NICE cedex, France [email protected] Tel: +33 497 258 257 Fax: +33 493 212 054 reactive and subject to real time constraints. Their ABSTRACT behavior should be fully predictable under any circumstances. So, there is a clear demand for Control-dominated systems, like controllers, are reactive • Well-adapted programming languages, systems often subject to real-time constraints. The • Powerful validation tools (tests and proofs), programming style adopted for these applications is rather • Efficient and dependable implementations. special: event- or interrupt-driven programs involving Reactivity (ability to respond to any significant stimulus) complex coordination. Imperative synchronous languages and real-time constraints (ability to respond in time) give like Esterel have been introduced to cope with these rise to difficult programming issues. applications. We have developed an environment to deal with control- Synchronous Programming dominated systems. The user expresses the expected The “synchronous languages”, introduced in the seminal behavior of the controller using a synchronous formalism. paper of Benveniste and Berry (1991), cope with these Given this description and a configuration (inputs, kinds of problems. The synchronous approach to reactive outputs, interaction policies, …), a dedicated “execution and real-time system programming offers several machine” is generated. advantages detailed in the Halbwachs’s book (1993): This paper presents the outline of this approach based on a • Multi-style programming: either declarative, or the synchronous paradigm, and explains the role and the imperative. architecture of the execution machine. • Textual (languages), graphical (various charts), or mixed descriptions. Keywords: synchronous programming, execution • Mathematical semantics based on the synchronous machine, control, implementation. hypotheses. If correct, a synchronous program or chart that fully NOMENCLATURE respects the synchronous hypotheses can be compiled into a semantically equivalent description written in a common We use Courier as the font for programs and program format called dc. The heart of a dc description is a set of objects. Boldface Courier font denotes file formats Boolean equations: Boolean expressions trigger execution and extensions. of classical data processing. Industrial compilers and development platforms are now available. The interactive INTRODUCTION simulation with source-level debugging is an efficient way to check reactions to various scenarios. Because of their Critical control systems such as avionics, life monitoring, formally defined semantics, synchronous programs lend and automatic control applications are becoming themselves to formal proofs of properties. Safety increasingly complex. Their implementations have properties, which are often critical, are the simplest to evolved from mechanical devices, to electronic prove, even on real-world applications (intensive use of components and then to embedded computer systems. BDD (Binary Decision Diagrams) computations on Designing such an application is now relevant to Boolean automata). “Software Engineering”. These systems are highly Several different implementations can be derived from imperative synchronous programming style. This example the Boolean equation system associated with a points out what is part of a synchronous program and what synchronous program. In this paper, we focus on has to be provided. The issue of “lasting actions” is also “software implementations” (i.e., using a classical evoked. The second section is devoted to the architecture language like C, C++, …). and the role of the execution machine. Its implementation is described in the third section. Finally, we illustrate the Input / Output Handling design of a controller for an ATM (Automatic Teller The above mentioned solutions apply well to the “heart”of Machine) using our approach and available tools. reactive real-time systems (i.e., control and data processing). Few tools in synchronous development SYNCHRONOUS PROGRAMMING environments deal with the actual interactions with the external world. And yet, this is a key point in controller Synchronous Hypotheses design. Programs that manage (real-time) inputs/outputs are known to be various, specific, hardware-dependent, A synchronous program expresses the “reaction” that must and of little reusability. ROOM methodology introduced be done in response to stimuli. In real-world systems, because of concurrency, reactions may result in intricate by Selic and al. (1994) and more recently “Real Time UML” proposed by Douglass (1998), advocate the use of overlapping actions. The synchronous approach considers objects in real-time system programming. Encapsulation simplified interactions (synchronous hypotheses): of data and behavior leads to a more intuitive and • Inputs and outputs are manipulated as ``vectors'' of powerful abstraction of acquisition and actuation. We signals, i.e., their status and value do not change have partially adopted this point of view. during a reaction. • Computations take no time (i.e., internal computa- Execution Machine tions are 0-duration). A (real-time) controller is both a “reactive kernel” and an • Information exchanges rely on instantaneous broad- “interface driver”. An effective, efficient, and dependable casting. cooperation between the reactive code and the From the programmer point of view, a synchronous environment to be controlled needs special supports. We program instantaneously reacts to external events. Another call “execution machine” for a synchronous program an noteworthy feature introduced by the Esterel language is executable architecture that supports this cooperation. the extensive use of “preemption”, which is a first class The main functionalities of an execution machine are concept in this language. 1. Acquisition from sensors and construction of the Thanks to the simplifying hypotheses underlying the input image of the process to be controlled, synchronous paradigm, the parallel composition defined in 2. Execution of reactions specified by the synchronous a synchronous language is fully deterministic. Another program or chart, consequence is that sequence, concurrency, and pre- 3. Actuation from the output image generated by the emption are orthogonal concepts. They can be nested at reaction. any level, in any order. The resulting behavior is perfectly Of course, all these operations must be done in a timely defined. For all these reasons synchronous formalisms are manner, and the overall behavior must be consistent with very good in expressing complex reactive behaviors. the synchronous hypotheses. The programmer may choose either a declarative or an In this paper, we report on our experience in building imperative style. Which one to adopt is a matter of execution machines for controllers programmed in the convenience. Most reactive applications involve both data Esterel synchronous language. A detailed presentation of handling and control handling. Since our applications are this language and its environment, written by Berry control-dominated, in what follows, we adopt the impera- (1997), is available on the web. We propose a general, tive style. generic, and flexible architecture for execution machines. An Example of Control An object-oriented approach has been adopted. The underlying programming language is C++. The module below illustrates the Esterel programming The use of Esterel entails a fourth functionality for the style. This module is a control-loop. A program may be execution machine: the asynchronous task management. composed of many such modules and other modules that The reason is that Esterel introduces first class objects coordinate their activities. (tasks) for lasting actions (i.e., actions whose duration Control_loop applies a classical regulation algorithm cannot be considered as negligible). These tasks run (PID = Proportional-Integral-Differential) at each occur- concurrently with the synchronous control. rence of Sample. The regulation takes place as soon as Start occurs and is aborted by Stop. Paper Organization In a first section, we briefly comment the synchronous 1 module Control_loop: hypotheses. A simplified example of control illustrates the 2 type SigType; 3 function PID(SigType):SigType; This is a simplified view. Preemption makes the matter 4 input Start,Stop,Sample:SigType; more difficult to deal with. A task may be suspended or 5 output Cmd:SigType,RegON; aborted. For the synchronous program an aborted task no 6 await Start; longer exists. And yet, in the environment, the actual task 7 abort may still be running. It is the responsibility of the 8 every Sample do execution machine to ensure that the synchronous 9 emit Cmd(PID(?Sample)) program receives only consistent return signals. This 11 end every treatment must be transparent to the user. 11 || 12 sustain RegON EXECUTION MACHINE ARCHITECTURE 13 when Stop 14 end module Goals Due to the synchronous hypotheses, introduced in the Lines 2-5 constitute the declarative part, while lines 6-13 previous section, complex reactive behaviors can be express the behavior. At line 2, is a user- SigType expressed in clean and precise terms. This idealization of defined type, and (line 3) is a user-defined function. PID real-world systems is conceptually very useful. But, is this The type and the function body are not part of the abstract

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us