Skip to content

Commit eab570c

Browse files
committed
feature time: Move requirements in own file
Follow platform folder structure definition for requirements and bring them to the according structure.
1 parent ff1987a commit eab570c

File tree

2 files changed

+182
-51
lines changed

2 files changed

+182
-51
lines changed
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
..
2+
# *******************************************************************************
3+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
4+
#
5+
# See the NOTICE file(s) distributed with this work for additional
6+
# information regarding copyright ownership.
7+
#
8+
# This program and the accompanying materials are made available under the
9+
# terms of the Apache License Version 2.0 which is available at
10+
# https://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# SPDX-License-Identifier: Apache-2.0
13+
# *******************************************************************************
14+
15+
Requirements
16+
############
17+
18+
.. feat_req:: Time client PTP sync
19+
:id: feat_req__time__trec_external_sync_ptp
20+
:reqtype: Functional
21+
:security: NO
22+
:safety: QM
23+
:satisfies:
24+
:status: valid
25+
26+
The **time client**, as part of score::time feature, shall synchronize the local clock with an external **time host** using the PTP protocol (IEEE 802.1AS).
27+
28+
.. feat_req:: score::time metadata
29+
:id: feat_req__time__time_metadata
30+
:reqtype: Functional
31+
:security: NO
32+
:safety: QM
33+
:satisfies:
34+
:status: valid
35+
36+
The score::time shall get the current synchronized time and its metadata from the **time host**.
37+
38+
.. feat_req:: score::time validation
39+
:id: feat_req__time__time_validataion
40+
:reqtype: Functional
41+
:security: NO
42+
:safety: QM
43+
:satisfies:
44+
:status: valid
45+
46+
The score::time shall validate the current synchronized time, which was received from the **time host** and reflect the validation results in the time point status accordingly.
47+
48+
Validation of the current synchronized time includes:
49+
* checking the time point for loss of synchronization
50+
* checking the time point for monotonicity
51+
* checking the time point for instability, like time jumps to the past or to the future
52+
53+
.. feat_req:: score::time multiple applications
54+
:id: feat_req__time__multiple_applications
55+
:reqtype: Functional
56+
:security: NO
57+
:safety: QM
58+
:satisfies:
59+
:status: valid
60+
61+
The score::time feature shall provide a mechanism to access (read only) to the synchronized time and its status across multiple applications within one ECU.
62+
63+
.. feat_req:: score::time efficiency
64+
:id: feat_req__time__client_efficiency
65+
:reqtype: Functional
66+
:security: NO
67+
:safety: QM
68+
:satisfies:
69+
:status: valid
70+
71+
The score::time feature shall provide an access to the synchronized time and its status, see feat_req__time__multiple_applications, in an efficient way without any additional overhead, like kernel calls, Resource manager involvement and so on.
72+
*Use case:* frequent access to the current synchronized time and its metadata by multiple clients within one ECU.
73+
74+
75+
.. feat_req:: score::time synchronization process metadata
76+
:id: feat_req__time__sync_process_metadata
77+
:reqtype: Functional
78+
:security: NO
79+
:safety: QM
80+
:satisfies:
81+
:status: valid
82+
83+
The score::time feature shall provide a mechanism to access (read only) to the internal state of the synchronization process, see **Synchronization process metadata**, across multiple applications within one ECU.
84+
85+
.. feat_req:: score::time synchronization stat logging
86+
:id: feat_req__time__sync_stat_logging
87+
:reqtype: Functional
88+
:security: NO
89+
:safety: QM
90+
:satisfies:
91+
:status: valid
92+
93+
The score::time shall provide a mechanism to log the internal state of the synchronization process, see **Synchronization process metadata**, to be able to debug and diagnose the time synchronization process.
94+
*Use case:* Debugging and diagnostics of the time synchronization process.
95+
96+
97+
External Time Synchronization
98+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99+
.. feat_req:: score::time external synchronization
100+
:id: feat_req__time__external_sync
101+
:reqtype: Functional
102+
:security: NO
103+
:safety: QM
104+
:satisfies:
105+
:status: valid
106+
107+
The score::time feature shall support synchronization with external time sources, such as GPS, based on SOME/IP messages.
108+
109+
.. feat_req:: score::time external synchronization status
110+
:id: feat_req__time__external_sync_status
111+
:reqtype: Functional
112+
:security: NO
113+
:safety: QM
114+
:satisfies:
115+
:status: valid
116+
117+
The score::time shall maintain the current synchronized time and its synchronization status, to be able to provide the latest values by clients request.
118+
119+
.. feat_req:: score::time external synchronization time
120+
:id: feat_req__time__external_sync_time
121+
:reqtype: Functional
122+
:security: NO
123+
:safety: QM
124+
:satisfies:
125+
:status: valid
126+
127+
The score::time feature shall provide a mechanism to access (read only) the current synchronized time from external time sources and its synchronization status.
128+
129+
.. feat_req:: score::time external synchronization status log
130+
:id: feat_req__time__external_sync_status_log
131+
:reqtype: Functional
132+
:security: NO
133+
:safety: QM
134+
:satisfies:
135+
:status: valid
136+
137+
The score::time feature shall provide a mechanism to log the internal state of the external time synchronization process, to be able to debug and diagnose the synchronization process.
138+
139+
140+
High precision Clock
141+
^^^^^^^^^^^^^^^^^^^^
142+
143+
.. feat_req:: score::time high precision clock
144+
:id: feat_req__time__high_precision_clock
145+
:reqtype: Functional
146+
:security: NO
147+
:safety: QM
148+
:satisfies:
149+
:status: valid
150+
151+
The score::time feature shall provide a mechanism to access (read only) the high precision clock in nanoseconds precision.
152+
*Use case:* such clocks might be used for time-critical applications, such as audio/video streaming, event logging, and diagnostics.
153+
154+
155+
Monotonic Clock
156+
^^^^^^^^^^^^^^^
157+
158+
.. feat_req:: score::time monotonic clock
159+
:id: feat_req__time__monotonic_clock
160+
:reqtype: Functional
161+
:security: NO
162+
:safety: QM
163+
:satisfies:
164+
:status: valid
165+
166+
The score::time feature shall provide a mechanism to access (read only) to monotonic, not adjustable clock value, which is mapped from the known OS or HW clock.

docs/features/time/index.rst

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ Time
2424
:tags: time, feature_request, change_management
2525

2626

27-
.. .. toctree::
28-
.. :hidden:
27+
.. toctree::
28+
:maxdepth: 1
29+
:glob:
30+
:titlesonly:
31+
:hidden:
2932

30-
.. requirements.rst
33+
docs/**/index
3134

3235

3336
Feature flag
@@ -142,71 +145,32 @@ In-Vehicle Time Synchronization
142145

143146
Definitions:
144147

145-
**Time Slave**
148+
**Time client**
146149
An actor that runs on the system and is responsible for
147150

148-
* synchronizing the local clock with an external Time Master using the PTP protocol (IEEE 802.1AS).
151+
* synchronizing the local clock with an external *time host* using the PTP protocol (IEEE 802.1AS).
149152
* providing the synchronization meta information to the clients, including score::time feature. Where meta information includes, but not limited to synchronization status (synchronized, not synchronized, unstable), time difference to the external time source, last synchronization time, current time point of the local clock and so on.
150153

151154
**Synchronization process metadata**
152-
Data which is provided by the **Time Slave** and includes the current synchronized time, synchronization status, rate correction, and so on, which are the output or intermediate artifacts of the synchronization process.
155+
Data which is provided by the **time client** and includes the current synchronized time, synchronization status, rate correction, and so on, which are the output or intermediate artifacts of the synchronization process.
153156

154-
Requirements:
155-
156-
* REQ_0001: the **Time Slave**, as part of score::time feature, shall synchronize the local clock with an external **Time Master** using the PTP protocol (IEEE 802.1AS).
157-
* REQ_0002: the score::time shall get the current synchronized time and its metadata from the **Time Slave**.
158-
* REQ_0003: the score::time shall maintain the current synchronized time, its synchronization status and **Synchronization process metadata**, to be able to provide the latest values by clients request.
159-
* REQ_0004: the score::time shall validate the current synchronized time, which was received from the **Time Slave** and reflect the validation results in the time point status accordingly.
160-
Validation of the current synchronized time includes:
161-
162-
* checking the time point for loss of synchronization
163-
* checking the time point for monotonicity
164-
* checking the time point for instability, like time jumps to the past or to the future
165-
166-
* REQ_0005: the score::time feature shall provide a mechanism to access (read only) to the synchronized time and its status across multiple applications within one ECU.
167-
* REQ_0006: the score::time feature shall provide an access to the synchronized time and its status, see REQ_0005, in an efficient way without any additional overhead, like kernel calls, Resource manager involvement and so on.
168-
*Use case:* frequent access to the current synchronized time and its metadata by multiple clients within one ECU.
169-
* REQ_0007: the score::time feature shall provide a mechanism to access (read only) to the internal state of the synchronization process, see **Synchronization process metadata**, across multiple applications within one ECU.
170-
* REQ_0008: the score::time shall provide a mechanism to log the internal state of the synchronization process, see **Synchronization process metadata**, to be able to debug and diagnose the time synchronization process.
171-
*Use case:* Debugging and diagnostics of the time synchronization process.
172-
173-
The diagram above illustrates the data flow and interactions between the Time Slave, score::time middleware, and client applications within an ECU during PTP-based time synchronization.
157+
The diagram bellow illustrates the data flow and interactions between the Time client, score::time middleware, and client applications within an ECU during PTP-based time synchronization.
174158

175159
.. uml:: data_flow.puml
176-
:caption: Data flow between Time Slave, score::time, and clients
160+
:caption: Data flow between time client, score::time, and clients
177161

178162
Where
179163

180-
* The **Time Slave** (gPTP stack) communicates with an external Time Master to maintain accurate time synchronization using the PTP protocol.
181-
* The **Time base provider** periodically reads the synchronized time from the Time Slave, validates it, and writes the results (including status flags and timestamps) into some shared resource towards **score::time** middleware. Different IPC mechanisms can be used for to provide actual synchronized time and its metadata to **Time base provider**, like:
164+
* The **time client** (gPTP stack) communicates with an external time host to maintain accurate time synchronization using the PTP protocol.
165+
* The **Time base provider** periodically reads the synchronized time from the Time client, validates it, and writes the results (including status flags and timestamps) into some shared resource towards **score::time** middleware. Different IPC mechanisms can be used for to provide actual synchronized time and its metadata to **Time base provider**, like:
182166

183-
* shared memory, then the **Time Slave** writes the synchronized time and its metadata into the shared memory, which is then read by the **Time base provider** middleware.
167+
* shared memory, then the **time client** writes the synchronized time and its metadata into the shared memory, which is then read by the **Time base provider** middleware.
184168
* **Time base provider** polls for current EMAC value with ``devctl`` calls.
185169
* other IPC methods.
186170

187171
* The **score::time** middleware accesses this shared resource to obtain the latest synchronized time and its metadata, adjusting the time as needed based on the local clock by requests from client applications.
188172
* This architecture ensures efficient, low-overhead distribution of synchronized time and its status to multiple applications within the ECU, supporting both real-time and diagnostic use cases.
189173

190-
External Time Synchronization
191-
-----------------------------
192-
193-
* REQ_0010: the score::time feature shall support synchronization with external time sources, such as GPS, based on SOME/IP messages.
194-
* REQ_0011: the score::time shall maintain the current synchronized time and its synchronization status, to be able to provide the latest values by clients request.
195-
* REQ_0012: the score::time feature shall provide a mechanism to access (read only) the current synchronized time from external time sources and its synchronization status.
196-
* REQ_0013: the score::time feature shall provide a mechanism to log the internal state of the external time synchronization process, to be able to debug and diagnose the synchronization process.
197-
198-
High precision Clock
199-
--------------------
200-
201-
* REQ_0014: the score::time feature shall provide a mechanism to access (read only) the high precision clock in nanoseconds precision.
202-
*Use case:* such clocks might be used for time-critical applications, such as audio/video streaming, event logging, and diagnostics.
203-
204-
Monotonic Clock
205-
---------------
206-
207-
* REQ_0015: the score::time feature shall provide a mechanism to access (read only) to monotonic, not adjustable clock value, which is mapped from the known OS or HW clock.
208-
209-
210174

211175
.. Backwards Compatibility
212176
.. =======================
@@ -230,14 +194,15 @@ How to Teach This
230194
.. Rejected Ideas
231195
.. ==============
232196
197+
233198
.. Open Issues
234199
.. ===========
235200
201+
236202
Glossary
237203
========
238204

239205

240206
.. _footnotes:
241-
242207
Footnotes
243208
=========

0 commit comments

Comments
 (0)