Generate IDE Projects from DATAFLOW Model

by Marco Wuelser

 

Project generation for specific Toolchains

In addition to the generation of source code files, the DATAFLOW Designer supports the generation of a project configuration for a development IDE. This way, the generated source code can be opened with the defined development IDE like any manually created IDE project. Additionally, all required settings and files for a successful build of the just generated project are provided. To use this feature, one or more Toolchains must be assigned (see chapter Add Toolchain below) to any of the components defined in the system model.

NOTE

The Startup and SystemInitialisation Code is only generated if Target Hardware is assigned as well. Otherwise, this code has to be provided by the user.

Supportes IDEs

  • Visual Studio Simulation Template
    • 2015
    • 2017
    • 2019
  • Visual Studio UnitTest Template
    • 2015
    • 2017
    • 2019
  • IAR
    • 8.80
    • 8.22
    • 7.40
  • Makefile

GNU (requires a Target Hardware to be assigned) Supported Test Frameworks

  • MS UnitTest Framework

NOTE

Additional IDEs will be added in future versions of DATAFLOW Designer. Please contact the IMT Support if your IDE is missing.

 

Add Toolchain

A Toolchain is a set of configuration parameters required for DATAFLOW Designer to generate code for a certain development IDE. A project can have multiple Toolchains. For example, one for the target build and one for a unit test build. It is also possible that there are multiple software modules inside a single project that are deployed on different target processors that require different Toolchains.

To add a Toolchain, right-click the root element of the project to be created and select ‘Add Toolchain’ from the context menu. The selected element can be the System element or any System Component or Active Container. The selected element and all child components will be added to the project configuration.

Add Toolchain

 

In the dialog that appears, the name and template for the Toolchain can be selected. The template defines the type of IDE and whether it is a unit test or target project.

Toolchain Template Dialog

Once the Toolchain has been created, the Toolchain dialog is displayed to edit the configuration (see edit Toolchain chapter below).

A component can hold one or more Toolchains for different purposes. For example, if unit tests are compiled in another IDE than the target, build.

Toolchain assignment in a DATAFLOW Mode

 

Edit Toolchain

To edit a Toolchain, select ‘Edit Toolchains’ from the context menu. In the Toolchain dialog, several tabs allow you to configure the toolchain in detail.

 

General Tab

Toolchain configuration name

Displayed name for the toolchain.

Template name (read only)

The template the toolchain was created from.

 

Configuration Tab

The available options depend on the type of toolchain.

 

Solution Name

 

This is used as the name for the generated solution file.

Solution File Directory

 

Path to the folder the solution files will be placed in.

Windows SDK Version

 

The SDK version the generated projects should reference.

Extract Documentation

 

If enabled, all PDF files from packages will be copied to the source folder.

Subdirectories per Project

Will place all visual studio projects into a subfolder with the project name.

Overwrite Runtime Configuration

If enabled, the configuration headers [1] will be generated and overwrite existing headers.

Maximum Number of Events

Size of the runtime event queue in number of events.

Take the value from the Code Generator

If enabled, the following 3 values will be automatically set by the generator. Otherwise, the user can configure them.

Maximum Number of Active Parts

 

Size of the runtime executable pool.

Maximum Number of Data Bytes per Event

Size of a single event in the event queue.

Maximum Number of Software Timers

Size of the runtime timer pool.

Minimum Size in KB

 

Indicates the minimal footprint based on the defined buffer sizes.

 

Dependency Settings Tab

The available options depend on the installed packages and the type of toolchain.

 

Runtime Type

Architecture of the target system.

 

Runtime Package

Source Code/Binary packages.

 

Runtime Version

Allows you to select from all the local installed DATAFLOW Runtime versions. It is recommended to use the latest version.

Platform Type

 

Specific type of the platform/MPU.

Extract Libraries

If enabled, the Imt.Base packages will be copied to the given directory. Otherwise, only a reference is created and the packages must be managed by hand or from another toolchain.

