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 (Generator specification)
m (Profile specification)
Line 39: Line 39:
 
For the sake of the Generator UML to Embedded C, a minimum number of stereotypes have been defined.
 
For the sake of the Generator UML to Embedded C, a minimum number of stereotypes have been defined.
  
'''REQ-PROF-001''': The profile Embedded_C shall provide the following stereotypes:
+
'''REQ-PROF-001''': The profile Embedded_C shall be identified under the ID 'org.eclipse.umlgen.gen.embedded.c.profile'.
 +
 
 +
'''REQ-PROF-002''': The profile Embedded_C shall provide the following stereotypes:
 
* Array
 
* Array
 
* Asm
 
* Asm
Line 56: Line 58:
 
* Volatile
 
* Volatile
  
'''REQ-PROF-002''': The stereotype 'Array' shall be applicable for any uml::Property. It shall have the following attribute:
+
'''REQ-PROF-003''': The stereotype 'Array' shall be applicable for any uml::Property. 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.
 
* The ‘multiplicity’ of the array shall be specified. The type of the attribute shall be 'String' meaning that it can be an alphanumeric value.
  
Line 62: Line 64:
  
  
'''REQ-PROF-003''': The stereotype 'Asm' shall be applicable for any uml::Operation.
+
'''REQ-PROF-004''': The stereotype 'Asm' shall be applicable for any uml::Operation.
  
 
[[Image:Stereotype_Asm.JPEG|thumb|center|250px]]
 
[[Image:Stereotype_Asm.JPEG|thumb|center|250px]]
  
  
'''REQ-PROF-004''': The stereotype 'Attribute' shall be applicable for any uml::Property or uml::Datatype. It shall have the following attribute:
+
'''REQ-PROF-005''': The stereotype 'Attribute' shall be applicable for any uml::Property or uml::Datatype. It shall have the following attribute:
 
* The 'attribute' of the property or datatype shall be specified (aligned, packed, ...).
 
* The 'attribute' of the property or datatype shall be specified (aligned, packed, ...).
  
Line 73: Line 75:
  
  
'''REQ-PROF-005''': The stereotype 'Constant' shall be applicable for any uml::EnumerationLiteral of a given uml::Enumeration. It shall have the following attributes:
+
'''REQ-PROF-006''': The stereotype 'Constant' shall be applicable for any uml::EnumerationLiteral of a given uml::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 ‘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.
 
* 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.
Line 80: Line 82:
  
  
'''REQ-PROF-006''': The stereotype 'Inline' shall be applicable for any uml::Operation.
+
'''REQ-PROF-007''': The stereotype 'Inline' shall be applicable for any uml::Operation.
 
* 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 ‘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).
 
* 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).
Line 87: Line 89:
  
  
'''REQ-PROF-007''': The stereotype 'Pointer' shall be applicable for any uml::TypedElement. It shall have the following attribute:
+
'''REQ-PROF-008''': The stereotype 'Pointer' shall be applicable for any uml::TypedElement. It shall have the following attribute:
 
* 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.
 
* 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.
  
Line 93: Line 95:
  
  
'''REQ-PROF-008''': The stereotype 'Requirement' shall be applicable for any uml::Constraint. It shall have the following attributes:
+
'''REQ-PROF-009''': The stereotype 'Requirement' shall be applicable for any uml::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 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.
 
* It shall possible to specify how the requirement is verified (Review, Inspection, Test, Analysis). By default, the verification by test shall be selected.
 
* It shall possible to specify how the requirement is verified (Review, Inspection, Test, Analysis). By default, the verification by test shall be selected.
Line 100: Line 102:
  
  
'''REQ-PROF-009''': The stereotype 'Singleton' shall be applicable for any uml::Class.  
+
'''REQ-PROF-010''': The stereotype 'Singleton' shall be applicable for any uml::Class.  
  
 
[[Image:Stereotype_Singleton.JPEG|thumb|center|250px]]
 
[[Image:Stereotype_Singleton.JPEG|thumb|center|250px]]
  
  
'''REQ-PROF-010''': The stereotype 'Object' shall be applicable for any uml::Class.  
+
'''REQ-PROF-011''': The stereotype 'Object' shall be applicable for any uml::Class.  
  
 
[[Image:Stereotype_Object.JPEG|thumb|center|250px]]
 
[[Image:Stereotype_Object.JPEG|thumb|center|250px]]
  
  
'''REQ-PROF-011''': The stereotype 'Struct' shall be applicable for any uml::TypedElement.  
+
'''REQ-PROF-012''': The stereotype 'Struct' shall be applicable for any uml::TypedElement.  
  
 
[[Image:Stereotype_Struct.JPEG|thumb|center|250px]]
 
[[Image:Stereotype_Struct.JPEG|thumb|center|250px]]
  
  
'''REQ-PROF-012''': The stereotype 'Typedef' shall be applicable for any uml::DataType or uml::Enumeration. It shall have the following attribute:
+
'''REQ-PROF-013''': The stereotype 'Typedef' shall be applicable for any uml::DataType or uml::Enumeration. It shall have the following attribute:
 
* The attribute ‘MappedType’ shall be specified. The attribute must receive the existing type to which it is mapped.  
 
