diff --git a/.gitea/workflows/validate.yml b/.gitea/workflows/validate.yml index f7b7fde..248740f 100644 --- a/.gitea/workflows/validate.yml +++ b/.gitea/workflows/validate.yml @@ -23,7 +23,6 @@ jobs: lcov \ python3 python3-pip \ git ca-certificates - pip3 install --break-system-packages doorstop || pip3 install doorstop || true - name: Static Analysis (Cppcheck) run: make static @@ -38,11 +37,14 @@ jobs: - name: Coverage Report run: make coverage - - name: Doorstop Check - run: | - if [ -f .doorstop.yml ]; then - doorstop || echo "Doorstop check produced warnings" - fi + - name: Traceability Check + run: python3 tools/traceability.py check + + - name: Traceability Matrix publishen + run: python3 tools/traceability.py publish docs/traceability + + - name: PlantUML Diagramme rendern + run: python3 tools/render_plantuml.py - name: Upload Coverage HTML uses: actions/upload-artifact@v3 @@ -51,6 +53,20 @@ jobs: name: coverage-html path: build/coverage-html/ + - name: Upload Traceability Matrix + uses: actions/upload-artifact@v3 + if: always() + with: + name: traceability + path: docs/traceability/ + + - name: Upload Architektur-Diagramme + uses: actions/upload-artifact@v3 + if: always() + with: + name: architecture-diagrams + path: docs/diagrams/ + - name: Upload Test Results uses: actions/upload-artifact@v3 if: always() diff --git a/Makefile b/Makefile index 75482fd..8ebc87d 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,12 @@ BUILD = build SRCS = $(SRC_DIR)/switch_debouncer.c \ $(SRC_DIR)/actuator_driver.c \ - $(SRC_DIR)/apply_controller.c + $(SRC_DIR)/apply_controller.c \ + $(SRC_DIR)/safety_manager.c OBJS = $(SRCS:%.c=$(BUILD)/%.o) -TESTS = test_switch_debouncer test_actuator_driver test_apply_controller +TESTS = test_switch_debouncer test_actuator_driver test_apply_controller \ + test_safety_manager TEST_BINS = $(TESTS:%=$(BUILD)/%) .PHONY: all test coverage clean misra static diff --git a/arch/swe/SWA-001.md b/arch/swe/SWA-001.md index 2b0c773..5861d9f 100644 --- a/arch/swe/SWA-001.md +++ b/arch/swe/SWA-001.md @@ -10,6 +10,8 @@ links: - SWE-008 - SWE-009 - SWE-010 + - SWE-011 + - SWE-012 asil: D --- diff --git a/arch/swe/SWA-002.md b/arch/swe/SWA-002.md index 35ab07d..6aea22e 100644 --- a/arch/swe/SWA-002.md +++ b/arch/swe/SWA-002.md @@ -10,6 +10,7 @@ links: - SWE-002 - SWE-003 - SWE-004 + - SWE-005 asil: D --- diff --git a/docs/diagrams/SA-001-1.svg b/docs/diagrams/SA-001-1.svg new file mode 100644 index 0000000..cfbe632 --- /dev/null +++ b/docs/diagrams/SA-001-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/diagrams/SWA-001-1.svg b/docs/diagrams/SWA-001-1.svg new file mode 100644 index 0000000..3ef2bf0 --- /dev/null +++ b/docs/diagrams/SWA-001-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/diagrams/SWA-001-2.svg b/docs/diagrams/SWA-001-2.svg new file mode 100644 index 0000000..df9a66e --- /dev/null +++ b/docs/diagrams/SWA-001-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/diagrams/SWA-002-1.svg b/docs/diagrams/SWA-002-1.svg new file mode 100644 index 0000000..0dd74ea --- /dev/null +++ b/docs/diagrams/SWA-002-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/diagrams/SWA-002-2.svg b/docs/diagrams/SWA-002-2.svg new file mode 100644 index 0000000..3d71f55 --- /dev/null +++ b/docs/diagrams/SWA-002-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/diagrams/SWA-003-1.svg b/docs/diagrams/SWA-003-1.svg new file mode 100644 index 0000000..720965d --- /dev/null +++ b/docs/diagrams/SWA-003-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/traceability/index.html b/docs/traceability/index.html new file mode 100644 index 0000000..4e92be4 --- /dev/null +++ b/docs/traceability/index.html @@ -0,0 +1,29 @@ +
+ +Generiert aus 50 Items (SYS: 10, SWE: 25, SA: 5, SWA: 10).
+| System-Requirement | System-Arch (SA) | Software-Req (SWE) | Software-Arch (SWA) |
|---|---|---|---|
SYS-001 D Halten der Parkbremse im Stillstand | SA-001 D EPB ECU SA-002 D Aktoren (Caliper-Motoren) | SWE-001 D Apply-Controller haelt Klemmkraft SWE-002 D Watchdog ueberwacht Apply-Controller SWE-022 B Stillstands-Erkennung aus Wheel Speeds | SWA-002 D Apply Controller SWA-004 B Wheel Speed Plausibilisierung |
SYS-002 D Apply auf Fahrer-Anforderung | SA-001 D EPB ECU SA-002 D Aktoren (Caliper-Motoren) | SWE-003 D Schalter-Apply-Signal an Apply-Controller weiterleiten SWE-004 D Klemmkraft-Erreichen bestaetigen SWE-022 B Stillstands-Erkennung aus Wheel Speeds SWE-025 QM Switch-Debouncing | SWA-002 D Apply Controller SWA-004 B Wheel Speed Plausibilisierung SWA-006 QM Switch Debouncer |
SYS-003 B Release auf Fahrer-Anforderung | SA-001 D EPB ECU SA-002 D Aktoren (Caliper-Motoren) | SWE-005 B Release-Voraussetzungen pruefen SWE-006 B Aktoren in Release-Position fahren SWE-025 QM Switch-Debouncing | SWA-002 D Apply Controller SWA-003 B Actuator Driver SWA-006 QM Switch Debouncer |
SYS-004 D Auto-Apply bei Motor-Aus | SA-001 D EPB ECU | SWE-007 D Motor-Aus-Bedingung erkennen SWE-008 D Auto-Apply nach 2 s Verzoegerung | SWA-001 D Safety Manager |
SYS-005 D Hill-Hold am Berg | SA-001 D EPB ECU SA-003 B Sensor-Cluster | SWE-009 D Hill-Hold-Aktivierungsbedingung SWE-010 D Hill-Hold-Uebergabe an Apply-Controller SWE-024 B Inclinometer Tiefpass-Filter | SWA-001 D Safety Manager SWA-005 B Inclinometer Filter |
SYS-006 B Auto-Release beim Anfahren (Drive-Away-Assist) | SA-001 D EPB ECU SA-003 B Sensor-Cluster | SWE-011 B Anfahrabsicht erkennen SWE-012 B Sicherheits-Check vor Auto-Release SWE-022 B Stillstands-Erkennung aus Wheel Speeds | SWA-001 D Safety Manager SWA-004 B Wheel Speed Plausibilisierung |
SYS-007 B Aktor-Stromueberwachung | SA-001 D EPB ECU SA-002 D Aktoren (Caliper-Motoren) SA-003 B Sensor-Cluster | SWE-013 B Strommessung mit 1 kHz SWE-014 B Overcurrent-Cutoff SWE-015 B Klemmkraft-Schaetzung aus Strom-Profil SWE-023 B Wheel Speed Plausibilisierung | SWA-003 B Actuator Driver SWA-004 B Wheel Speed Plausibilisierung |
SYS-008 QM Service-Modus fuer Werkstatt | SA-001 D EPB ECU SA-004 QM HMI (Schalter, LED, Display) | SWE-016 QM UDS RoutineControl 0x31 fuer Service-Release SWE-017 QM Service-Mode-Indikator | SWA-009 QM Service Mode |
SYS-009 QM UDS-Diagnose | SA-001 D EPB ECU SA-005 QM CAN-Bus | SWE-018 QM UDS Service 0x19 ReadDTC SWE-019 QM UDS Service 0x22 ReadDataByIdentifier | SWA-008 QM Diagnostic Manager SWA-010 QM Logger |
SYS-010 QM HMI-Statusanzeige | SA-001 D EPB ECU SA-004 QM HMI (Schalter, LED, Display) SA-005 QM CAN-Bus | SWE-020 QM LED-Steuerung SWE-021 QM CAN-Status-Frame | SWA-007 QM Display Manager |
Generiert aus {sum(1 for _ in items)} Items " + f"(SYS: {len([i for i in items.values() if i.prefix=='SYS'])}, " + f"SWE: {len([i for i in items.values() if i.prefix=='SWE'])}, " + f"SA: {len([i for i in items.values() if i.prefix=='SA'])}, " + f"SWA: {len([i for i in items.values() if i.prefix=='SWA'])}).
", + "| System-Requirement | System-Arch (SA) | " + "Software-Req (SWE) | Software-Arch (SWA) | — | " + bits = [] + for i in ids: + it = items[i] + c = asil_color(it.asil) + bits.append( + f"" + "".join(bits) + " | " + + for r in rows: + sys = r["sys"] + c = asil_color(sys.asil) + first = (f"{html.escape(sys.id)} "
+ f"{html.escape(sys.asil)} "
+ f"{html.escape(sys.title)} | ")
+ parts.append("
|---|---|---|---|