Demos
This document describes the usage of the demo projects that are included with the Vector SIL Kit project and what their expected output and or results are. All demo source code is located in the Git repository in the folder Demos.
Note
All paths on this page are relative to the top level of the pre-built Vector SIL Kit packages.
To build the demos, please refer to Building the Demos.
Building the Demos
This descriptions refers to the package structures as provided within the pre-built Vector SIL Kit releases. It is not directly applicable for building the demos from source.
For building the demos, cmake has to be installed on your system and a corresponding cpp compiler has to be available.
Building the demos from a pre-built Vector SIL Kit is straight forward, just run the following commands from within the “SilKit-Demos” directory:
mkdir build
cd build
cmake ..
cmake --build .
The individual demos are then built into ./SilKit/bin in the root directory of the package.
Note
The distributed Demos, as packaged by CPack, are preconfigured to build against
a copy of the SIL Kit binaries in ../SilKit/
.
This can be overridden by providing your own SilKit
CMake target library,
before the demos are configured by CMake.
Or by changing the find_package(SilKit ... PATHS path/to/SilKit)
statement directly
in the ./SilKit-Demos/CMakeLists.txt
directory.
CAN Demo
Abstract |
CAN Reader/Writer with or without network simulator |
---|---|
Source location |
./SilKit-Demos/Can |
Requirements |
|
Parameters |
|
Parameter Example |
# Creates a CAN Writer Process with the registry's default URI ./SilKit/bin/SilKitDemoCan ./SilKit-Demos/Can/DemoCan.silkit.yaml CanWriter |
System Example |
For synchronized execution: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # Monitor (optional): ./SilKit/bin/sil-kit-monitor # CAN Reader: ./SilKit/bin/SilKitDemoCan ./SilKit-Demos/Can/DemoCan.silkit.yaml CanReader # CAN Writer: ./SilKit/bin/SilKitDemoCan ./SilKit-Demos/Can/DemoCan.silkit.yaml CanWriter # System Controller: ./SilKit/bin/sil-kit-system-controller CanReader CanWriter For unsynchronized execution: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # CAN Reader: ./SilKit/bin/SilKitDemoCan ./SilKit-Demos/Can/DemoCan.silkit.yaml CanReader --async # CAN Writer: ./SilKit/bin/SilKitDemoCan ./SilKit-Demos/Can/DemoCan.silkit.yaml CanWriter --async |
Notes |
- The writer sends CAN frames at a fixed rate of one frame per simulation step (1ms).
- Both reader and writer sleep for 1 second per quantum to slow down execution.
|
Ethernet Demo
Abstract |
Ethernet Reader / Writer with or without network simulator |
---|---|
Source location |
./SilKit-Demos/Ethernet |
Requirements |
|
Parameters |
|
Parameter Example |
# Creates an Ethernet Writer Process with the registry's default URI: ./SilKit/bin/SilKitDemoEthernet ./SilKit-Demos/Ethernet/DemoEthernet.silkit.yaml EthernetWriter |
System Example |
For synchronized execution: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # Monitor (optional): ./SilKit/bin/sil-kit-monitor # Ethernet Reader: ./SilKit/bin/SilKitDemoEthernet ./SilKit-Demos/Ethernet/DemoEthernet.silkit.yaml EthernetReader # Ethernet Writer: ./SilKit/bin/SilKitDemoEthernet ./SilKit-Demos/Ethernet/DemoEthernet.silkit.yaml EthernetWriter # System Controller: ./SilKit/bin/sil-kit-system-controller EthernetReader EthernetWriter For unsynchronized execution: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # Ethernet Reader: ./SilKit/bin/SilKitDemoEthernet ./SilKit-Demos/Ethernet/DemoEthernet.silkit.yaml EthernetReader --async # Ethernet Writer: ./SilKit/bin/SilKitDemoEthernet ./SilKit-Demos/Ethernet/DemoEthernet.silkit.yaml EthernetWriter --async |
Notes |
- The writer sends Ethernet frames at a fixed rate of one frame per simulation step (1ms).
- Both reader and writer sleep for 1 second per simulation step to slow down execution.
|
LIN Demo
Abstract |
LIN Master and Slave demo. The master sends and requests messages from a LIN slave. |
---|---|
Source location |
./SilKit-Demos/Lin |
Requirements |
|
Parameters |
|
Parameter Example |
# Creates a LIN Master Process with the registry's default URI: ./SilKit/bin/SilKitDemoLin ./SilKit-Demos/Lin/DemoLin.silkit.yaml LinMaster |
System Example |
For synchronized execution: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # Monitor (optional): ./SilKit/bin/sil-kit-monitor # LIN Master: ./SilKit/bin/SilKitDemoLin ./SilKit-Demos/Lin/DemoLin.silkit.yaml LinMaster # LIN Slave: ./SilKit/bin/SilKitDemoLin ./SilKit-Demos/Lin/DemoLin.silkit.yaml LinSlave # System Controller: ./SilKit/bin/sil-kit-system-controller LinSlave LinMaster For unsynchronized execution: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # LIN Master: ./SilKit/bin/SilKitDemoLin ./SilKit-Demos/Lin/DemoLin.silkit.yaml LinMaster --async # LIN Slave: ./SilKit/bin/SilKitDemoLin ./SilKit-Demos/Lin/DemoLin.silkit.yaml LinSlave --async |
Notes |
Both Master and Slave sleep for a hort duration per simulation step to slow down execution.
|
FlexRay Demo
Abstract |
FlexRay Demo for a FlexRay cluster containing two nodes |
---|---|
Source location |
./SilKit-Demos/FlexRay |
Requirements |
|
Parameters |
|
Parameter Example |
# Creates a FlexRay Process for Node 0 with the registry's default URI: ./SilKit/bin/SilKitDemoFlexRay ./SilKit-Demos/FlexRay/DemoFlexRay.silkit.yaml Node0 |
System Example |
# Registry (if not already running): ./SilKit/bin/sil-kit-registry # Network Simulator (assumed to be in PATH, necessary): sil-kit-network-simulator ./SilKit-Demos/FlexRay/NetworkSimulatorConfig.yaml # Monitor (optional): ./SilKit/bin/sil-kit-monitor # Node 0: ./SilKit/bin/SilKitDemoFlexRay ./SilKit-Demos/FlexRay/DemoFlexRay.silkit.yaml Node0 # Node 1: ./SilKit/bin/SilKitDemoFlexRay ./SilKit-Demos/FlexRay/DemoFlexRay.silkit.yaml Node1 # System Controller: ./SilKit/bin/sil-kit-system-controller Node0 Node1 NetworkSimulator |
Notes |
Starting the FlexRay cycle takes quite some time, which is accurately modeled by the SIL Kit Network Simulator. It takes somewhat between 50 and 100 ms until the first FlexRay messages are transmitted. |
Publish/Subscribe Demo
Abstract |
Data Message Publish/Subscribe Demo for a set of Publishers/Subscribers |
---|---|
Source location |
./SilKit-Demos/PubSub |
Requirements |
|
Parameters |
|
Parameter Example |
# Creates a publisher with the registry's default URI: ./SilKit/bin/SilKitDemoPubSub ./SilKit-Demos/PubSub/DemoPubSub.silkit.yaml Publisher |
System Example |
# Registry (if not already running): ./SilKit/bin/sil-kit-registry # Monitor (optional): ./SilKit/bin/sil-kit-monitor # Publisher: ./SilKit/bin/SilKitDemoPubSub ./SilKit-Demos/PubSub/DemoPubSub.silkit.yaml Publisher # Subscriber: ./SilKit/bin/SilKitDemoPubSub ./SilKit-Demos/PubSub/DemoPubSub.silkit.yaml Subscriber # System Controller: ./SilKit/bin/sil-kit-system-controller Publisher Subscriber For unsynchronized execution: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # Publisher: ./SilKit/bin/SilKitDemoPubSub ./SilKit-Demos/PubSub/DemoPubSub.silkit.yaml Publisher --async # Subscriber: ./SilKit/bin/SilKitDemoPubSub ./SilKit-Demos/PubSub/DemoPubSub.silkit.yaml Subscriber --async |
Notes |
The publisher and subscriber show how to serialize/deserialize different kinds of data with the built-in Data Serialization API. |
RPC Demo
Abstract |
Remote Procedure Call Demo. The client triggers remote procedure calls on the server. |
---|---|
Source location |
./SilKit-Demos/Rpc |
Requirements |
|
Parameters |
|
Parameter Example |
# Creates an RPC server process with the registry's default URI: ./SilKit/bin/SilKitDemoRpc ./SilKit-Demos/Rpc/DemoRpc.silkit.yaml Server |
System Example |
# Registry (if not already running): ./SilKit/bin/sil-kit-registry # Monitor (optional): ./SilKit/bin/sil-kit-monitor # Server: ./SilKit/bin/SilKitDemoRpc ./SilKit-Demos/Rpc/DemoRpc.silkit.yaml Server # Client: ./SilKit/bin/SilKitDemoRpc ./SilKit-Demos/Rpc/DemoRpc.silkit.yaml Client # System Controller: ./SilKit/bin/sil-kit-system-controller Server Client For unsynchronized execution: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # Server: ./SilKit/bin/SilKitDemoRpc ./SilKit-Demos/Rpc/DemoRpc.silkit.yaml Server --async # Client: ./SilKit/bin/SilKitDemoRpc ./SilKit-Demos/Rpc/DemoRpc.silkit.yaml Client --async |
Notes |
|
Benchmark Demo
Abstract |
Benchmark Demo. Used for evaluating SIL Kit performance of publish/subscribe communication. |
---|---|
Source location |
./SilKit-Demos/Benchmark |
Requirements |
None (The demo starts its own instance of the registry and system controller). |
Positional parameters |
|
Optional parameters |
|
Parameter Example |
# Launch the benchmark demo with default arguments but 3 participants and a non default registry URI to avoid collisions: ./SilKit/bin/SilKitDemoBenchmark --number-participants 3 --registry-uri silkit://localhost:8501 # Launch the benchmark demo with positional arguments, a specified configuration file: ./SilKit/bin/SilKitDemoBenchmark 4 1 2 1 10 --configuration ./SilKit-Demos/Benchmark/DemoBenchmarkDomainSocketsOff.silkit.yaml |
Notes |
This benchmark demo produces timings of a configurable simulation setup. <N> participants exchange <M> of <B> bytes per simulation step with a fixed simulation step size of 1ms and run for <S> seconds (virtual time).
This simulation run is repeated <K> times and averages over all runs are calculated. Results for average runtime, speedup (virtual time/runtime), throughput (data size/runtime), message rate (count/runtime) including the standard deviation are printed.
The demo uses publish/subscribe controllers with the same topic for the message exchange, so each participant broadcasts the messages to all other participants. The configuration file
DemoBenchmarkDomainSocketsOff.silkit.yaml can be used to disable domain socket usage for more realistic timings of TCP/IP traffic. With DemoBenchmarkTCPNagleOff.silkit.yaml , Nagle’s algorithm and domain sockets are switched off.The demo can be wrapped in helper scripts to run parameter scans, e.g., for performance analysis regarding different message sizes. See
.\SilKit-Demos\Benchmark\msg-size-scaling\Readme.md and .\SilKit-Demos\Benchmark\performance-diff\Readme.md for further information. |
Latency Demo
Abstract |
Latency Demo. Used for evaluating SIL Kit performance of publish/subscribe communication. |
---|---|
Source location |
./SilKit-Demos/Benchmark |
Requirements |
|
Positional parameters |
|
Optional parameters |
|
Parameter Example |
# Launch the two LatencyDemo instances with positional arguments and a specified configuration file: ./SilKit/bin/SilKitDemoLatency 100 1000 ./SilKit/bin/SilKitDemoLatency 100 1000 --isReceiver # Launch the LatencyDemo with positional arguments and a specified configuration file: ./SilKit/bin/SilKitDemoLatency 100 1000 --configuration ./SilKit-Demos/Benchmark/DemoBenchmarkDomainSocketsOff.silkit.yaml |
Notes |
This latency demo produces timings of a configurable simulation setup. Two participants exchange <M> messages of <B> bytes without time synchronization.
The demo uses publish/subscribe controllers performing a message roundtrip (ping-pong) to calculate latency and throughput timings.
Note that the two participants must use the same parameters for valid measurement and one participant must use the
--isReceiver flag. |
Network Simulator Demo
Abstract |
Demo usage of the Network Simulation API |
---|---|
Source location |
./SilKit-Demos/NetworkSimulator |
Requirements |
|
Parameters |
|
Parameter Example |
# Start the Network Simulator Demo with the given config and participant name ./SilKit/bin/SilKitDemoNetSim ./SilKit-Demos/NetworkSimulator/DemoNetSim.silkit.silkit.yaml NetworkSimulator |
System Example |
Interplay with CAN Demo: # Registry (if not already running): ./SilKit/bin/sil-kit-registry # Monitor (optional): ./SilKit/bin/sil-kit-monitor # CAN Reader: ./SilKit/bin/SilKitDemoCan ./SilKit-Demos/Can/DemoCan.silkit.yaml CanReader # CAN Writer: ./SilKit/bin/SilKitDemoCan ./SilKit-Demos/Can/DemoCan.silkit.yaml CanWriter # System Controller: ./SilKit/bin/sil-kit-system-controller CanReader CanWriter NetworkSimulator # Network Simulator Demo: ./SilKit/bin/SilKitDemoNetSim ./SilKit-Demos/NetworkSimulator/DemoNetSim.silkit.silkit.yaml NetworkSimulator |
Notes |
|