Imt.Base Directory

It is also possible to configure the path to the Imt.Base libraries in the Dependency tab. When configured correctly, a list of all available projects is displayed. All checked projects would be added to the generated project configuration. This is now possible for the Visual Studio 2015/2017/2019 solutions.

Optional Packages

 

All selected packages will be copied/referenced in the generated project.

 

Generator Settings Tab

The available options depend on the generated language.

 

Code Language

Code Language definition

 

Maximum Number of Arguments for the Protocol Constructor:

This value defines the maximum number of arguments for which a custom constructor is created for a protocol. Protocols with more fields will not have such a constructor.

A custom constructor permits you to initialize the protocol fields inline, for example:

MyProtocol msg(1, 2, false);

Generate Folder for Root Namespace

Option to generate a root namespace folder

 

Export Types to Global Namespace

If this option is disabled, no used declarations are generated in header files. All generated characters must then be used with the scoped name.

Trailing Return Type

For C++11 and newer, the trailing return type style can be enabled. This will generate all non-void methods using that style, for example,

auto getValue() -> int32_t;

Source Path

Root path for all generated header and source files.

 

Test Path

Root path for all generated test files.

 

Meta File Path

Path to the meta file of the code generator. This file contains a list of all generated or updated files and is required for the project generator.

Generate Code

 

Enable/Disable the generation of all source and header files.

Generate Tests

 

Enable/Disable the generation of all unit test files.

Protect Generated Files

Generated files that should not be edited by the user are set to read only.

Custom Constructor Threshold

 

Defines the maximum number of protocol fields that will generate a custom constructor that supports assignment of all fields when a protocol is created (instead of using the setter methods).

Test Framework

 

Style of the generated unit tests.

Currently, only MS Test is supported.

Category Protocols

Unit Test Category Caption for Protocols

Category Active Parts

Unit Test Category Caption for Active Parts

Category Active Part Containers

Unit Test Category Caption for Active Part Containers

Category IRQ Active Parts

Unit Test Category Caption for Interrupt Active Parts

 

Code Style Settings Tab

The available options depend on the generated language.

 

Brace Style

 

Select from different Brace Style presets

 

Indent With Tabs

 

Option to indent with the given number of tabs instead of spaces.

 

Number of Indents

 

Number of spaces (or tabs) used for a single indent.

Line Endings

 

Line ending style.

Indent Namespace Contents

 

Indent level for all namespace contents.

Class Contents

 

Indent level for all class contents.

Other Block Contents

 

Indent level for all other block contents.

Indent Braces

 

Indent levels for all braces. This will NOT affect any content, only the braces.

Indent Access Specifiers

 

Indent level for class access specifier (public, private, etc…) relative to the class statement.

Indent Case Labels

 

Indent level for the case content relative to the case label.

Indent Case Contents

 

Indent level for the case label relative to the switch statement.

 

 

Brace Paddings

 

Padding around braces { }

This does NOT include initializers.

Bracket Paddings

 

Padding around brackets [ ]

Parentheses Paddings

 

Padding around parentheses ( )

Initializer Paddings

Padding around C++11 element initializers, such as, for example:

uint8_t data[] = {1, 2, 3, 4};

Operator Paddings

Padding around binary operators, such as: = + - * / && == and ||.

Keywords

Padding around keywords, such as: if, else, if else, switch and for.

Header File Template

 

File Header used for all header files.

Source File Template

 

File Header used for all source files.

Test File Template

 

File Header used for all unit test files.

Documentation Style

 

Style of the (doxygen) documentation comments.

Static Code Analyzer Excludes

Style of static code analyzer excludes.

Currently only PC Lint 9L is supported.

 

Remove Toolchains

To remove all Toolchains from an element, right-click the element and select ‘Clear Toolchains’ from the context menu.

Alternatively, Toolchains can also be removed in the Settings dialog.

 

Go back