Modula-2In Embedded Systems
Total Page:16
File Type:pdf, Size:1020Kb
I Evaluating & Implementing Software Engineering . • Pressman, Roger S., Making Software Engineering Happen: A guide for instituting the technology, Prentice Hall, 1988. Pressman, Roger S., Software Engineering: A practitioner's approach, McGraw-Hili, 1987. MODULA-2IN J. Blank & M. J. Krijger, Software Engineering: Methods and techniques, Wiley-lnterscienc9. EMBEDDED SYSTEMS 1983. Yourdon, Edward, Managing the Structured Techniques: Strategies for Software Develop Christian Vetterli mentthe 1990s, Yourdon Press, 1988. HiwareAG Basel, Switzerland CASE Tools and Software Engineering Claude Vonlanthen Case, Albert F., Information Systems Development: PrinCiples of Software Engineering and HiwareAG object-oriented technology, Prentice-Hall, 1986. Basel, Switzerland Fisher, Alan S., object-oriented technology : Using Software Development Tools, Wiley, 1988. Christian Vetterli studied under Niklaus Wirth, writing his thesis on the object-oriented expandable document editor OPUS (Object-Oriented Gane, Chris, Computer-Aided Software Engineering: The methodologies, the products, the Publishing System) written in Modula 2. Dr. Vetterli is responsible for the future, Rapid Systems Development Inc., 1988. Modula-2 tool MacMETH (loader andlibraries for AppleMacintosh), libraries for Modula-2 development systems onIBM-RT(RISC),and thecode generator Humphrey, Watts, Managing the Software Process, Addison-Wesley, 1989. for the Modula-2 compiler. He is responsible for developing embedded systems software for Hiware. Marshall, George R., Systems Analysis and Design: Alternative Structured Approaches, Prentice-Hall, 1986. Claude Vonlanthen is responsible for applications software at Hiware. A graduate engineer from Eigenossische Technische Ilochschule, Zurich, McClure, Carma, CASE is Software Automation, Prentice Hall, 1988. Switzerland,Claude was responsible for developing a Modula-2 embedded system at a large machine factory before joining Hiware. McClure, Carma, The CASE Technical Report, Extended Intelligence Inc., 1988. Weaver, Audrey M., Using the Structured Techniques - A Case Study, Prentice-Hall, 1987. Copyright © 1991 by Foresite Systems Page 587 Page 586 Modula-2 in Embedded Systems 57 Fortran Algol 58 Dr. Christian Vetterli Claude Vonlanthen , 60 Algol 60 Lisp PART! I Cobol In the years 1977·1981 Prof. N. Wirth developed Modula-2 [1] as a further 62 member of the family of the Algol, Pascal and Modula progranlming languages APL (Fig. 1). "Whereas Pascal had been designed as a general purpose language and 64 , after implementation in 1970 has gained wide usage, Modula had emerged from Simula-l AIgol-W experiments in multiprograrruning and concentrated therefore on relevant aspects of ~ that field of application. 66 Basic t' ~ PL-l BCPL Simula ~7 In 1977, a research project with the goal of designing a computer system 68 ~# (hardware and software) in an integrated approach) was launched at the 1I1Stitut fur Algol 68 Infonnatik of the ETH ZUrich. This system (later to be caned Lilith [2]) \vas to be ~ ~ programnled in a single high-level language which therefore had to satisfy 70 B Fortran IV Pascal Prolog requirements of a high-level system design as well as those of low-level , programming of parts which interact closely with the given hardware. Modula-2 enlerged from careful design deliberations as a language which includes all aspects 72 C .-J of Pascal and extends them with the important module concept and with those of - Cone. mUltiprogramming. " 74 Pascal~ Some of the main features of Modula-2 are: Modula Mesa Euclid 76 ~ " " Fortran 77 • separate compilation of program modules, !' II~ • strong type checking, 78 • comprehensive runtime tests. ~ Modula-2 • structured data types, 80 Snlalltalk • dynamic data types, • nested program structures~ Ceder • procedure types, 82 • • the support of parallel processes (co-routines) and ~ • system-dependent language properties (low-level facilities). Ada 84 First of all, we turn our attention to the most important concept of Modula-2, the •• one which has also given the language its name - the modular concept. Then we 86 c++ ~, discuss briefly the other properties of Modula-2, especially with regard to ~ Modula..3 applications in Embedded Systems. Finally we present a approach of an operating Oberon system for distributed real-time applications and a related development method. 88 90 ! Oberon-2 Page 588 Programming Languages (based on lecture notes of Prof. N. Wirth and Prof. J. Gutkne.cht, ETH Ziirkh) Page 589 © 1991 by HIWARE A • Gundeldinge.rstrasse 432 • CH·4053 BasIc © 1991 by HIWARE AG - Gllndeldingerstrasse 432 ~ CH·4053 Basl~ d-.'. d_".d..-ol;' r Modula-2 in Embedded Systems 57 Fortran Algol 58 Dr. Christian Vetterli Claude Vonlanthen , 60 Algol 60 Lisp PART! I Cobol In the years 1977·1981 Prof. N. Wirth developed Modula-2 [1] as a further 62 member of the family of the Algol, Pascal and Modula progranlming languages APL (Fig. 1). "Whereas Pascal had been designed as a general purpose language and 64 , after implementation in 1970 has gained wide usage, Modula had emerged from Simula-l AIgol-W experiments in multiprograrruning and concentrated therefore on relevant aspects of ~ that field of application. 66 Basic t' ~ PL-l BCPL Simula ~7 In 1977, a research project with the goal of designing a computer system 68 ~# (hardware and software) in an integrated approach) was launched at the 1I1Stitut fur Algol 68 Infonnatik of the ETH ZUrich. This system (later to be caned Lilith [2]) \vas to be ~ ~ programnled in a single high-level language which therefore had to satisfy 70 B Fortran IV Pascal Prolog requirements of a high-level system design as well as those of low-level , programming of parts which interact closely with the given hardware. Modula-2 enlerged from careful design deliberations as a language which includes all aspects 72 C .-J of Pascal and extends them with the important module concept and with those of - Cone. mUltiprogramming. " 74 Pascal~ Some of the main features of Modula-2 are: Modula Mesa Euclid 76 ~ " " Fortran 77 • separate compilation of program modules, !' II~ • strong type checking, 78 • comprehensive runtime tests. ~ Modula-2 • structured data types, 80 Snlalltalk • dynamic data types, • nested program structures~ Ceder • procedure types, 82 • • the support of parallel processes (co-routines) and ~ • system-dependent language properties (low-level facilities). Ada 84 First of all, we turn our attention to the most important concept of Modula-2, the •• one which has also given the language its name - the modular concept. Then we 86 c++ ~, discuss briefly the other properties of Modula-2, especially with regard to ~ Modula..3 applications in Embedded Systems. Finally we present a approach of an operating Oberon system for distributed real-time applications and a related development method. 88 90 ! Oberon-2 Page 588 Programming Languages (based on lecture notes of Prof. N. Wirth and Prof. J. Gutkne.cht, ETH Ziirkh) Page 589 © 1991 by HIWARE A • Gundeldinge.rstrasse 432 • CH·4053 BasIc © 1991 by HIWARE AG - Gllndeldingerstrasse 432 ~ CH·4053 Basl~ d-.'. d_".d..-ol;' r The modular concept Modules in Modula-2 " The language Modula-2 supports the above-described model thanks to a strict The concept of the module has long been in use in the engineering field. \Ve find it separation of interface and implementation of a module. A distinction is made for example in the implementation of electronic devices where we find slide-in between the definition of the interface (definition modules) and the implementation modules which contain complete functional units. The advantages are obvious, the (implementation module). A module can export both procedures as well as types modules can be developed, produced, tested and even repaired as self-contained and variables, i.e. make them available to other modules. Each module, in tum, can units. The use of modules also enables substantially reduced costs because it is import objects from other modules. The defmition of the interface contains all the possible to refer to proved solutions for certain functions. procedures and data types which the module exports. Procedures are described by The same motivations which promoted the introduction of modules in the procedure head, type and variables are described by a declaration. When the engineering also apply in the field of software development. Because, today. defmition module is translated, a so-called symbol file is created which contains all software is no longer created by an elite group of programming wizards, but wit.~in the infonnation about the interface. The symbol file is used for the compilation of an industrial framework, it is absolutely essential to produce the software in a modules which use the interface. The implementation of the procedures listed in the properly structured and modularized fonn. interface takes place in the implementation module. It can be developed independently of the interface, but must comply with the specifications laid down in A certain amount of modularization is already to be found in most commonly the interface. This means in particular that it is very easy to prepare different used programming languages in the procedure. Procedures already enable a implementations for the same interface. Thus, machine-dependent pans of a larger problem to be subdivided into smaller part problems. The parameter mechanism program can also be readily combined in one place. This pennits simple extraction permits an exact specification of the interface for