PEARL-Rundschau, Heft 1, Band 3, April 1982 29

The Portable PEARL Programming System of WERUM

Dr. Hans Windauer

1. lmplemented Language Features Statements Values of reference variables and character string The implemented subset contains Basic PEARL slices at the left side of assignments (DIN 66 253, Part 1) and in addition the following language (e.g. STRING.CHAR (J) := 'N' ; ) features of Full PEARL (DIN 66 253, Part 2). The schedule of an activate statement may be Data Types combined with a frequence and/or AFTER duration REF (e.g. WI--EN interrupt AFTER duration ALL duration DUR.ING duration User defined types ( TYPE ) ACTIVATE task;) BOLT SUSPEND for other tasks Arrays with elements of type SEMA, BOL T, REF, CONTINUE with priority change user defined DATION, STRUCT, user defined type (TYPE) Lists of SEMA variables after REQUEST and RELEASE Arrays with more than 3 dimensions BOLT statements ENTER, LEAVE, RESERVE, Arrays with lower bounds ~ l FREE Structures with components of type array, STRUCT, Lists of BOLT variables in bolt statements REF, user defined type ( TYPE ) TRIGGER statement. B2 bit strings. Expressions Declarations, Specifications, Definitions Slices of character strings, variable slices of strings Modules may be identified (e.g. MODULE ( TEST ) ) (e.g. X:= INPUT.BIT ( I: I + 3); Global attribute with module identifier (e.g. . •• OUTPUT.CHAR (J) := STRING.CHAR (K);) GLOBAL ( TEST ) ) Dereferenciation ( CONT ) Definition of new data types (TYPE) Conditional expression Declaration of new operators (OPERATOR) with (e.g. A := IF B

Objects of type REF, STRUCT and user defined Close parameter CAN, PRM. type ( TYPE ) may be results of function proce­ dures System Division Arbitrary sequence of connections Lang forms of INIT and IDENT : INITIAL , IDENTICAL. Inverse notation of connections 30 PEARL-Rundschau, Heft 1, Band 3, April 1982

Identifier and / step possible after * in connection points. PEARL - front end and The subset characterized here is implemented completely - code generator in the (portable) compiler of WERUM. There can be in GBLl code restrictions in the various implementations of the run time system an some target computers by reasons of size. E.g., signal handling and file handling are restricted GBLl an Siemens 404/3 (64 KB). compiler front end 2. Olaracterization of the Compiler Technology

The portable PEARL compiler of WERUM consists PEARL compiler of an analytic part ("front end") translating PEARL - front end and programs to the computer independent intermediate - code generator language ILl, and a code generating part ("code gene­ in !Ll code rator") transforming PEARL programs from their ILl representation to target code (normally assembler or BRF, i.e. binary relocatable format). The front end is code generator computer independent and therefore programmed only once; the computer dependent code generators have to be developed for any type of computer where PEARL PEARL compiler programs are to be executed. - front end and - code generator PEARL in target code

Therefore, the PEARL compiler can be implemented an PEARL compiler target computers not having a PL/I compiler. front end Of course PEARL specific run time routines and functions have to be implemented too an the target computer in order to execute PEARL programs there.

Ill The PEARL compiler can be also used for cross compilation : by reason of the characterized compiler technology it can be installed on every computer having a code generator or a PL/I compi!er able to translate GBLl programs, e.g. IBM code generator 1 r:ode generator n or Siemens 7.760.

In addition the PEARL compiler can be transported to FORTRAN or PASCAL computers via a transformer from target code target code ILl to ANSI-FORTRAN or PASCAL in order to work for computer 1 computern this FORTRAN or PASCAL computer or tobe used there as cross compiler for other target computers.

The front end and the code generators are programmed 3. Existing Components of the PEARL Programming System in GBLl, a proper subset of PL/I. GBLl programs can also be translated to ILl by a front end GBLl- ILl. By means The portable PEARL programming system of WERUM consists of this front end and the corresponding code generator of the following components: the PEARL compiler front end and the code generator Compiler (front end and code generator) itself are translated to the target code (assembler or BRF) Kernel of the PEARL operating system of the target computer. Run time package for binary and process I/O This compilation is normally performed an one of the Run time package for formatted I/O production computers of WER UM where the GBL 1 compiler Symbolic debug system is implemented (Siemens 330 and NORD 10 S). Real time data base system. PEARL-Rundschau, Heft 1, Band 3, April 1982 31

Up to now the run time routines for PEARL specific more than one address calculation for identical arithmetics, operators for bit and character strings, objects. procedure organisation, array handling etc. were implemen­ Common sub-expressions are calculated only once. ted computer dependent. No index calculation at run time for fixed array indices. In case of HP 1000 a portable PEARL specific linker was implemented by the Technical University of Berlin in order The compiler is programmed in GBLl, a proper PL/I to check the interfaces between the modules of the PEARL subset. program.

Besides this, standard components of the target computer 3.2 Kernel of the Operating System are used. WERUM has developed a portable kerne! of a PEARL 3.1 Compiler operating system, called BAPAS-K, for the PEARL spe­ cific organisation and_ execution of tasks, their synchroni­ The PEARL compiler translates PEARL programs to sation and process I/0. BAPAS-K is programmed computer assembler or BRF. Because of its modular structure it independently in GBLl; therefore this kerne! can be only needs a segment of 50 KB to run; therefore it can transported automatically to the target computer where operate on small computers. In spite of this it is able to ;ts open interfaces are closed by hand. translate "arbitrary" big programs. BAPAS-K can be added to an existing hast operating The handling of the various compiler parameters system; it can also operate without any hast operating corresponds to the handling of the other of system. this computer.

Beside other functions, these parameter can be used to produce listings of the source program and of the 3.3 Run Time Package for Binary 1/0 translation result. In the assembler listing or BRF Usting references to the corresponding source lines are included. The run time package BAPAS-FILE contains all run In addition the compiler produces a cross reference !ist time routines necessary for the PEARL specific organi­ of all objects of the program showing their source lines sation of files and execution of READ and WRITE state­ of definition and use. ments. The interface of these computer independent, By compiler parameter index checking and reference portable routines to the target computer consists of checking may be switched on or off. suitable control blocks and driver calls.

The compiler analyses programs thoroughly and exactly. BAPAS-FILE is programmed in PEARL; therefore it The error messages consist of a text together with a can be transported automatically by the PEARL com­ reference to the source line causing the error. piler to target computers.

A preprocessor allows to include program pieces from text files (%INCLUDE) and to compile conditionally (%IF). 3.4 Run Time Package for Formatted I/0 The evaluation of the system parts of PEARL programs is driven by a so-called configuration !ist describing all Analogously to BAPAS-FILE the run time package BAPAS-FORMEA contains all computer independent configuration possibilities of the target computer. If run time routines necessary to execute PUT and GET these possibilities are to be extended, e.g. when adding statements according to the PEARL semantics. a new peripheral device, this configuration can be adapted easily by the user himself. The compiler reads BAPAS-FORMEA is programmed in PEARL; therefore the configuration dynamically for any compilation; this it can be transported automatically by the PEARL com­ is necessary in case of several cross compilations for piler to target computers. different target configurations. 3.5 Symbolic Debug System On request an optimizing version of the compiler is available performing the following optimizations when The symbolic debug system allows to test interactively setting the corresponding parameter: PEARL programs by use of PEARL like commands on Addresses of components of structures and referenced hast and target computers. It is programmed portable objects are kept as lang as possible in order to avoid in GBLl and PEARL. 32 PEARL-Rundschau, Heft 1, Band 3, April 1982

Version 1 for Small Target Computers 3.6 Open Real Time Data Base System

The first version offers the following possibilities an In order to support the use of PEARL in automation PEARL level: systems with data base oriented problems WERUM has Une trace developed the open real time data base system BAPAS-DB Breakpoints at lines allowing PEARL tasks and users (via terminal) to access Display of values of variables. common data concurrently. Important features of BAPAS-DB are: This version is already implemented an HP 3000, Interactive Data Description Language DDL for NORD 10/100 and Siemens 330. the data base administrator.

Version 2 for Medium Target and Hast Computers Interactive Query Language QL for users.

The second version offers the following possibilities Data Manipulation Language DML to access the an PEARL level: data base in PEARL tasks independently of the chosen access strategies. Une, labe! and call trace Breakpoints at Concurrent access by users and PEARL tasks with - Unes and labels implicit synchronisation an record level.

- Entries and exits of tasks and procedures Different data sets may be accessed by different Display and change of values of variables access strategies. Display and change of states of tasks, semaphores Access strategies can be exchanged or added without and bolts. changing the interfaces·to DDL, QL and DML. This version can be installed an hast target computers (The system is open.) with 128 KB and more. When being installed an a hast By reasons of these properties BAPAS-DB can be used computer the PEARL operating system of the target very flexible in automizing technical processes or it can computer and the time scale are simulated (by means be adapted to meet special requirements in parallel to of BAPAS-K) in order to handle tasks in the right the production of the application . sequence.

Version 2 is already implemented an HP 3000, DDL, QL and DML offer the following functions: NORD 10/100 and Siemens 330. Data Description Language DDL

Data Base Level Version 3 for Hast Computers - Creation and deletion of data bases The third version has been developed for hast computers. - Definition, modification and deletion of access In addition to version 2 it contains the following aids: rights - Definition, modification and deletion of admini­ Simulation of the run time behaviour of the target stration data computer an statement level Data Set Level Simulation of the I/O of the target computer by - Creation and deletion of data sets means of - Definition of the structure of the records of Dialogue with the user a data set - Anti tasks - Definition, modification and deletion of access - Files with test data rights

Breakpoints at Access Strategies Time events (analog to PEARL schedules) Introduction of new access strategies - Interrupts Attaching access strategies to data sets. - I/O statements

Deadlock analysis Query Language QL

Interrupt statements. Searching records satisfying given conditions which can be complex logical combinations of all components Version 3 is already implemented an HP 3000, NORD 10 of the records. and Siemens 330. PEARL-Rundschau, Heft 1, Band 3, April 1982 33

In this sense BAPAS-DB is a relational data base 5. Computers where PEARL Programs Can Be Executed system. The compiled PEARL programs can be executed on the Output of found records to terminal, printer or data following compufers: sets.

Update of records. Hewlett-Packard HP 1000 Hewlett-Packard HP 3000 Deletion of records. Intel 8086 Insertion of new records. Norsk Data NORD 10 S and NORD 100 RDC (Really Distributed Computer Contra! System Data Manipulation Language DML of the Fraunhofer Institute IITB, Karlsruhe)

Specification of data sets of the data base. Siemens 310 Siemens 330 Searching records satisfying given conditions which Siemens R 30 can be complex logical combinations of all components Siemens 404/3 of the records.

Use and update of found records. The following table shows the variant possibilities of Deletion of found records. installations. In this table, x means that this version is insta!led, and o means that this version can be installed Insertion of new ,·ecords. in short time. By standard, BAPAS-DB contains access strategies for sequential (UFO, FIFO) and direct access (Hash, B*­ Compilation Tree) together with functions for recovery and chaining Siemens 404/3 X data sets. lt is programmed portable in GBLl and PEARL. Siemens 7.760 0 0 0 0 X X X X

Installations have been made on NORD 10, Siemens 330 Siemens R 30 0 0 X 0 X X X X and Siemens R 30. Siemens 330 X X X X X X X X X

The development of BAPAS-DB has been sponsored by Siemens 310 X X the German Ministry for Research and Development NORD 10/100 0 0 0 X 0 0 0 0 wi thin the projects PDV /PFT of Kernforschungszentrum HP 3000 X X 0 0 0 0 0 0 Karlsruhe GmbH. HP 1000 X Amdahl 470 0 0 0 0 0 0 0 0

Execution

4. Computers where PEARL Programs Can Be Translated

I'\ 0 0 0 0 0 I'\ :;;:- The PEARL cornpiler is imple'Tlented on the following ..._...... I'\ 0 \D 0 I'\ I'\ D:'.'. -

Siemens 404/3. 6. Conditions

The implementation for 6.1 Form of Delivery Intel 8086 The programming system can be delivered partially or is in preparation. The compiler can be transported to at whole on magnetic disk, tape or floppy disk in the PL/I, FORTRAN and PASCAL computers without producing form generated by the code generator, FORTRAN, a new code generator. PASCAL or PL/I compiler. Sources and technical documen­ Number of installations: more than 25. tation can be delivered on request. 34 PEARL-Rundschau, Heft 1, Band 3, April 1982

6.2 Training, Documentation Intel 8086 : IITB, Karlsruhe: Process control.

NORD 100: Halden Reactor Project, Halden, : The implemented PEARL subset is described in Disturbance analysis system, re!iability PEARL Language Reference Manual investigations. Reg. FB 141/8008. WERUM, Lueneburg. Technical University of Braunschweig: This manual is also published as book: Contra! of a data base machine.

Wulf Werum, Hans Windauer NORD 10 S: WERUM, Lueneburg: Development of systems software. Introduction to PEARL Process and Experiment Automation RDC: IITB, Karlsruhe: Process control, Rea!time Language programming of industrial robot systems. Description with Examples Thyssen AG, Duisburg: Process control Braunschweig: Vieweg 1982.XI, 183 S. in steel factories. ISBN 3-528-03590-0. Siemens 310: IITB, Karlsruhe: Development of process control software. General or computer dependent user manuals and training courses are available on request. Siemens 330: IITB, Karlsruhe: Cross compilation for RDC. 6.3 Guarantee, Maintenance WERUM, Lueneburg: Development of systems software and process control The guarantee time is one year after acceptance. software. Afterwards a maintenance contract is offered containing Siemens R 30 : IITB, Karlsruhe: Development of process fast removing of errors and deli very of re!eases. control software, implementation of a software engineering environment for process control engineers. 7. References Siemens 404/3: Erprobungsstelle 71 der Bundeswehr, Amdahl 470/6: GRS, Garching: Safety related analysis. Eckernförde.

HP 1000: Technical University of Berlin: Process DFVLR, Oberpfaffenhofen: Experiment and experiment automation. automation.

HP 3000: IRT, Munich: Development of software Siemens 7.760: IITB, Karlsruhe: Cross compilation for for broadcasting / television purposes. RDC.