IBM
Contents Index Previous Next



Compilation Flags


Compilation flags are used to decide the properties of the Cmicro Library and the generated C code. Both in the Cmicro Library and in the generated code #ifdef's are used to include or exclude parts of the code.

The switches used can be grouped:

  1. Flags defining the compiler
  2. Flags defining the properties of a compiler
  3. Flags defining the properties of the Cmicro Library
  4. Flags defining the implementation of a property

The first two groups are discussed in Adaptation to Compilers.

The remaining two groups are discussed under Manual Scaling and Automatic Scaling Included in Cmicro.

Flag naming conventions:

Use the default settings of these flags in order to reduce potential problems.

Manual Scaling

Users are able to scale some features of the Cmicro Library and the Cmicro Kernel in order to optimize the generated code. All the flags discussed in this section are used throughout the complete SDL system, therefore it is not possible to define flags for processes separately.

Note:

The whole SDL system must always be generated.

The manual scalings have to be done in the file ml_mcf.h. They are divided into the following groups:

  1. Cmicro Kernel/Library
    • Kernel
    • Signals
    • Timers
    • Error checks
  2. Support of SDL Constructs
    • Predefined sorts
    • Size of variables
    • Use of memory
  3. SDL Environment
  4. SDL Coder
  5. SDL Target Tester
    • Initialization
    • Trace
    • Record and Play
  6. Communication Link and Compiler

In the following subsections, the way to configure the Cmicro Package by hand and all the available flags are described.

The user is asked to use the Targeting Expert to configure the Cmicro Package. A description of how to use the targeting Expert can be found in Targeting Work Flow.

To configure the Cmicro Package by hand, the user has to modify the file ml_mcf.h.

To use a Cmicro Package feature just define it in ml_mcf.h like

#define FLAG_NAME_AS_DESCRIBED_BELOW

Sometimes a flag just carries a value. In this case the user has to modify the value in ml_mcf.h

#define FLAG_CARRYING_VALUE  VALUE

Cmicro Kernel/Library

Kernel

General

Initial setting

set

Default setting

unset

Initial setting

unset

Initial setting

unset

Initial setting

unset

Initial setting

unset

Kernel Limits

Initial setting

unset

Initial setting

unset

Initial setting

unset

Initial setting

unset

Signal Structure

Initial setting

set

Initial setting

set

Initial value

4

Signal Handling

Initial setting

set

Reset

XMK_USE_SIGNAL_PRIORITIES

Initial setting

unset

Signal Queue

Initial setting

set

Reset

XMK_USE_STATIC_AND_DYNAMIC_QUEUE

Initial setting

unset

Reset

XMK_USE_STATIC_QUEUE_ONLY

Initial value

20

Note:

Using dynamic memory allocation does not prevent the user from estimating the required memory for the queue. Sooner or later problems arise (e.g. memory fragmentation) if dynamic memory management is used frequently. For this reason the Cmicro Package avoids where possible the use of dynamic memory management.

Light Integration

Initial setting

unset

Automatic set

XMK_USE_INTERNAL_QUEUE_HANDLING

XLI_LIGHT_INTEGRATION

Initial setting

unset

Reset

XLI_LIGHT_INTEGRATION

Initial setting

"li_os_def.h"

Tight Integration

The complexity of a tight integration is very high. But there is a generic solution available, which guides you through the integration.

Please contact IBM Rational local sales office/Professional Services for further information about this solution.

Initial setting

unset

Initial setting

unset

Error Handler

Initial setting

set

Reset

XMK_USE_MIN_ERR_CHECK

XMK_USE_NO_ERR_CHECK

Initial setting

unset

Reset

XMK_USE_MAX_ERR_CHECK

XMK_USE_NO_ERR_CHECK

Initial setting

unset

Reset by

XMK_USE_MAX_ERR_CHECK

XMK_USE_MIN_ERR_CHECK

Initial setting

unset

Initial setting

unset

Automatic set

XMK_ADD_STDIO

Reactions on Warnings

Initial setting

set

Reset

XMK_WARN_ACTION_PRINTF

XMK_WARN_ACTION_USER

Initial setting

unset

Reset

XMK_WARN_ACTION_HANG_UP

XMK_WARN_ACTION_USER

Initial setting

unset

Reset

XMK_WARN_ACTION_HANG_UP

XMK_WARN_ACTION_PRINTF

Initial setting

user_function()

Reaction on Errors

Initial setting

set

Reset

XMK_ERR_ACTION_PRINTF

XMK_ERR_ACTION_USER

Initial setting

unset

Reset

XMK_ERR_ACTION_HANG_UP

XMK_ERR_ACTION_USER

Initial setting

unset

Reset

XMK_ERR_ACTION_HANG_UP

XMK_ERR_ACTION_PRINTF

Initial setting

user_function()

Timer Scaling

If there are timers used within the SDL system, the timers have to be scaled.

Initial setting

unset

Initial value

100

Initial value

100

Timer queue

Initial value

set

Initial value

unset

Initial value

20

Execution Time

Initial setting

unset

Automatic set

XMK_TRANS_TIME

Initial value

20

Depend on

XMK_USE_CHECK_TRANS_TIME

Signal Priorities

In the standard configuration of the Cmicro Kernel no signal priorities are used. So each signal sent is inserted at the end of the signal queue.

Initial setting

unset

Automatic set

xDefaultPrioSignal

