How vectorgrp/sil-kit works
Project Type and Purpose
• This is an open-source, modular C++ library (“Vector SIL Kit”) for connecting Software-in-the-Loop (SIL) environments and automotive bus simulators. It provides participant APIs, transport, protocol services (CAN, LIN, FlexRay, Ethernet), pub-sub, RPC, orchestration, logging, metrics, tracing, plus utilities (registry, monitor, system controller) and a Dashboard service.
File-Structure Analysis
• Top-level directories:
• SilKit/ (headers, sources, CMake modules) – the core library
• Demos/ – sample applications exercising the library
• Utilities/ – standalone executables (sil-kit-registry, sil-kit-monitor, sil-kit-system-controller)
• ThirdParty/ – bundled dependencies (asio, fmt, googletest, oatpp, spdlog, yaml-cpp)
• docs/ – Sphinx/Doxygen documentation
• Under SilKit/source you see layered subdirectories:
• core/ (participant internals, VAsio transport, service discovery, requests)
• services/ (CAN, Ethernet, FlexRay, LIN, pubsub, rpc, logging, metrics, orchestration)
• dashboard/ (HTTP server & client, event handlers)
• tracing/ (pcap capture & replay)
• experimental/ and extensions/
• Utilities each have their own CMakeLists and entry-point .cpp files.
• Build configuration: CMakeLists.txt, CMakePresets.json, CI workflows.
README Insights
• Describes that you compile via CMake, toggle demos/tests/utilities/docs.
• Mentions related adapters (QEMU, TAP, vcan), plus Dashboard as separate application.
Diagramming the Architecture
a. Main Components
• Participant Processes (applications, demos)
• SilKit Core Library (API layer, ParticipantManager)
• Service Modules inside Core:
• Transport (VAsio)
• Service Discovery & Registry Client
• Protocol Services: CANController/Simulator, EthernetController/Simulator, FlexRay, LIN
• Pub/Sub, RPC, Orchestration, Logging, Metrics, Tracing
• SilKit Registry Service (standalone registry process)
• SilKit Dashboard Service (Oatpp HTTP server + persistence)
• External Network/Simulated Network (for inter-participant messaging)
• Third-Party Components (Asio for I/O, yaml-cpp for config, spdlog for logging, oatpp for HTTP)
b. Relationships & Interactions
1. On startup, each Participant loads YAML config via yaml-cpp and registers with the SilKit Registry (service discovery).
2. Participants open VAsio connections (TCP/UNIX pipes) to peers or to a NetworkSimulator component for bus simulation.
3. Protocol Services marshal/demarshal messages (Serdes) and enforce simulation behaviors.
4. Pub/Sub and RPC modules handle data exchange between participants.
5. Orchestration service synchronizes time and lifecycle across participants.
6. Logging and Metrics modules emit events; Tracing can capture/ replay via pcap.
7. Dashboard Service subscribes (via Pub/Sub) to events, persists state, provides HTTP API.
8. Utilities (sil-kit-monitor, sil-kit-system-controller) connect similarly as clients.
c. Architectural Patterns & Principles
• Modular layering: separation of API, transport, services
• Plugin/extension API for third-party adapters
• In-process service aggregation vs. out-of-process registry & dashboard (microservices)
• Use of dependency injection via YAML configuration
• Event-driven, message-based communication
d. Key Technologies
• CMake build system, C++17
• Asio (network I/O)
• yaml-cpp (configuration)
• oatpp (Dashboard HTTP server)
• spdlog/fmt (logging)
• GoogleTest (unit/integration tests)