Skip to content

Improvement:Update the timeslave to comply to SCORE conventions and add full-chain demo#28

Closed
gordon9901 wants to merge 3 commits into
eclipse-score:mainfrom
gordon9901:ecarx_update_timeslave
Closed

Improvement:Update the timeslave to comply to SCORE conventions and add full-chain demo#28
gordon9901 wants to merge 3 commits into
eclipse-score:mainfrom
gordon9901:ecarx_update_timeslave

Conversation

@gordon9901
Copy link
Copy Markdown
Contributor

@gordon9901 gordon9901 commented May 22, 2026

Summary

Replaces the raw POSIX shared memory implementation in the gPTP IPC library with score::memory::shared::SharedMemoryFactory.

This aligns gPTP IPC shared memory lifecycle management with the existing time_daemontime IPC pattern.

The existing seqlock concurrency protocol is preserved unchanged.

A full-chain demo is also added for end-to-end validation on the target board:

fake_time_slave → demo_time_daemon → demo_app

Changes

gPTP IPC migration

  • Added new package:

    score/ts_client/src/
    
  • Replaces previous usage of:

    score/libTSClient/
    
  • Migrated publisher and receiver shared memory handling to SharedMemoryFactory.

  • Added stale artifact cleanup before shared memory creation.

  • Preserved existing GptpIpcRegion and GptpIpcData structures unchanged.

  • Added a new gptp_ipc BUILD target with dependency on:

    @score_baselibs//score/memory/shared
    

TimeDaemon call-site update

Updated the TimeDaemon gPTP SHM call sites to use the new package path.

Affected area:

score/TimeDaemon/code/ptp_machine/shm/

Main updates:

  • BUILD dependency updates.
  • Include path updates from score/libTSClient/ to score/ts_client/src/.

Build fix

Updated:

score/time_slave/src/gptp/details/BUILD

Added missing log backend dependency to related cc_test targets:

@score_baselibs//score/mw/log:console_only_backend

This fixes pre-existing linker errors unrelated to the shared memory migration.

Full-chain demo

Added demo sources under:

examples/full_chain_demo/

Included components:

  • fake_time_slave.cpp

    • Simulates TimeSlave.
    • Writes gPTP IPC data periodically.
  • demo_time_daemon.cpp

    • Reads gPTP shared memory.
    • Publishes SVT without lifecycle manager.
  • demo_app.cpp

    • Reads SynchronizedVehicleTime from TimeDaemon.
    • BUILD target is currently commented out pending include path confirmation.
  • svt_handler_shm.* / factory_shm.*

    • Reference backups for wiring GPTPShmMachine into the SVT pipeline.

Notes

  • The seqlock protocol is not changed.
  • Existing gPTP IPC data layout is not changed.
  • Demo-related files are intended for target-board validation and integration reference.

Task:#20

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: 1dc99f24-3e0d-4e0b-9c41-bb957a711dc0
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@1.5.3, but got aspect_rules_lint@2.0.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 2 packages loaded
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)

Analyzing: target //:license-check (77 packages loaded, 9 targets configured)

Analyzing: target //:license-check (143 packages loaded, 833 targets configured)

Analyzing: target //:license-check (157 packages loaded, 4292 targets configured)

Analyzing: target //:license-check (158 packages loaded, 7983 targets configured)

Analyzing: target //:license-check (169 packages loaded, 8049 targets configured)

Analyzing: target //:license-check (169 packages loaded, 8049 targets configured)

Analyzing: target //:license-check (169 packages loaded, 8049 targets configured)

Analyzing: target //:license-check (170 packages loaded, 8049 targets configured)

Analyzing: target //:license-check (173 packages loaded, 10058 targets configured)

INFO: Analyzed target //:license-check (174 packages loaded, 10184 targets configured).
[3 / 14] checking cached actions
[13 / 16] [Prepa] Generating Dash formatted dependency file ...
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 2 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
[14 / 16] checking cached actions
[15 / 16] [Prepa] Building license.check.license_check.jar ()
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 39.128s, Critical Path: 2.32s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@gordon9901 gordon9901 requested a deployment to workflow-approval May 22, 2026 07:13 — with GitHub Actions Waiting
@gordon9901 gordon9901 requested a deployment to workflow-approval May 22, 2026 07:13 — with GitHub Actions Waiting
@gordon9901 gordon9901 requested a review from lavrovvalera May 22, 2026 07:18
@gordon9901 gordon9901 requested a deployment to workflow-approval May 22, 2026 09:04 — with GitHub Actions Waiting
@gordon9901 gordon9901 requested a deployment to workflow-approval May 22, 2026 09:04 — with GitHub Actions Waiting
@BlueXMarv3l BlueXMarv3l requested a review from BjoernAtBosch May 25, 2026 09:23
@BlueXMarv3l BlueXMarv3l self-assigned this May 25, 2026
Copy link
Copy Markdown
Contributor

@BjoernAtBosch BjoernAtBosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments added.
Main thing to discuss: Shall we "rename" the executables to snake_case or keep CamelCase?


node "TimeDaemon" {
node "time_daemon" {
[MessageBroker] as msg_broker
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

end box

box TimeDaemon: Absolute Time Pipeline #MistyRose
box time_daemon: Absolute Time Pipeline #MistyRose
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we should not rename it here because the process (and main C++ class) are still called TimeDaemon

}

node "TimeDaemon" {
node "time_daemon" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@@ -1,17 +1,17 @@
Concept for TimeDaemon
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same in this file


cc_binary(
name = "TimeSlave",
name = "time_slave",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to rename the processes also?

{
::close(shm_fd_);
shm_fd_ = -1;
Close();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error-log?

@@ -35,34 +32,23 @@ GptpIpcPublisher::~GptpIpcPublisher()

bool GptpIpcPublisher::Init(const std::string& ipc_name)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe same as for the receiver: Open/Close instead of Init/Destroy (me personally don't like the term destroy for a function that much because that's what the destructor is doing)

@@ -1,24 +1,24 @@
Concept for TimeSlave
Concept for time_slave
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should shortly discuss how we want to name the executables (snake case or camel case). Don't actually know if their is some S-CORE convention.

# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Feature Requirements
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, the feature requirements are maintained in the score repo. See https://github.com/eclipse-score/score/blob/main/docs/features/time/docs/requirements/index.rst

********************************************************************************/

// Usage: ./demo_app [iterations] (default: runs forever until Ctrl-C)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using the TimeDaemon binary here?

@gordon9901 gordon9901 closed this Jun 1, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in TIM - Time FT Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants