Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions docs/architecture/_assets/sad_deployment.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@startuml sad_deployment_diagram

title Deployment view

node "S-CORE based host/guest machine" <<execution environment>> {
node "Application Layer" {
[Business logic] as app_bl
[score::time] <<library>> as mw
}
node "Diagnostic App Layer" {
[Diag jobs business logic] as diag_bl
[score::time] <<library>> as mw_ext
}
node [time_salve] <<daemon>> {
[gptp_engine]
}
node [time_daemon] <<daemon>> {
[VerificationMachine] as verification_machine
[PTP machine] as ptp_machine
}
[EMAC] <<hw clock>> as hw_counter
}
node "Time Master ECU" <<device>> {
[gPTP Grand Master Clock] as ptp_gm
}
[DLT] <<records>> as dlt_records


ptp_gm -[#purple]-> gptp_engine : gPTP sync messages
gptp_engine ..> hw_counter : Updates local hw timer
gptp_engine -[#blue]-> ptp_machine : PTP time updates\n(via score::memory::shared)
ptp_machine -[#green]-> verification_machine: Time information
verification_machine -[#green]-> mw: Time information\n(via score::memory::shared)
verification_machine -[#green]-> mw_ext: Time information\n(via score::memory::shared)
verification_machine -[#green]-> dlt_records: Data for post analysis
mw-[#orange]-> app_bl : Now()
mw_ext-[#orange]-> diag_bl : Now(), Callbacks()

@enduml
62 changes: 62 additions & 0 deletions docs/architecture/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
..
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Architecture of Time Feature
============================

Overview
~~~~~~~~

The Time Feature offers applications access to multiple time bases ("clocks") via a unified API.
The main focus is providing access to synchronized time bases, like a vehicle-local time base and a vehicle-external global time base (UTC).
Besides that it offers access to local (not necessarily synchronized) clocks, like
* steady/monotonic clock
* system clock
* high resolution clock.
Those clocks are typically also accessible via existing interfaces defined by the C++ std library or POSIX library.
The reason to provide them via the unified API is to offer application an "easy to mock" interface.

The usage of the unified Time API shall be free from interference (FFI).
The synchronization status of the vehicle time shall be safety qualifiable - means, it is guaranteed to always reflect the actual sync state of that time base.

The basic architecture is shown in the diagram below.

.. raw:: html

<div style="overflow-x: auto; max-width: 100%;">

.. uml:: _assets/sad_deployment.puml
:alt: Raw architectural diagram

.. raw:: html

</div>

Components decomposition
~~~~~~~~~~~~~~~~~~~~~~~~

The **gPTP Grand Master Clock** provides the vehicle time to all other devices in a vehicle via the PTP.
It is assumed to be a component running on a seprarte ECU.
It is therefore not part of the S-CORE Time Feature implementation.

The :doc:`**time_slave** component <../../score/time_slave/docs/index>` is responsible to do the gPTP-related protocol handling, i.e. to receive the Sync / Follow_up frames from the neighboured master and doing the path delay measuring.
The resulting data and timestamp information is forwarded via an IPC interface to the time_daemon component.

The :doc:`**time_daemon** component <../../score/time_daemon/docs/index>` is the heart of the Time Feature. It is responsible for getting the sync data received by the time_slave and determine the synchronization status of the current vehicle time.
The IPC interfaces to the adjacent components, time_slave and API libraries linked to the applications, need to be FFI to be able to guarantee the ASIL qualification of the synchronization status.

The :doc:`**time library** component <../../score/time/docs/index>` offers language specific APIs (currently C++ only, later Rust also) to the applications and handling the IPC with FFI to the time_daemon.
It is a library to be linked into the respective application processes.

The :doc:`**ts_client** component <../../score/ts_client/docs>` is an internal library abstracting the IPC between time_slave and time_daemon.
39 changes: 0 additions & 39 deletions docs/features/time_daemon/_assets/sad_deployment.puml

This file was deleted.

26 changes: 17 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

time_daemon Documentation
=========================
Time Feature Documentation
==========================

This documentation describes the **time_daemon** and the **score::time** module.
This documentation describes the **S-CORE Time Feature** and the **score::time** module.

.. contents:: Table of Contents
:depth: 2
:local:


Overview
--------

**time_daemon** is a non-AUTOSAR adaptive process designed to provide synchronized vehicle time to client applications.
It supports multiple time bases including **in-vehicle synchronized time** (PTP - Precision Time Protocol) and
**external synchronized time** (absolute time base). The daemon retrieves time information from the respective time sources,
The Time feature is designed to provide applications access to multiple different local and non-local time bases ("clocks") via a unified API.
The supported non-local time bases include a **in-vehicle synchronized time** ("vehicle time") and a **external synchronized time** (absolute time base, UTC).
The Time feature retrieves time information from the respective time sources ("Time Masters"),
verifies and validates the timepoints, and distributes this time information across multiple clients through efficient IPC mechanisms.

The main responsibilities of time_daemon include:
Expand All @@ -36,13 +37,18 @@ The main responsibilities of time_daemon include:
- **Providing diagnostic information** for system monitoring
- **Supporting additional verification mechanisms** such as QualifiedVehicleTime (QVT) for safety-critical applications

For a detailed concept and architectural design, please refer to the :doc:`time_daemon Concept Documentation <features/time_daemon/index>`.
For a detailed concept and architectural design, please refer to the :doc:`Time Feature Arichitecture Documentation <architecture/index>`.

.. toctree::
:maxdepth: 2
:caption: Contents:

features/index
architecture/index
../score/time/docs/index
../score/time_daemon/docs/index
../score/time_slave/docs/index
test_cases


Project Layout
--------------
Expand All @@ -54,9 +60,10 @@ This module follows the Eclipse SCORE component structure:
- `score/time/`: Client-facing time base libraries
- `score/ts_client/`: Time synchronization client library
- `examples/`: Usage examples
- `docs/features/`: Feature-level documentation
- `docs/`: Feature-level documentation
- `.github/workflows/`: CI/CD pipelines


Quick Start
-----------

Expand Down Expand Up @@ -122,6 +129,7 @@ Run address, undefined-behaviour and leak sanitizers (powered by ``score_cpp_pol

Individual sanitizer aliases are also available: ``--config=asan``, ``--config=ubsan``, ``--config=lsan``.


Configuration
-------------

Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions score/time/component_classification.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
..
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Component Classification
========================

:Component: time library
:ASIL Level: QM
:Language: C++
:Platform: Linux, QNX
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
..
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

score::time — Unified Clock Interface
======================================

Expand Down
13 changes: 5 additions & 8 deletions docs/features/index.rst → score/time/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Features
========
Time Library Component
======================

.. toctree::
:maxdepth: 2
:caption: Features:
:maxdepth: 1

time/index
time_daemon/index
time_slave/index
test_cases
component_classification
detailed_design/index
21 changes: 21 additions & 0 deletions score/time_daemon/component_classification.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
..
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Component Classification
========================

:Component: time_daemon
:ASIL Level: QM
:Language: C++
:Platform: Linux, QNX
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ node "Application Layer" {
[Business logic] as app_bl
[mw::time::svt] <<library>> as mw
}
node "PTP Daemon" {
[ptpd] <<daemon>> as ptpd
node "time_slave" <<daemon>> {
[gptp_engine] as gptp_engine
}
node "VehicleTimeDaemon" {
node "time_daemon" <<daemon>> {
[MessageBroker] as msg_broker
[VerificationMachine] as verification_machine
[PTP machine] as ptp_machine
[IPC] <<score::communication>> as ipc
}

ptpd -[#blue]-> ptp_machine : PTP time updates\n(via shmem and devctl)
gptp_engine -[#blue]-> ptp_machine : gPTP time updates\n(via score::memory::shared)
ptp_machine -[#green]-> verification_machine: Time information
verification_machine -[#green]-> ipc: Time information
ipc -[#green]-> mw: Time information
ipc -[#green]-> mw: Time information\n(via score::memory::shared)
mw-[#orange]-> app_bl : Now()

@enduml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
..
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Concept for TimeDaemon
=======================

Expand All @@ -15,19 +29,22 @@ TimeDaemon is the non Autosar adaptive process who is intended to get the Vehicl

More precisely we can specify the following use cases for the time daemon:

1. Providing current Vehicle time to different applications
2. Setting the synchronization qualifier (aka Synchronized, Timeout, so on)
1. Determine the current vehicle time and synchronization qualifier out of the sync data received from the time_slave daemon
2. Providing current Vehicle time plus the synchronization qualifier to different applications
3. Providing needed information for diagnostics
4. Providing needed information for addition verification, ex SafeCarTime

The raw architectural diagram is represented below.
Deployment view
~~~~~~~~~~~~~~~

The design deployment is represented on the following diagram:

.. raw:: html

<div style="overflow-x: auto; max-width: 100%;">

.. uml:: _assets/sad_deployment.puml
:alt: Raw architectural diagram
.. uml:: _assets/dd_deployment.puml
:alt: Deployment View

.. raw:: html

Expand All @@ -46,22 +63,6 @@ The design consists of several sw components:
6. `IPC Machine <#ipc-machine-sw-component>`_
7. `VehicleClock (score::time) <#vehicleclock-sw-component>`_

Deployment view
~~~~~~~~~~~~~~~

The design deployment is represented on the following diagram:

.. raw:: html

<div style="overflow-x: auto; max-width: 100%;">

.. uml:: _assets/dd_deployment.puml
:alt: Deployment View

.. raw:: html

</div>

Class view
~~~~~~~~~~

Expand Down
Loading
Loading