Skip to content

Commit d64104b

Browse files
castlerCopilot
authored andcommitted
[rules score] add integrator example illustrating AoU chain-forwarding
Extend the examples with a three-level forwarding chain: other_seooc (defines TimingConstraint and SpaceConstraint AoUs) ↑ deps safety_software_seooc_example (chain-forwards TimingConstraint) ↑ deps integrator_seooc (receives forwarded AoUs, has own requirements) - Add AoU TRLC sources to other_seooc and wire assumptions_of_use - Add aou_forwarding.yaml to seooc for chain-forwarding - Create integrator_seooc with assumed system requirements, feature requirements, and component requirements Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4de43f2 commit d64104b

11 files changed

Lines changed: 357 additions & 2 deletions

File tree

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
#
14+
# Example: System integrator SEooC that depends on safety_software_seooc_example.
15+
#
16+
# This illustrates the full AoU forwarding chain:
17+
#
18+
# other_seooc defines AoU: OtherLibrary.TimingConstraint
19+
# ↑ (deps)
20+
# safety_software_seooc_example
21+
# - defines own AoU: SampleType.SampleAoU (auto-forwarded here)
22+
# - chain-forwards OtherLibrary.TimingConstraint via aou_forwarding.yaml
23+
# ↑ (deps)
24+
# integrator_seooc (this target)
25+
# - receives SampleType.SampleAoU (auto-forwarded from seooc)
26+
# - receives OtherLibrary.TimingConstraint (chain-forwarded through seooc)
27+
# - must handle both in its lobster traceability report
28+
#
29+
30+
load(
31+
"//bazel/rules/rules_score:rules_score.bzl",
32+
"architectural_design",
33+
"component",
34+
"dependable_element",
35+
"unit",
36+
)
37+
38+
cc_library(
39+
name = "integrator_lib",
40+
srcs = [],
41+
visibility = ["//visibility:public"],
42+
deps = [
43+
"//bazel/rules/rules_score/examples/seooc:sample_library",
44+
],
45+
)
46+
47+
architectural_design(
48+
name = "integrator_design",
49+
static = ["static_design.puml"],
50+
)
51+
52+
unit(
53+
name = "integrator_unit",
54+
scope = ["//bazel/rules/rules_score/examples/integrator:__pkg__"],
55+
tests = [],
56+
unit_design = [],
57+
implementation = [":integrator_lib"],
58+
)
59+
60+
component(
61+
name = "integrator_component",
62+
components = [":integrator_unit"],
63+
requirements = [
64+
"//bazel/rules/rules_score/examples/integrator/docs/requirements:component_requirements",
65+
],
66+
tags = ["manual"],
67+
tests = [],
68+
)
69+
70+
# The integrator depends on safety_software_seooc_example and therefore
71+
# receives all forwarded AoUs:
72+
# - SampleType.SampleAoU (auto-forwarded, own AoU of seooc)
73+
# - OtherLibrary.TimingConstraint (chain-forwarded from other_seooc through seooc)
74+
dependable_element(
75+
name = "integrator_seooc",
76+
architectural_design = [":integrator_design"],
77+
assumptions_of_use = [],
78+
components = [":integrator_component"],
79+
dependability_analysis = [],
80+
integrity_level = "B",
81+
requirements = [
82+
"//bazel/rules/rules_score/examples/integrator/docs/requirements:feature_requirements",
83+
],
84+
tests = [],
85+
deps = ["//bazel/rules/rules_score/examples/seooc:safety_software_seooc_example"],
86+
)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
load("//bazel/rules/rules_score:rules_score.bzl", "assumed_system_requirements", "component_requirements", "feature_requirements")
15+
16+
assumed_system_requirements(
17+
name = "assumed_system_requirements",
18+
srcs = [
19+
"assumed_system_requirements.trlc",
20+
],
21+
visibility = ["//visibility:public"],
22+
)
23+
24+
feature_requirements(
25+
name = "feature_requirements",
26+
srcs = [
27+
"feature_requirements.trlc",
28+
],
29+
visibility = ["//visibility:public"],
30+
deps = [
31+
":assumed_system_requirements",
32+
],
33+
)
34+
35+
component_requirements(
36+
name = "component_requirements",
37+
srcs = [
38+
"component_requirements.trlc",
39+
],
40+
visibility = ["//visibility:public"],
41+
deps = [
42+
":feature_requirements",
43+
],
44+
)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/********************************************************************************
2+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
package Integrator
14+
15+
import ScoreReq
16+
17+
///////////////////////////////
18+
// Assumed System Requirements
19+
// System level requirements for the integrator
20+
///////////////////////////////
21+
22+
ScoreReq.AssumedSystemReq ASR_INT_001 {
23+
description = "The system shall integrate the numeric value management SEooC and invoke its interfaces within real-time constraints"
24+
safety = ScoreReq.Asil.B
25+
version = 1
26+
rationale = "System-level requirement for integrating a safety-qualified SEooC into the target platform"
27+
}
28+
29+
ScoreReq.AssumedSystemReq ASR_INT_002 {
30+
description = "The system shall detect and react to faults reported by integrated SEooC components within a bounded time"
31+
safety = ScoreReq.Asil.B
32+
version = 1
33+
rationale = "System-level requirement for fault handling in a safety-critical integration context"
34+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/********************************************************************************
2+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
package IntegratorComponent
14+
15+
import ScoreReq
16+
import Integrator
17+
18+
ScoreReq.CompReq COMP_INT_001 {
19+
description = "The startup module shall call the SEooC initialization routine before entering the main loop"
20+
safety = ScoreReq.Asil.B
21+
derived_from = [Integrator.FEAT_INT_001@1]
22+
version = 1
23+
}
24+
25+
ScoreReq.CompReq COMP_INT_002 {
26+
description = "The cyclic task shall invoke the validation interface every 10ms using a hardware timer interrupt"
27+
safety = ScoreReq.Asil.B
28+
derived_from = [Integrator.FEAT_INT_002@1]
29+
version = 1
30+
}
31+
32+
ScoreReq.CompReq COMP_INT_003 {
33+
description = "The fault handler shall assert the safe-state output within 50ms of receiving a validation failure"
34+
safety = ScoreReq.Asil.B
35+
derived_from = [Integrator.FEAT_INT_003@1]
36+
version = 1
37+
}
38+
39+
ScoreReq.CompReq COMP_INT_004 {
40+
description = "The diagnostic reporter shall provide a health status register readable via the diagnostic interface"
41+
safety = ScoreReq.Asil.B
42+
derived_from = [Integrator.FEAT_INT_004@1]
43+
version = 1
44+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/********************************************************************************
2+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
package Integrator
14+
15+
import ScoreReq
16+
17+
///////////////////////////////
18+
// Feature Requirements
19+
// Requirements for the system integrator that incorporates safety_software_seooc
20+
///////////////////////////////
21+
22+
ScoreReq.FeatReq FEAT_INT_001 {
23+
description = "The integrator shall initialize the numeric value manager provided by the SEooC within the system startup sequence"
24+
safety = ScoreReq.Asil.B
25+
derived_from = [Integrator.ASR_INT_001@1]
26+
version = 1
27+
}
28+
29+
ScoreReq.FeatReq FEAT_INT_002 {
30+
description = "The integrator shall invoke the validation interface cyclically with a period no greater than 10ms to ensure timely fault detection"
31+
safety = ScoreReq.Asil.B
32+
derived_from = [Integrator.ASR_INT_001@1]
33+
version = 1
34+
}
35+
36+
ScoreReq.FeatReq FEAT_INT_003 {
37+
description = "The integrator shall transition to a safe state within 50ms if the validation interface returns a failure result"
38+
safety = ScoreReq.Asil.B
39+
derived_from = [Integrator.ASR_INT_002@1]
40+
version = 1
41+
}
42+
43+
ScoreReq.FeatReq FEAT_INT_004 {
44+
description = "The integrator shall provide a diagnostic reporting interface that exposes the current health status of all managed SEooC components"
45+
safety = ScoreReq.Asil.B
46+
derived_from = [Integrator.ASR_INT_002@1]
47+
version = 1
48+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
14+
@startuml
15+
16+
package "Integrator SEooC" as integrator_seooc <<SEooC>> {
17+
component "IntegratorComponent" as integrator_component <<component>> {
18+
component "IntegratorUnit" as integrator_unit <<unit>>
19+
}
20+
}
21+
22+
@enduml

bazel/rules/rules_score/examples/seooc/BUILD

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ dependability_analysis(
4949

5050
dependable_element(
5151
name = "safety_software_seooc_example",
52+
# Chain-forward received AoUs that this element cannot handle itself.
53+
# TimingConstraint from other_seooc is forwarded to dependees (integrator).
54+
aou_forwarding = "aou_forwarding.yaml",
5255
architectural_design = ["//bazel/rules/rules_score/examples/seooc/design:sample_seooc_design"],
53-
assumptions_of_use = [],
56+
assumptions_of_use = ["//bazel/rules/rules_score/examples/seooc/docs:sample_aous"],
5457
components = [":component_example"],
5558
dependability_analysis = [
5659
":sample_dependability_analysis",
@@ -60,5 +63,6 @@ dependable_element(
6063
"//bazel/rules/rules_score/examples/seooc/docs/requirements:feature_requirements",
6164
],
6265
tests = [],
66+
visibility = ["//:__subpackages__"],
6367
deps = ["//bazel/rules/rules_score/examples/some_other_library:other_seooc"],
6468
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
#
14+
# Chain-forwarding configuration for safety_software_seooc_example.
15+
#
16+
# This SEooC depends on other_seooc (some_other_library) and receives its AoU
17+
# "OtherLibrary.TimingConstraint". Since this element cannot satisfy the timing
18+
# constraint itself (it is a library, not a runtime scheduler), it forwards the
19+
# AoU to its own dependees — the system integrator.
20+
#
21+
forwarded_aous:
22+
- aou_id: "OtherLibrary.TimingConstraint"
23+
justification: "This SEooC is a library component and has no control over the invocation cycle time. The system integrator must ensure that calls to the library do not exceed the 10ms cycle time constraint imposed by the underlying other_seooc dependency."

bazel/rules/rules_score/examples/seooc/docs/BUILD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
1313
load("@trlc//:trlc.bzl", "trlc_requirements", "trlc_requirements_test")
14+
load(
15+
"//bazel/rules/rules_score:rules_score.bzl",
16+
"assumptions_of_use",
17+
)
1418

1519
trlc_requirements(
1620
name = "aous",
@@ -23,6 +27,12 @@ trlc_requirements(
2327
visibility = ["//visibility:public"],
2428
)
2529

30+
assumptions_of_use(
31+
name = "sample_aous",
32+
srcs = [":aous"],
33+
visibility = ["//visibility:public"],
34+
)
35+
2636
trlc_requirements_test(
2737
name = "aous_test",
2838
reqs = [

bazel/rules/rules_score/examples/some_other_library/BUILD

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13+
load("@trlc//:trlc.bzl", "trlc_requirements")
1314
load(
1415
"//bazel/rules/rules_score:rules_score.bzl",
1516
"architectural_design",
17+
"assumptions_of_use",
1618
"component",
1719
"dependable_element",
1820
"unit",
@@ -25,6 +27,17 @@ architectural_design(
2527
],
2628
)
2729

30+
trlc_requirements(
31+
name = "aous_trlc",
32+
srcs = ["aous.trlc"],
33+
spec = ["@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model"],
34+
)
35+
36+
assumptions_of_use(
37+
name = "other_library_aous",
38+
srcs = [":aous_trlc"],
39+
)
40+
2841
unit(
2942
name = "abc",
3043
scope = ["//bazel/rules/rules_score/examples/some_other_library:__pkg__"],
@@ -48,7 +61,7 @@ component(
4861
dependable_element(
4962
name = "other_seooc",
5063
architectural_design = [":sample_seooc_design"],
51-
assumptions_of_use = [],
64+
assumptions_of_use = [":other_library_aous"],
5265
components = [":component_example"],
5366
dependability_analysis = [],
5467
integrity_level = "D",

0 commit comments

Comments
 (0)