Dataflow Runtime API  3.1.1.0
Imt.Base Configuration

The Imt.Base libraries can be configured by the user (client) via the following config header files:

Handling of the configuration files

The configuration files must be copied to predefined paths. The script pre-build-configure.bat can be used to copy these files. As a prerequisite of the script the header files must be stored in a folder called "Config".

For example, the following pre-build step can be used in IAR: "$PROJ_DIR$\..\App\RuntimeDemo\pre-build-configure.bat" "$PROJ_DIR$\..\App\RuntimeDemo\"

Note: the Config folder is inside the RuntimeDemo folder in the path above.

Header Description

The following sections describes the constants that can be configured by the user. The corresponding defined value is an example value.

DiagnosticsConfigApp.h

// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
// SW guideline: Technote Coding Guidelines Ver. 1.6

#ifndef DIAGNOSTICSCONFIGAPP_H
#define DIAGNOSTICSCONFIGAPP_H

/**
 * This is an application specific file which can be used to configure and extend the diagnostic features of Imt.Base.Core.
 * All source files in Imt.Base do include this file.
 * So when the sources should be compiled a copy of this application specific file needs to be copied to Imt.Base.Core.Diagnostics *before* the build of Imt.Base starts.
 */

#endif // DIAGNOSTICSCONFIGAPP_H

MathConfigApp.h

// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
// SW guideline: Technote Coding Guidelines Ver. 1.6

#ifndef MATHCONFIGAPP_H
#define MATHCONFIGAPP_H

/**
 * This is a application specific file which is used to configure Imt.Base.Core.Math.
 * All source files of Imt.Base.Core.Math do include this file. So when the sources should be compiled
 * a copy of this application specific file needs to be copied to Imt.Base.Core.Math *before* the build of Imt.Base starts.
 */

namespace imt {
namespace base {
namespace core {
namespace math {

/**
 * The following flags activates given custom math function. If defined, the user must implement given function and all overloads in the project.
 * \note You have to rebuild the solution if you switch between STL or CUSTOM implementations!
 *
 * If CUSTOM_x is enabled, ensure somewhere in the project the function is implemented like the following example.
 * The function signature must exactly match with the enabled CUSTOM_x function. See Maths.h for signature information.
 *
 * EXAMPLE SQRT float64_t:
 * ```cpp
 *     #include <Imt.Base.Core.Math/Function/sqrt.h>
 *
 *     #ifdef CUSTOM_SQRT
 *
 *      float64_t imt::base::core::math::function::sqrt(const float64_t sqVal) {
 *           // Your implementation
 *      }
 *
 *      float32_t imt::base::core::math::function::sqrt(const float32_t sqVal) {
 *         // Your implementation
 *      }
 *
 *     #endif
 *     ...
 * ```
 */

// #define CUSTOM_ABS
// #define CUSTOM_ARCOS
// #define CUSTOM_ARCOSH
// #define CUSTOM_ARSIN
// #define CUSTOM_ARSINH
// #define CUSTOM_ARTAN
// #define CUSTOM_ARTAN2
// #define CUSTOM_ARTANH
// #define CUSTOM_COMPARE
// #define CUSTOM_COPYSIGN
// #define CUSTOM_COS
// #define CUSTOM_COSH
// #define CUSTOM_ERF
// #define CUSTOM_ERFC
// #define CUSTOM_EXP
// #define CUSTOM_EXP
// #define CUSTOM_EXPM1
// #define CUSTOM_FDIM
// #define CUSTOM_FLOOR
// #define CUSTOM_FMOD
// #define CUSTOM_FPCLASSIFY
// #define CUSTOM_FREXP
// #define CUSTOM_HYPOT
// #define CUSTOM_ILOGB
// #define CUSTOM_ISINF
// #define CUSTOM_ISNAN
// #define CUSTOM_LDEXP
// #define CUSTOM_LOG
// #define CUSTOM_LOG1P
// #define CUSTOM_LOG2
// #define CUSTOM_LOGB
// #define CUSTOM_MODF
// #define CUSTOM_NAN
// #define CUSTOM_NEXTAFTER
// #define CUSTOM_POW
// #define CUSTOM_REMAINDER
// #define CUSTOM_REMQUO
// #define CUSTOM_RINT
// #define CUSTOM_SCALBLN
// #define CUSTOM_SCALBN
// #define CUSTOM_SIN
// #define CUSTOM_SINH
// #define CUSTOM_SQRT
// #define CUSTOM_TAN
// #define CUSTOM_TANH
// #define CUSTOM_TRUNC

} // namespace math
} // namespace core
} // namespace base
} // namespace imt

