Code organisation

In order to ease the portability to other architectures and operating systems the code is organised in three tiers and seven levels.

Each tier is an independent library. The BareMetal library is designed to be independent from the file system and from the scheduler, thus allowing to deploy the framework in very embedded systems.

Each level encapsulates a given functional concept and only depends on the functionality provided by any levels above it.

../../_images/Structure-1.png

Levels

BareMetal

Name

Description

L0Types

Definition of the basic types that shall be used by any code using the library.

L1Portability

Code that is either operating system or architecture dependent (atomic operations, memory management, sleep, …) together with components that depend on definitions that are available on L0Types.

L2Objects

Root classes of the framework.

L3Streams

Definition of the concept of Stream.

L4Configuration

Infrastructure which allows to build fully data-driven applications.

L4Logger

Definition of the logging system.

L4Messages

Dynamic exchange of messages between MARTe components.

L5GAMs

MARTe real-time application components.

L4LoggerService

Logging components that use the file system (e.g. UDP logger).

L6App

Application kick-start (bare metal).

FileSystem

Name

Description

L1Portability

File system code that is either operating system or architecture dependent (files, sockets, …).

L3Streams

Portable definition of streams (no operating system dependent code).

L4LoggerService

Logging components that use the file system (e.g. UDP logger).

L6App

Application kick-start code that depends on the file-system (e.g. reading a configuration file).

Scheduler

Name

Description

L1Portability

Scheduler code that is either operating system or architecture dependent (semaphores, threads, …).

L3Services

Components that provide a unique model for the management of threads and services.

L4LoggerService

Logging components that use the scheduler (logging queues on independent threads, …).

L4Messages

Support to message queues.

L4StateMachine

The MARTe state-machine.

L5GAMs

MARTe real-time application components that require a scheduler.

Portability

The operating system and architecture dependent code is encapsulated in the Architecture and Environment folders inside the L1Portability and L6App folders. In the levels’ root folders no operating system and architecture code shall exist.

../../_images/Structure-2.png

Based on the Makefile ARCHITECTURE and ENVIRONMENT identifiers, the correct header files will be included during the code compilation.

#include INCLUDE_FILE_ARCHITECTURE(ARCHITECTURE,AtomicA.h)
#include INCLUDE_FILE_ENVIRONMENT(ENVIRONMENT,BasicFileProperties.h)

Each new operating system or architecture will have to create a new folder with the operating system or architecture identifier and implement all the relevant files.

Namespace

A single namespace, named MARTe, is used for all the core library (and for the MARTe2-components).