XMK_CREATE_PRIO

Reset

XMK_USE_xmk_SendSimple

Initial value

100

Depend on

XMK_USE_SIGNAL_PRIORITIES

Initial value

1

Depend on

XMK_USE_SIGNAL_PRIORITIES

Preemption

Normally, the Cmicro Kernel is configured so that the simple scheduling policy is used, i.e. transitions of SDL processes are non interruptible.

Note:

The Cmicro preemptive kernel is only available if an according license is available.

Initial setting

unset

Automatic set

MAX_PRIO_LEVELS

xDefaultPrioProcess

XMK_USE_RECEIVER_PID_IN_SIGNAL

Reset

XMK_USE_CHECK_TRANS_TIME

Initial value

1

Depend on

XMK_USE_PREEMPTIVE

Caution!

A run-time error occurs if this definition is wrong. If the error checks are enabled, a check is made by the Cmicro Kernel and the C function ErrorHandler() is called if the check fails.

Initial value

0

Depend on

XMK_USE_PREEMPTIVE

SDL Target Tester

Initialization

Initial setting

unset

Automatic set

XMK_USE_MAX_ERR_CHECK

Reset when unset

XMK_ADD_MICRO_COMMAND,

XMK_USE_DEBUGGING,

XMK_ADD_PROFILE,

XMK_ADD_MICRO_ENVIRONMENT,

XMK_WAIT_ON_HOST,

XMK_ADD_SDLE_TRACE,

XMK_ADD_SIGNAL_FILTER,

XMK_USE_COMMLINK,

XMK_ADD_MICRO_TRACER,

XMK_ADD_TEST_OPTIONS,

XMK_USE_SIGNAL_TIME_STAMP,

XMK_ADD_MICRO_RECORDER

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Trace

Trace Scaling

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Reset when unset

XMK_USE_SIGNAL_TIME_STAMP

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Initial setting

set

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Initial setting

unset

Depend on

XMK_ADD_MICRO_TESTER

Reset when unset

XMK_ADD_REALTIME_PLAY

Initial value

40

Buffers

Initial value

20

Initial value

100

Initial value

20

Initial value

100

Recorder and Play

Note:

The SDL Target Tester's Record and Play functions are only available if a Cmicro Recorder license is available.

Initial setting

unset

Depend on

XMK_ADD_MICRO_TRACER

Reset when unset

XMK_ADD_REALTIME_PLAY

Initial setting

unset

Automatic set

XMK_USE_SIGNAL_TIME_STAMP

Depend on

XMK_ADD_MICRO_RECORDER

Support of SDL Constructs

Predefined Sorts

Character Strings

Initial setting

set

Reset by

XNOUSEOFCHARSTRING

Caution!

The Cmicro Recorder is not able to handle SDL charstrings within signal parameters.

Initial setting

set

Reset by

XRESTUSEOFCHARSTRING

Predefined Sorts

Initial setting

set

Initial setting

set

Note:

Every multiplication of an integer value with an integer value is mapped to a multiplication of a real value with a real value. This is done because an overflow cannot be detected when using integer values.

ASN.1 Sorts

Initial setting

set

Depend on

XNOUSEOFCHARSTRING

Initial setting

set

Depend on

XNOUSEOFASN1

Initial setting

set

Depend on

XNOUSEOFASN1

Error Checks

Initial setting

set

Initial setting

set

Initial setting

set

Initial setting

set

Note:

This flag should be used for testing purposes but uses lots of code size within the target.

Initial setting

set

Initial setting

set

Size of Variables

Initial setting

set

Initial setting

set

Initial setting

unset

Use of Memory

Memory Management

Initial setting

unset

Reset when unset

XMK_USE_memshrink

Initial setting

unset

Initial setting

unset

Depend on

XMK_USE_SDL_MEM

Initial setting

unset

Initial setting

unset

Initial value

8

Depend on

XMK_USE_SDL_MEM

Initial value

64

Depend on

XMK_USE_MIN_BLKSIZE

Initial value

1024

Depend on

XMK_USE_SDL_MEM

String Functions

Initial setting

unset

Initial setting

unset

Initial setting

unset

Initial setting

unset

SDL environment

Initial setting

set

Initial setting

set

Initial setting

set

Initial setting

set

Initial setting

unset

Initial setting

unset

Reset when unset

XMK_ADD_PRINTF

Automatic Scaling Included in Cmicro

The flags described in this section are automatically generated into the file sdl_cfg.h by the Cmicro SDL to C Compiler. The purpose is to exclude parts of the C code in order to reduce the generated code. Features or functions which are not required in the SDL description produce no (or only a small) overhead in the generated code.

If the user does not wish to employ automatic scaling facilities, for example if test and debugging proves too difficult, then simply define the flags XMK_USE_NO_AUTO_SCALING.

All the flags discussed in this section are used on the whole SDL system i.e. it is not possible to define flags for processes separately.

The Targeting Expert will use these flags, too, to optimize and ease the manual scaling.

Note:

It is possible to implement a user defined timer model by un-defining these flags and defining some other macros.

Note:

It is not recommended in each case (because it is not SDL conform), but is possible to send parameters via global parameters by using C code in SDL.

Automatic Dimensioning in Cmicro

Some resources of the Cmicro Library are automatically dimensioned. These are described in the following subsections.


http://www.ibm.com/rational
Contents Index Previous Next