#endif // MATHCONFIGAPP_H

PlatformConfigApp.h

// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
// SW guideline: Technote Coding Guidelines Ver. 1.6

#ifndef PLATFORMCONFIGAPP_H
#define PLATFORMCONFIGAPP_H

/**
 * This is a application specific file which is used to configure Imt.Base.Core.
 * All source files in Imt.Base do include this file.
 * So when the sources should be compiled a copy of this application specific file needs to be copied to Imt.Base.Core.Platform *before* the build of Imt.Base starts.
 */

// This can not be used with a binary runtime.
#ifdef _WINDOWS
    // in case of Win32, we use the STL functionality
    #ifndef USE_STL
        #define USE_STL
    #endif // USE_STL
#endif // _WINDOWS

// Activates the custom TestBase. If defined, the unit test project must provide an impementation of the TestBase class.
// AXIVION Next Line AutosarC++19_03-A2.7.2: Depending on project active
// #define TEST_BASE_CUSTOM

// Activates the BSP implementation in Imt.Base. If defined, the BSP must proved an implementation for given target.
// This can not be used with a binary runtime.
// AXIVION Next Line AutosarC++19_03-A2.7.2: Depending on project active
// #define DATAFLOW_BSP

// Suppress exporting all symbols to the global namespace
// AXIVION Next Line AutosarC++19_03-A2.7.2: Depending on project active
// #define OMIT_EXPORT_TO_GLOBAL_NAMESPACE

// Suppress definition of the default exception handlers in the HAL so the application can implement custom ones. This will be automatically set if DATAFLOW_BSP is set.
// This can not be used with a binary runtime.
// AXIVION Next Line AutosarC++19_03-A2.7.2: Depending on project active
// #define OMIT_HARDWARE_EXCEPTION_HANDLERS

#endif // PLATFORMCONFIGAPP_H

RemotingConfigApp.h

// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
// SW guideline: Technote Coding Guidelines Ver. 1.6

#ifndef REMOTINGCONFIGAPP_H
#define REMOTINGCONFIGAPP_H

/**
 * This is a application specific file which is used to configure Imt.Base.Lib.Remoting.
 * All source files of Imt.Base.Lib.Remoting do include this file. So when the sources should be compiled
 * a copy of this application specific file needs to be copied to Imt.Base.Lib.Remoting *before* the build of Imt.Base starts.
 */

// Imt.Base includes
#include <Imt.Base.Core.Platform/Platform.h>

namespace imt {
namespace base {
namespace lib {
namespace remoting {

// AXIVION FILE Style AutosarC++19_03-A2.8.1: config file name allowed here

/**
 * Defines the maximum message size that can be produced by a remote object.
 */
static const size_t REMOTING_MAX_MESSAGE_SIZE = 1024U;

/**
 * Defines the allowed data frame size.
 */
static const size_t DATA_FRAME_SIZE = REMOTING_MAX_MESSAGE_SIZE * 2U;

/**
 * @brief Defines the size of the data frame pool.
 *
 * As of the time of writing this comment, every communication protocol use its
 * own data frame. The data frame size is specified by the DATA_FRAME_SIZE
 * constant. The count of how many data frames are available is defined by this
 * constant.
 *
 * Example:
 * If two protocol objects are used, which every of this object uses one
 * dataframe, this constant must at least be set to 2
 */
static const size_t DATA_FRAME_POOL_SIZE = 16U;

/**
 * Defines the size of the available remote objects
 */
static const size_t REMOTE_OBJECT_MAX = 64U;

} // namespace remoting
} // namespace lib
} // namespace base
} // namespace imt

