/smp-mdk

SMP2 Model Development Toolkit

Primary LanguageC++GNU General Public License v3.0GPL-3.0

SMP2 Simulator for Hardware in the Loop

This project is forked from Juan R. García Blanco's implementation of SMP (Simulation Model Portability) Model Development Kit for open-source development of SMP2 models, mainly geared for academic research projects related to HIL (Hardware in the Loop) and OBC (On board computer) device and peripheral models.

The scheduler is attached to the computer clock instead of using a discrete event queue so Scheduler and TimeKeeper services behaviour is not fully compliant to the SMP2 standard. Save/restore and hold/resume are not available, but the partial implementation should be enough to run SMP2 models connected to HW interfaces. This is useful for many testing scenarios in which an SMP2 model needs to comunicate through SpW, 1553, CAN, I/O signals or any other protocolol with real hardware.

Differences from original author's code:

  • Changed to CMake build system (WIP).
  • Modified original code for compatibility with C++17 (removed throws).
  • Added some examples from the official handbook (WIP).
  • Added a minimal implementation of a simulation infrastructure: Scheduler, Logger, Time Keeper, etc. (WIP).

Maturity

Still WIP. A more detailed status for each item of SMP2 standard to be provided in next tag.

  • Simulator service:
    • Simulator service. ✔️
    • Dynamic model loading and configuration using YAML. ✔️
    • RPC: JSON RPC 2.0/ZMQ. ✔️
    • SMP2 variables publication. ✅
  • SMP2 Standard implementation:
    • Hardware in the Loop Scheduler + TimeKeeper. ✔️
    • Discrete event Scheduler + TimeKeeper. ✅
    • Managed models. ✅
    • Logger. ✔️
    • Event Manager. ✅
    • Publication. ✅
    • Dynamic invocation. ✅
    • Save/restore. ✅
  • SMP2 handbook examples:
    • SMP2 Handbook Counter example (non managed). ✔️
  • Example models
  • Code and process quality:
    • CMake. ✔️
    • Tests. ✅
    • Documentation. ✅
    • CI. ✅

Instructions

Requirements:

  • C++ compiler
  • CMake
  • Boost

Follow specific instructions for general third-party libraries installation and simulator-specific third party libraries.

Build and install everything: SMP2 library and examples, simulator, models and tests:

mkdir build
cd build
cmake ..
make && sudo make install

Tested on Ubuntu 18.04.

Specific instructions for each component are in its directory README file.

Related resources and references