* The attribute ‘MappedType’ shall be specified. The attribute must receive the existing type to which it is mapped.  
  
Line 123: Line 125:
  
  
'''REQ-PROF-013''': The stereotype 'Union' shall be applicable for any uml::DataType.  
+
'''REQ-PROF-014''': The stereotype 'Union' shall be applicable for any uml::DataType.  
  
 
[[Image:Stereotype_Union.JPEG|thumb|center|250px]]
 
[[Image:Stereotype_Union.JPEG|thumb|center|250px]]
  
  
'''REQ-PROF-014''': The stereotype 'UsesStaticMethods' shall be applicable for any uml::Property.
+
'''REQ-PROF-015''': The stereotype 'UsesStaticMethods' shall be applicable for any uml::Property.
  
 
[[Image:Stereotype_UsesStaticMethods.JPEG|thumb|center|250px]]
 
[[Image:Stereotype_UsesStaticMethods.JPEG|thumb|center|250px]]
  
  
'''REQ-PROF-015''': The stereotype 'Value' shall be applicable for any uml::EnumerationLiteral. It shall have the following attribute:
+
'''REQ-PROF-016''': The stereotype 'Value' shall be applicable for any uml::EnumerationLiteral. It shall have the following attribute:
 
* The attribute ‘Value’ shall be specified. It specifies the value of the Enumeration Literal. It can be an alphanumeric value.
 
* The attribute ‘Value’ shall be specified. It specifies the value of the Enumeration Literal. It can be an alphanumeric value.
  
Line 139: Line 141:
  
  
'''REQ-PROF-016''': The stereotype 'Volatile' shall be applicable for uml::Property.
+
'''REQ-PROF-017''': The stereotype 'Volatile' shall be applicable for uml::Property.
  
 
[[Image:Stereotype_Volatile.JPEG|thumb|center|250px]]
 
[[Image:Stereotype_Volatile.JPEG|thumb|center|250px]]
Line 146: Line 148:
 
In addition to the stereotypes, the profile should also own the basic types of the C language.
 
In addition to the stereotypes, the profile should also own the basic types of the C language.
  
'''REQ-PROF-017''': The profile Embedded_C shall provide the primitive types of the C language:  
+
'''REQ-PROF-018''': The profile Embedded_C shall provide the primitive types of the C language:  
  
 
[[Image:File-Primitive_Types.JPEG|thumb|center|250px]]
 
[[Image:File-Primitive_Types.JPEG|thumb|center|250px]]

Revision as of 11:51, 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 UML. In order to overcome this problem, the entities of the C language are described with the help of UML 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.

For the sake of the Generator UML to Embedded C, a minimum number of stereotypes have been defined.

REQ-PROF-001: The profile Embedded_C shall be identified under the ID 'org.eclipse.umlgen.gen.embedded.c.profile'.

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-003: The stereotype 'Array' shall be applicable for any uml::Property. 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.
Stereotype Array.JPEG


REQ-PROF-004: The stereotype 'Asm' shall be applicable for any uml::Operation.

Stereotype Asm.JPEG


REQ-PROF-005: The stereotype 'Attribute' shall be applicable for any uml::Property or uml::Datatype. It shall have the following attribute:

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


REQ-PROF-006: The stereotype 'Constant' shall be applicable for any uml::EnumerationLiteral of a given uml::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.
Stereotype Constant.JPEG


REQ-PROF-007: The stereotype 'Inline' shall be applicable for any uml::Operation.

  • 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).
Stereotype Inline.JPEG


REQ-PROF-008: The stereotype 'Pointer' shall be applicable for any uml::TypedElement. It shall have the following attribute:

  • 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.
Stereotype Pointer.JPEG


REQ-PROF-009: The stereotype 'Requirement' shall be applicable for any uml::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.
  • It shall possible to specify how the requirement is verified (Review, Inspection, Test, Analysis). By default, the verification by test shall be selected.
Stereotype Requirement.JPEG


REQ-PROF-010: The stereotype 'Singleton' shall be applicable for any uml::Class.

Stereotype Singleton.JPEG


REQ-PROF-011: The stereotype 'Object' shall be applicable for any uml::Class.

Stereotype Object.JPEG


REQ-PROF-012: The stereotype 'Struct' shall be applicable for any uml::TypedElement.

Stereotype Struct.JPEG


REQ-PROF-013: The stereotype 'Typedef' shall be applicable for any uml::DataType or uml::Enumeration. It shall have the following attribute:

  • 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.

Stereotype Typedef.JPEG


REQ-PROF-014: The stereotype 'Union' shall be applicable for any uml::DataType.

Stereotype Union.JPEG


REQ-PROF-015: The stereotype 'UsesStaticMethods' shall be applicable for any uml::Property.

Stereotype UsesStaticMethods.JPEG


REQ-PROF-016: The stereotype 'Value' shall be applicable for any uml::EnumerationLiteral. It shall have the following attribute:

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


REQ-PROF-017: The stereotype 'Volatile' shall be applicable for uml::Property.

Stereotype Volatile.JPEG


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

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

File-Primitive Types.JPEG

Generator specification

REQ-GEN-001: The Generator UML to Embedded C shall be identified under the ID 'org.eclipse.umlgen.gen.embedded.c'.

REQ-GEN-002: TBW

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