FMI Libraries of the Dynamic Simulation Environment (DSE) Core Platform provide various solutions for working with FMUs and FMI based simulation environments. Included are:
- FMI MCL (Model Compatibility Library) - for loading FMUs into a DSE simulation.
- ModelC FMU - for packaging a DSE simulation as an FMU.
- Gateway FMU - for bridging between a remote simulation and a DSE simulation.
- FMU API - a minimal API for implementing FMUs with support for Binary Variables and Virtual Networks.
The DSE FMI libraries operate in Co-simulation environments and support both scalar and binary variables. Virtual networks (e.g. CAN) are implemented using Network Codecs and supported via FMI Binary variables, or in the case of FMI 2, by using encoded FMI String variables.
- Multi platform (Linux, Windows) and multi architecture (x64, x86, i386) simulation environment.
- Native FMU support for Co-simulation.
- Virtual Networks (CAN etc.) using Network Codecs and Binary Streams. Includes support for FMI 2 (via String variables).
- FMU with embedded Model Runtime and SimBus from the ModelC project.
- Packages DSE Simer simulation as an FMU.
- FMU interface supports Codec based Binary Streams (e.g. CAN Virtual Bus). Includes support for FMI 2 (via String variables).
- Bridge simulaiton environments using a Gateway FMU.
- Gateway FMU interface supports Codec based Binary Streams, including FMI 2 support.
- Manages the Co-simulation time-domain between the bridged simulation environments.
- Simple lifecycle which can be customised to support automation of simulation environments (e.g. session management).
- Minimal API for implementing Co-simulation FMUs with methods:
fmu_create()fmu_init()fmu_step()fmu_destroy()
- Automatic FMI Variable indexing and storage, including FMI 2 support for Binary Variables
- Build targets for FMI 2 and FMI 3.
- Virtual Networks (CAN etc.) using Network Codecs and Binary Streams. Includes support for FMI 2 (via String variables).
└── dse
└── examples <-- Examples
└── fmigateway <-- Gateway FMU source code
└── fmimcl <-- FMI MCL source code
└── fmimodelc <-- ModelC FMU source code
└── fmu <-- FMI API source code
└── importer <-- Simple FMU Importer
└── extra <-- Build infrastructure
└── tools/fmi <-- Containerised tools
└── licenses <-- Third Party Licenses
└── tests <-- Unit and E2E tests
└── Taskfile.yml <-- Workflow automation via Task
Info: This usage example is derived from E2E Test Direct Index.
simulation.dse (DSE Script)
simulation
channel in
channel out
uses
dse.fmi file:///repo
model direct dse.fmi.example.direct
channel in in_vector
channel out out_vector
envar OFFSET 100
envar FACTOR 4
workflow generate-modelcfmu
var FMU_NAME direct
var FMI_VERSION 2
var INDEX directSimulation Builder and Operation
# Setup environment.
$ export BUILDER_IMAGE=ghcr.io/boschglobal/dse-builder:latest
$ export FMI_IMAGE=ghcr.io/boschglobal/dse-fmi:latest
$ export TASK_X_REMOTE_TASKFILES=1
# Set command aliases.
function dse-builder() {
( if test -f "$1"; then cd $(dirname "$1"); fi && docker run -it --user $(id -u):$(id -g) --rm -e AR_USER -e AR_TOKEN -e GHE_USER -e GHE_TOKEN -e GHE_PAT -v $(pwd):/workdir $BUILDER_IMAGE "$@"; )
}
# Install Task (from DSE fork).
$ go install github.com/boschglobal/task/v3/cmd/task@latest
# Build the simulation.
$ dse-builder simulation.dse
$ task -y -v
# Operate the simulation with the Importer.
$ dse/build/_out/importer/fmuImporter --verbose out/fmu/direct# Clone the repo.
$ git clone https://github.com/boschglobal/dse.fmi.git
$ cd dse.fmi
# Optionally set builder images.
$ export GCC_BUILDER_IMAGE=ghcr.io/boschglobal/dse-gcc-builder:latest
# Build.
$ make
$ make package
# Build containerised tools (more details in the extra/tools/fmi directory).
$ make build fmi tools
# Optionally use local container images.
$ export FMI_IMAGE=fmi:test
$ export SIMER_IMAGE=simer:test
# Run tests.
$ make test
# Generate documentation.
$ make generate
# Remove (clean) temporary build artifacts.
$ make clean
$ make cleanallThe FMI Library is built using containerised toolchains. Those are available from the DSE C Library and can be built as follows:
$ git clone https://github.com/boschglobal/dse.clib.git
$ cd dse.clib
$ make dockerAlternatively, the latest Docker Images are available on ghcr.io and can be used as follows:
$ export GCC_BUILDER_IMAGE=ghcr.io/boschglobal/dse-gcc-builder:latestThe FMI Library is implemented using the following related repositories:
Please refer to the CONTRIBUTING.md file.
Dynamic Simulation Environment FMI Library is open-sourced under the Apache-2.0 license. See the LICENSE and NOTICE files for details.


