
Shared Data Types for OSRA and TASTE using Modern C++ Jan Sommer Andreas Gerndt Daniel Lüdtke Institute for Software Technology Institute for Software Technology Institute for Software Technology DLR (German Aerospace Center) DLR (German Aerospace Center) DLR (German Aerospace Center) Lilienthalplatz 7, 38108 Braunschweig Lilienthalplatz 7, 38108 Braunschweig Lilienthalplatz 7, 38108 Braunschweig [email protected] Universität Bremen [email protected] Bibliothekstraße 5, 28359 Bremen [email protected] Abstract—The European Space Agency (ESA) currently pro­ on­board software. At the same time, it leaves the concrete vides two tools for the modeling of on­board software: The Assert implementation of the code generators to the entity using Set of Tools for Engineering (TASTE) and the On­Board Software OSRA. TASTE, on the other hand, provides a more generic Reference Architecture (OSRA). For data type modeling, TASTE uses the standardized Ab­ framework, includes code generators for the C and Ada lan­ stract Syntax Notation One (ASN.1), while OSRA provides an guages, and has been also applied in robotics applications [3]. internal eCore­based data type representation. Unfortunately, the Unfortunately, the interworking between the two frameworks interworking between the two frameworks lacks a mechanism to lacks a mechanism to exchange data easily without duplicating exchange data easily without duplicating the data type informa­ the data type information. Our goal is to eliminate this tion. In this work, we present our approach for the exchange of problem and use the same data type descriptions across both data types and data values between software developed with frameworks and also have a compatible binary representation both tools. We show our additions to the OSRA infrastructure for the data types to allow seamless data exchange between enabling the exchange of data types between OSRA and TASTE applications developed using TASTE or OSRA. based on the same data type descriptions in ASN.1. This includes In this paper, we first have a short comparison between the complementing the OSRA editor with the ability to read and write ASN.1 data type descriptions and to specify the data type existing data type definition methods in OSRA and TASTE encodings in TASTE’s ASN.1 Control Notation. in Section II. In the following section, we present how we Our previous implementation of the ASN.1 data types in Mod­ integrated support for ASN.1 and ACN to the OSRA model ern C++ has been extended with a prototypical implementation editor. In Section IV, we give a short overview of the data type for the serialization of the data types compatible with TASTE’s system we developed previously [4] and which will be the ACN encoded types. As for the data types themselves, C++ metaprogramming foundation for the encoding infrastructure. Section V presents techniques have been used for the encoder. This allows us to some of the concepts and implementation details behind our keep the code generators simple and maintainable. Some early new ACN encoding prototype. In Section VI we discuss the results on the exchange of data between OSRA, enabled with current state of our prototype and its achieved results. Finally our prototype generator, and the TASTE framework with its own ASN.1 compiler are presented and discussed. we give our conclusions and ideas about the future direction of our work in Section VII. I. INTRODUCTION The demand for more complex on­board functionalities for II. DATA TYPE DEFINITION IN OSRA AND TASTE future spacecraft continues to rise, increasing the burden on In complex software projects, data is exchanged by a often small software teams. To handle such a complexity, plethora of software modules, potentially developed by dif­ model­driven methodologies can help to capture the overall ferent software teams. To ensure safe data exchange inside a architecture and design of the software. In a later step, they single as well as across many different modules, essentially also allow auto­generating source code and documentation three basic problems need to be solved: First, there has to be a artifacts from the model, thereby relieving software developers common source defining the data types, ideally with the option from monotonous tasks. to define constraints. Secondly, there needs to be some way In order to support model­based software development, to determine whether a value is valid or not. Finally, a shared the European Space Agency (ESA) provides The Assert Set understanding about how to encode values of these data types of Tools for Engineering (TASTE) [1] and the On­Board for exchange across modules or even devices is necessary. Software Reference Architecture (OSRA) [2]. Both share TASTE solves the first problem by describing its data types some common design concepts like separation of concerns, through the programming language agnostic Abstract Syntax component­based modeling and graphical tooling for the de­ Notation One (ASN.1) notation. The second one is addressed sign tasks. OSRA targets mostly the design of spacecraft by generating test routines for validity checks during runtime. The last problem is solved by implementing encoding rules <<Float>> <<unsigned Integer>> <<Structured>> of ASN.1 or by using a custom description for the encoding MyFloat MyInteger MyStruct of data types using TASTE’s own ASN.1 Control Notation fieldBool:MyBoolean (ACN). <<Constrained MyFloat>> fieldEnum:Color ConstraintFloat <<signed Integer>> OSRA provides mainly its metamodel, the Space Compo­ SignedInteger maxBound := 5.0 <<Array Color>> nent Model (SCM), and a corresponding editor which also ColorArray nbOfElements := 20 provides a modeling workflow for the user. Of the three <<Constrained MyInteger>> ConstraintInt <<Alias MyInteger>> mentioned problems, OSRA currently solves only the first UnsignedInteger minBound := 0 <<Boolean>> problem through its graphical data type editor. We only present maxBound := 10 MyBoolean a short summary of OSRA’s type modeling system here. A more in­depth analysis was carried out by us in [4]. <<Union : >> <<Enumeration>> MyUnion Color <<Constant ConstraintInt>> The data type part of the OSRA metamodel has a complex fieldBool : MyBoolean blue constant class hierarchy with several layers of abstract classes, which fieldInt : ConstraintInt red value := 6 are used in other parts of the metamodel to refer to generic fielEnum : Color green types. It provides common numerical metatypes for integer and Fig. 1. Example of OSRA data types modeled in the SCM editor with simple numerical types, constrainted numerical types, a structured type and an array floating point numbers and also allows to constrain the value type. space of those types. Other supported elementary metatypes include representations for boolean types, enumerations, and fixed point values. The OSRA metamodel also allows the for that purpose. Within the frame of the TASTE project, modeling of several kinds of array and string types as well ESA already evaluated different programming language in­ as common structured and union types. dependent data type notations and decided to use ASN.1 [1]. For every type definition, it is also possible to instantiate a TASTE only selected a subset of ASN.1 which provides a constant of that type, which will be available for further use reasonable feature set for space applications where type sizes in the model. and value sets must be known at compile­time. This reduced Additionally, there are two special metatypes available: the feature set also means less complexity in the necessary ASN.1 AliasType that allows to declare a new type with the same grammar. By adopting this approach for OSRA as well, only features as a reference type, but with a new name; and the OSRA needs to be complemented with an additional ASN.1 ExternalType that allows to register data types which have infrastructure. No changes are necessary for TASTE. not been defined through the OSRA model itself. For the latter, Within the ESA funded PaTaS activity [6], an intial ASN.1 the OSRA model cannot determine any properties but relies grammar implementation in Xtext was already started. It on the external model to check validity. It only knows the became a starting point to add an ASN.1 editor to OSRA. registered types’ names which is enough to use them like Like OSRA, Xtext is also based on the Eclipse Modeling native types throughout the model (for example for interface Framework. Therefore, the ASN.1 grammar can be tightly in­ definitions). tegrated with OSRA. The bi­directional implementation works The OSRA editor provides a graphical interface to define as follows: For all data types, which were created with the concrete types and constants from the described metatypes. graphical model editor of OSRA, a corresponding type in Fig. 1 shows an example of such a data type diagram, which ASN.1 textual notation is generated using Xtend code genera­ looks similar to data type diagrams in UML [5]. tors [7]. For all data types which have been manually written For every type or constant defined in such a way, a and for which an ASN.1 representation exists, a corresponding corresponding element is added to the underlying eCore model ExternalType is registered in the OSRA model. In this way, including all the range properties and base type references. all types are available in the OSRA model and can be used in, e.g., interface modeling. All types have also a representation in III. INTRODUCING OSRA TO ASN.1 AND ACN ASN.1, which means they can be shared with external tools, Although graphical modeling of data types is intuitive, it can such as TASTE. This work was carried out as part of [4] become difficult to understand and maintain when complex and allowed the exchange of data types between OSRA and structured types and type hierarchies have to be modeled. TASTE. Furthermore, the data types are, by default, only available in The upper part of Fig.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-