Time Architecture#
Time Architecture
|
status: valid
security: YES
safety: ASIL_B
|
||||
Overview#
The Time feature (score::time) provides applications with a uniform way to read time from several distinct clock domain s. The domain is selected explicitly by the application, which keeps the interface consistent across domains while preventing accidental mixing of incompatible TimePoint types.
The architecture distinguishes three time bases (clock domain s), each exposed through its own clock interface:
- Vehicle Time — the network-synchronized (gPTP) vehicle-wide time base,
carrying a Vehicle Time status qualifier. It is exposed through the Vehicle Clock, which — because the time base depends on external synchronization — also offers initialization, availability checks and event subscription in addition to reading the time.
- Local Time — the local, non-synchronized time bases (steady, system and high-resolution).
They are exposed through the Local Clock, need no initialization and are always available.
- Absolute Time — an external absolute time base (e.g. UTC from GPS), carrying an
Absolute Time status qualifier that reflects both accuracy and security. It is exposed through the Absolute Clock.
Because each clock domain is independent and exposed through its own logical interface, the architecture is open to future time bases (for example a further synchronized or secure domain): a new domain is added as an additional interface without changing the existing ones.
Description#
Uniform clock access#
All clock domains are exposed through a common, domain-agnostic interface so that applications use the same operations regardless of which time base they read. Reading the time returns a Snapshot that bundles the TimePoint with the domain’s status concept (Vehicle Time status for the vehicle clock, Absolute Time status for the absolute clock; the local clocks carry no status), so callers can read the time and judge its quality in a single call.
Rationale Behind Architecture Decomposition#
The feature is decomposed along its time bases. Each clock domain is an independent time base with its own epoch, progression semantics, TimePoint type and status concept. The domains are logically and functionally independent: an application selects one explicitly, and time values of different domains are distinct, incompatible types that cannot be mixed.
Independence does not imply isolation. A time base may build on or use another — for example a
synchronized domain interpolates between synchronization updates on top of a local monotonic base,
and the System Clock is kept aligned to Absolute Time through the OS
CLOCK_REALTIME — but such relationships are internal and do not couple the interfaces the
domains expose.
The synchronized time bases (Vehicle Clock and Absolute Clock) additionally rely on an external time reference and on validation of the received time. They may share a common supporting component for obtaining and validating that time, but such reuse is an implementation choice, not an architectural constraint: each synchronized domain could equally be served on its own.
Accordingly the feature exposes one self-contained logical interface per group of time bases: the Vehicle Clock, the Absolute Clock, and the Local Clock. The local, non-synchronized clocks (steady, system and high-resolution) are grouped behind a single interface because they share the same minimal operation surface (a single time read); they remain distinct domains, differing only in their semantics, which is captured in a domain table rather than in separate architectural elements.
Requirements#
The Feature requirements are described in the requirements index.
Feature Overview#
Time
|
status: valid
security: YES
safety: ASIL_B
|
||||
The runtime (static and dynamic) architecture is defined in the time module
(Time Feature Architecture).
Time Bases#
Each time base is presented with the logical interface it exposes.
Vehicle Time#
The Vehicle Clock exposes the network-synchronized vehicle time. Because it depends on external synchronization, it additionally offers subscription to synchronization events, on top of reading the time.
Logical Interface#
Vehicle Clock
|
status: valid
security: NO
safety: ASIL_B
|
||||
|
|||||
now
|
status: valid
security: NO
safety: ASIL_B
|
||||
Returns the current vehicle-time Snapshot (TimePoint plus Vehicle Time status). |
|||||
subscribe
|
status: valid
security: NO
safety: ASIL_B
|
||||
Registers a callback that is notified on vehicle-time synchronization events. |
|||||
unsubscribe
|
status: valid
security: NO
safety: ASIL_B
|
||||
Removes a previously registered synchronization-event callback. |
|||||
Local Time#
The Local Clock groups the local, non-synchronized time bases, provided directly by the
operating system clocks. All variants expose a single now operation returning a
Snapshot; they require no initialization and are always available. The concrete domains
are:
Domain |
Semantics |
|---|---|
Monotonic, nanosecond-resolution, lowest-overhead clock. Fulfils the high-precision clock API. |
|
Monotonic, never adjusted. Preferred for elapsed-time and timeouts. Fulfils the monotonic clock API. |
|
Wall-clock (UTC-based) OS |
Logical Interface#
Local Clock
|
status: valid
security: NO
safety: ASIL_B
|
||||
|
|||||
Absolute Time#
The Absolute Clock exposes an external absolute time source (e.g. UTC from GPS). Its Absolute Time status carries both an accuracy qualifier and a security qualifier.
Logical Interface#
Absolute Clock
|
status: valid
security: YES
safety: ASIL_B
|
||||
|
|||||
now
|
status: valid
security: YES
safety: ASIL_B
|
||||
Returns the current Snapshot (TimePoint with Absolute Time status). |
|||||