With FEP
every participant has a clock which determines the current simulation time of the participant. Initially the simulation times of different participants are completely independent.
That's why FEP
offers some mechanisms for synchronizing the different clocks of different participants to the time of one participant, which is the so called timing master.
In general there are two different timing modes.
Discrete With discrete timing the simulation time of the slaves will only progress if the master sends events to update the time. The master will wait until all slaves have processed the event. This mode is used if deterministic behavior is required. The simulation can run faster or slower than wall clock time.
Continuous With continuous timing each participant will run an independent clock. These clocks will cyclically be synchronized to the time of the timing master (e.g. using the Cristian's algorithm ). The mode is used within realtime environments like vehicle prototypes or other distributed systems.
Another component called the FEP Scheduler
will use the local time of a participant to trigger the execution unit of a participant, the so called FEP Job
.
To integrate ADTF with FEP timing
the ADTF component FEP Timing Service is used.
The service will connect ADTF and FEP
timing by providing and registering clocks at ADTF and FEP
, which are responsible for the synchronization.
To execute parts of an ADTF Graph as a FEP Job
the FEP Job Runner is used. The job will be triggered based on the synchronized time provided by the FEP Participant
.
The following sequence demonstrates how to operate the two example ADTF sessions fep_sink
and fep_source
in a FEP System
using discrete synchronization with the fep_sink
session providing the simulation time for the whole system.
The FEP System
will be launched, timing will be configured and the system will be started and stopped. During simulation the timing master fep_sink
will constantly send time update events to the slave fep_source
.
FEP Timing Service
, so there is no need to add it.
./adtf_launcher --session "../src/examples/projects/adtf_example_project/adtfsessions/demo_ipc_sessions/fep_sink_playback.adtfsession" --control-url "fep://default_adtf_system/fep_sink" --console
./adtf_launcher --session "../src/examples/projects/adtf_example_project/adtfsessions/demo_ipc_sessions/fep_source.adtfsession" --control-url "fep://default_adtf_system/fep_source" --console
// configuring discrete timing using Playback Service
./adtf_control -u fep://default_adtf_system -e fep_configuretimingplayer fep_sink
// start the system
./adtf_control -u fep://default_adtf_system -e fep_systemrunlevel 5
// connect to fep_sink, pause the player and get streamtime
connect fep://default_adtf_system/fep_sink
pause
streamtime
// connect to fep_source and get streamtime
connect fep://default_adtf_system/fep_source
streamtime
Similarly the two sessions fep_sink.adtfsession
and fep_source.adtfsession
can be operated with time synchronization.
The only difference is that the command fep_configuretimingcontinuous
or fep_configuretimingdiscrete
needs to be used to configure the FEP System
.
Depending on the nature of the timing master and the timing synchronization you want to use, the following adtf_control commands need to be used to configure the timing for a FEP System
.
Scenario | Command | Time source |
---|---|---|
ADTF session is timing master (containing Playback Service) | fep_configuretimingplayer <master_participant_name> |
providing ADTF Clock as timing for FEP (see ADTF Participant using Playback Service is timing master) |
ADTF session is discrete timing master (without Playback Service) | fep_configuretimingdiscrete <master_participant_name> |
consuming FEP internal clock mechanism |
ADTF session is continuous timing master (without Playback Service) | fep_configuretimingcontinuous <master_participant_name> |
consuming FEP internal clock mechanism |
Non ADTF session is discrete timing master | fep_configuretimingdiscrete <master_participant_name> |
consuming FEP internal clock mechanism |
Non ADTF session is continuous timing master | fep_configuretimingcontinuous <master_participant_name> --master_clock local_system_realtime |
consuming FEP internal clock mechanism |
An ADTF session can act as FEP timing master and provide time updates to configured FEP timing clients.
To configure the FEP System accordingly either use the ADTF Control tool's fep_configuretimingplayer
function or set the ADTF Participant's main clock property to adtf_stream_clock_master
and the timing client main clock properties to slave_master_on_demand_discrete
using e.g. FEP tooling.
The FEP custom clock adtf_stream_clock_master
will participate in the ADTF Time Barrier scheduling mechanism and distribute time updates to FEP timine clients according to it's time update period (configured via the FEP Timing Service's property 'synchronization_interval_us'
).
The Playback Service may, among other ADTF components, define the boundaries of the simulation clock. ADTFDAT File Player, Timer Runner and other ADTF components behave as expected.
Period steps in between samples are interpolated.
The default period is 100 ms.
More details how to configure a FEP System.