Skip to content
dspace-groupPublic

About

Lightweight C library for Co-Simulation in SIL and HIL environments implementing the HSIL Co-Simulation specification

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

HSIL CoSim Library

Library Version License

C API Linux x64 ARM64 (aarch64) Windows x64

Build/Test

A lightweight C library for coupling simulation agents using DDS (Data Distribution Service) middleware, to perform Co-Simulation. It abstracts all DDS communication behind a simple, opaque C API — no DDS expertise required.

HSIL CoSim couples simulation agents over a DDS network using two data types:

Type Purpose
GroupedData Bulk transmission of engineering signals (with fixed-layout)
StreamingData Bus frames (CAN, Ethernet) and arbitrary binary streams

Repository Layout

docs/         - Documentation
examples/     - Usage examples in C++ and Python
lib/          - hsil_cosim library
  include/    - Single public header file <hsil/hsil.h> 
  src/        - Source Files
  tests/      - Unit tests
third_party/  - Third party projects used by this library

Getting Started

1. Clone the Codebase (Including Submodules)

To fetch the code and all third-party dependencies automatically:

git clone --recurse-submodules <repository-url>

If you cloned without submodules, fetch and initialize them by running:

git submodule update --init --recursive

Build and Install

Choose the platform instructions matching your system:

Linux

Compile and build the library in Release mode:

# Configure the project
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

# Build targets in parallel
cmake --build build --parallel

# Install library artifacts
cmake --install build --prefix /path/to/install/dir

Windows (Visual Studio / MSVC)

Run the commands below from inside an x64 Native Tools Command Prompt for VS 2022/2019:
Note: For multi-config generators, build type (Debug/ Release..) must be specified during build and install

# Configure solution
cmake -S . -B build -G "Visual Studio 17 2022" -A x64

# Compile Release configuration
cmake --build build --config Release --parallel

# Install library artifacts
cmake --install build --config Release --prefix /path/to/install/dir

(For Ninja-based compilation (single config generator) on Windows, run cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release followed by cmake --build build and cmake --install build --prefix /path/to/install/dir)


Documentation

For full details, please refer the documentation from sections mention below:


License

Copyright 2026 dSPACE SE & Co. KG

Licensed under the Apache License, Version 2.0 (the "License"); you must not use this software except in compliance with the License. This software is not fully developed or tested. It is distributed free of charge and without any consideration. The software is provided "as is" in the hope that it may be useful to other users, but without any warranty of any kind, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The License is available in LICENSE. This notice is also included in NOTICE.

About

Lightweight C library for Co-Simulation in SIL and HIL environments implementing the HSIL Co-Simulation specification

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages