Skip to content

Commit f4f48eb

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 7c85daa commit f4f48eb

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
@@ -25,10 +25,13 @@ Time
2525
:tags: time, feature_request, change_management
2626

2727

28-
.. .. toctree::
29-
.. :hidden:
28+
.. toctree::
29+
:maxdepth: 1
30+
:glob:
31+
:titlesonly:
32+
:hidden:
3033

31-
.. requirements.rst
34+
docs/**/index
3235

3336

3437
Feature flag
@@ -143,71 +146,32 @@ In-Vehicle Time Synchronization
143146

144147
Definitions:
145148

146-
**Time Slave**
149+
**Time client**
147150
An actor that runs on the system and is responsible for
148151

149-
* synchronizing the local clock with an external Time Master using the PTP protocol (IEEE 802.1AS).
152+
* synchronizing the local clock with an external *time host* using the PTP protocol (IEEE 802.1AS).
150153
* 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.
151154

152155
**Synchronization process metadata**
153-
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.
156+
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.
154157

155-
Requirements:
156-
157-
* 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).
158-
* REQ_0002: the score::time shall get the current synchronized time and its metadata from the **Time Slave**.
159-
* 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.
160-
* 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.
161-
Validation of the current synchronized time includes:
162-
163-
* checking the time point for loss of synchronization
164-
* checking the time point for monotonicity
165-
* checking the time point for instability, like time jumps to the past or to the future
166-
167-
* 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.
168-
* 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.
169-
*Use case:* frequent access to the current synchronized time and its metadata by multiple clients within one ECU.
170-
* 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.
171-
* 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.
172-
*Use case:* Debugging and diagnostics of the time synchronization process.
173-
174-
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.
158+
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.
175159

176160
.. uml:: data_flow.puml
177-
:caption: Data flow between Time Slave, score::time, and clients
161+
:caption: Data flow between time client, score::time, and clients
178162

179163
Where
180164

181-
* The **Time Slave** (gPTP stack) communicates with an external Time Master to maintain accurate time synchronization using the PTP protocol.
182-
* 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:
165+
* The **time client** (gPTP stack) communicates with an external time host to maintain accurate time synchronization using the PTP protocol.
166+
* 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:
183167

184-
* 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.
168+
* 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.
185169
* **Time base provider** polls for current EMAC value with ``devctl`` calls.
186170
* other IPC methods.
187171

188172
* 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.
189173
* 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.
190174

191-
External Time Synchronization
192-
-----------------------------
193-
194-
* REQ_0010: the score::time feature shall support synchronization with external time sources, such as GPS, based on SOME/IP messages.
195-
* 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.
196-
* 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.
197-
* 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.
198-
199-
High precision Clock
200-
--------------------
201-
202-
* REQ_0014: the score::time feature shall provide a mechanism to access (read only) the high precision clock in nanoseconds precision.
203-
*Use case:* such clocks might be used for time-critical applications, such as audio/video streaming, event logging, and diagnostics.
204-
205-
Monotonic Clock
206-
---------------
207-
208-
* 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.
209-
210-
211175

212176
.. Backwards Compatibility
213177
.. =======================
@@ -231,14 +195,15 @@ How to Teach This
231195
.. Rejected Ideas
232196
.. ==============
233197
198+
234199
.. Open Issues
235200
.. ===========
236201
202+
237203
Glossary
238204
========
239205

240206

241207
.. _footnotes:
242-
243208
Footnotes
244209
=========

0 commit comments

Comments
 (0)