#endif // REMOTINGCONFIGAPP_H

RuntimeConfigApp.h

// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
// SW guideline: Technote Coding Guidelines Ver. 1.6

#ifndef RUNTIMECONFIGAPP_H
#define RUNTIMECONFIGAPP_H

// AXIVION FILE Style AutosarC++19_03-A2.8.1: File exempted from this rule, wanted construct

/**
 * This is a application specific file which is used to configure Imt.Base.Dff.
 * All source files of Imt.Base.Dff do include this file. So when the sources should be compiled
 * a copy of this application specific file needs to be copied to Imt.Base.Dff.Runtime *before* the build of Imt.Base starts.
 */

// Imt.Base includes
#include <Imt.Base.Core.Platform/Platform.h>

namespace imt {
namespace base {
namespace dff {
namespace runtime {

// AXIVION Construct AutosarC++19_03-M0.1.4: Allowed definitions, runtime parameters

/**
 * maximum number of active parts
 * @note each active part requires sizeof(ActivePartType)
 */
static const int16_t EXECUTABLES_MAX = 32;

/**
 * maximum number of events
 * @note each event requires sizeof(EventType)
 */
static const size_t EVENTPOOL_SIZE = 2048U;

/**
 * maximum number of small events
 * @note each event requires sizeof(EventType)
 */
static const size_t EVENTPOOL_SMALL_SIZE = 128U;

/**
 * maximum number of data bytes per event
 */
static const size_t EVENTDATA_SIZE_BYTES = 100U;

/**
 * maximum number of data bytes per small event
 */
static const size_t EVENTDATA_SMALL_SIZE_BYTES = 16U;

/**
 * maximum number of software timers
 * @note each timer requires sizeof(TimeType)
 */
static const int16_t TIMEPOOL_SIZE = 64;

/**
 * maximum number of I/O buffers. USE_BUFFERPOOL must be defined!
 * @note each buffer requires sizeof(BufferType) + sizeof(BufferType*)
 */
static const int16_t BUFFERPOOL_SIZE = 64;

/**
 * Optional: Default size of the stack for an active part in the size unit used by the runtime.
 * Only required for runtime that can define the stack size for executables (e.g. embOS)
 */
static const size_t STACK_SIZE_DEFAULT = 128U;

/**
 * Optional: Size of the total allocated memory for all stacks in the size unit used by the runtime.
 * If all stacks use the default size this shall be EXECUTABLES_MAX x STACK_SIZE_DEFAULT;
 * Only required for runtime that can define the stack size for executables AND must also provide the memory for the stack (e.g. embOS)
 */
// AXIVION Next Line AutosarC++19_03-A5.1.1: Usage allowed, pool size definition
static const size_t STACKPOOL_SIZE = 128U * 32U;

} // namespace runtime
} // namespace dff
} // namespace base
} // namespace imt

/**
 * In addition to the common events use small events for small event data to save memory.
 * If USE_SMALL_EVENT_BUFFER is defined, static constants EVENTPOOL_SMALL_SIZE and EVENTDATA_SMALL_SIZE_BYTES have to be defined above.
 * This can not be used with a binary runtime.
 */
#define USE_SMALL_EVENT_BUFFER

/**
 * In addition to events use buffer pools for big events to improve runtime performance.
 * If USE_BUFFERPOOL is defined, static constants BUFFERPOOL_SIZE have to be defined above.
 * This can not be used with a binary runtime.
 */
#define USE_BUFFERPOOL

#endif // RUNTIMECONFIGAPP_H