Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Category:Eclipse UML Generators/Specification/EmbeddedCGenerator/Contribution"

m (Updated image)
m (Detailed Specification)
Line 121: Line 121:
 
* void
 
* void
  
[[File:https://wiki.eclipse.org/File:Primitive_Types.JPEG]]
+
[[File:https://wiki.eclipse.org/File:File-Primitive_Types.JPEG]]
  
 
== Backward Compatibility and Migration Paths  ==
 
== Backward Compatibility and Migration Paths  ==

Revision as of 10:09, 25 March 2015

Evolution Specification: UML Generator for Embedded C

Current status is DRAFT

Preamble

The traditional text-based approach of embedded software design is not efficient enough to handle such advanced/complex systems. There is a need for modeling C components in order to avoid repetitive and heavy low level processes. As initial contribution to the Eclipse UML generators project, Spacebel proposes development methods and a ANSI C code generator for Embedded Software.

Relevant tickets:

  • Bug TBD - Generation of C code for Embedded Systems

Introduction

Major provider of IT systems on-board satellites and space vehicles, Spacebel cumulates more than one century of experience in On Board Software. The expertise encompasses the whole flight software development lifecycle, from the early concept studies, including the analysis and the specification over the architecture, the design and the development, to the validation and the final integration of these critical software systems.

When developing embedded systems, software designers are squeezed by two trends — shrinking development cycles and growing design intricacy. The divide-and-conquer strategy for developing these complex systems means coordinating the resources of people with expertise in a wide range of disciplines. Quickly, it appears that the text-based approach of embedded system design is not efficient to manage such complex systems. There is a need for modeling C components in order to avoid repetitive and heavy low level processes.

As indicated in the title, the feature is able to generate C code from UML models. What distinguishes Embedded C from regular C generator are:

  • repeatable and reliable generation of code
  • preservation of the implementation fields
  • highly documented detailed design
  • compliance to MISRA guidelines of C language in critical systems
  • traceability of the specification (requirements) in the sources

Modeling a complete embedded software written in C with UML is not straightforward. Indeed, the UML standard is sometimes too generic with a high level of abstraction. In order to mitigate the abstraction of UML, the generator comes up with an UML profile: the Embedded_C profile.

Detailed Specification

This chapter presents a detailed specification of the Generator UML to Embedded C. The following lines specify the functional & non-functional requirements that shall be implemented by the generator and the UML profile 'Embedded_C'.

Profile specification

UML is so generic and sometimes so abstract that it is really hard to map the C language. In order to overcome this problem, the specification of the C language is described with the help of stereotypes. Indeed, the UML standard often needs extensions to specify entities that only exist in C.

Therefore, UML stereotypes constitute a nice way to extend the UML standard. A stereotype is defined either as an extension of a UML base meta-class or as a specialization of an existing stereotype. The extension relationship of UML is not an association but a kind of association directed from the stereotype to the extended meta-class. Consequently, the metadata conveyed by the associated the attributes of the stereotype are associated to the extended meta-class in a transparent manner for the meta-class itself. This allows profiles owning the stereotypes to be applied and removed dynamically without modifying the underlying models — a fundamental feature of the profile mechanism.

Therefore, a minimum number of stereotypes must be defined.

REQ-PROF-002: The profile Embedded_C shall provide the following stereotypes:

  • Array
  • Asm
  • Attribute
  • Constant
  • Inline
  • Pointer
  • Requirement
  • Singleton
  • Object
  • Struct
  • Typedef
  • Union
  • UsesStaticMethods
  • Value
  • Volatile

REQ-PROF-002: The stereotype 'Array' shall be applied on any properties. It shall have the following attribute:

  • The ‘multiplicity’ of the array shall be specified. The type of the attribute shall be 'String' meaning that it can be an alphanumeric value.

REQ-PROF-003: The stereotype 'Asm' shall be applied on any operations.

REQ-PROF-004: The stereotype 'Attribute' shall be applied on any properties or datatypes. It shall have the following attribute:

  • The 'attribute' of the property or datatype shall be specified (aligned, packed, ...)

REQ-PROF-005: The stereotype 'Constant' shall be applied on any literals of a given Enumeration. It shall have the following attributes:

  • The ‘declaration’ of the constant shall be specified or leave empty. The type of the attribute is String meaning that it can be an alphanumeric value.
  • The ‘condition’ of the constant shall be specified or leave at ‘None’. In case ifndef or ifdef is selected, the definition of the constant will be conditional with respect to its name existence.

REQ-PROF-003: The stereotype 'Inline' shall be applied on any operations.

  • The ‘condition’ of the inline operation shall be specified or leave at ‘None’. In case ifndef or ifdef is selected, the definition of the inline operation will be conditional with respect to a ‘value’.
  • The ‘value’ (of the condition) of the inline operation shall be specified or leave empty. The attribute ‘Value’ only takes effect when the attribute ‘condition’ is different than ‘None’ (e.g. condition = 'ifdef, value = 'DEBUGGING).

REQ-PROF-005: The stereotype 'Pointer' shall be applied on any TypedElement. It shall have the following attributes:

  • The pointer kind shall be specified. The pointer can be simple, double or none. The pointer may also be oriented constant data or constant pointer

REQ-PROF-005: The stereotype 'Requirement' shall be applied on any Constraint. It shall have the following attributes:

  • The attribute ‘parents’ shall make the traceability between requirement baseline and technical specification. The value of the ‘parents’ can be empty or it can be a list of requirement IDs
  • The user must however specify how the requirement is verified. Several methods of verification shall be proposed. By default, the verification by test shall be selected.

REQ-PROF-00: The stereotype 'Singleton' shall be applied on any Class.

REQ-PROF-00: The stereotype 'Object' shall be applied on any Class.

REQ-PROF-00: The stereotype 'Struct' shall be applied on any TypedElement.

REQ-PROF-005: The stereotype 'Typedef' shall be applied on any DataType or Enumeration. It shall have the following attributes:

  • The attribute ‘MappedType’ shall be specified. The attribute must receive the existing type to which it is mapped.

In case of Enumeration, if the attribute ‘MappedType’ is specified, the default type of the Enumeration is redefined by an specified mapped type. Otherwise, the Enumeration itself is seen as a type.

REQ-PROF-00: The stereotype 'Union' shall be applied on any DataType.

REQ-PROF-00: The stereotype 'UsesStaticMethods' shall be applied on any Property.

REQ-PROF-005: The stereotype 'Value' shall be applied on any EnumerationLiteral. It shall have the following attributes:

  • The attribute ‘Value’ shall be specified. It specifies the value of the Enumeration Literal. It can be an alphanumeric value.

REQ-PROF-00: The stereotype 'Volatile' shall be applied on any Property.

In addition to the stereotypes, the profile should also own the basic types of the C language.

REQ-PROF-00x: The profile Embedded_C shall provide the primitive types of the C language:

  • char
  • signed char
  • unsigned char
  • int
  • signed int
  • unsigned int
  • short
  • signed short
  • unsigned short
  • long
  • signed long
  • unsigned long
  • long long
  • signed long long
  • unsigned long long
  • float
  • double
  • void

File:Https://wiki.eclipse.org/File:File-Primitive Types.JPEG

Backward Compatibility and Migration Paths

Metamodel Changes

This evolution does not change any meta-models.

API Changes

This evolution does not change any API.

User Interface Changes

For consistency, the Embedded C generator should stick with the existing generation properties and menus (ref. User Interface Consistency).

New entries for Embedded C generator shall just be added to the existing infrastructure.

Documentation Changes

User manuals should integrate the user interfaces updates for both Embedded_C profile and the generator.

Tests and Non-regression strategy

TBW

Implementation choices and tradeoffs

TBW

This category currently contains no pages or media.

Back to the top