Architecture · SWE.2
Giraffe Flow design
The software-architecture page. Version 0.2, kept with the code. The draft file remains DESIGN.md.
1. Vision
Giraffe Flow is lightweight middleware and a toolchain for cross-platform SOA. See it, stress it, and pass it on the bench. Hardware is the last mile.
- Bench: virtual world, Foxglove, gf-config / codegen / GMT, CI
- Target: trimmable
gf_ara::*, ARM Linux first. CD only what passed
Perception and planning in this repository are a closed-loop workload, not a production ADAS product. The design borrows AUTOSAR Adaptive process management, health management, and SOA communication, and adds affordable codegen, DAG and signal review, long record/replay, OpenVX observability, ROS 2 interop, and a trimmed deployment. A certificate is not delivered here.
2. AUTOSAR AP
Concepts are borrowed. The stack is not cloned. Semantics stay close to ARA. The namespace is gf_ara::*.
| Phase | Scope |
|---|---|
| P0 | core, com, log, and simplified exec, phm, sm |
| P1 | ucm and diag skeletons. Full bindings later |
| P3, landed | per in-process KV, tsync skeleton. Trimmed per SKU |
| P2, later | crypto, iam, idsm, fw, shwa, full nm, production OTA backends |
Beyond AP: unified trace into GTKWave, OpenVX hooks that stay out of the algorithm, a DDS binding, Importer plus gf.sor.json, record/replay, and DAG plus signal-lineage review.
3. Two API layers
| Layer | Namespace | Role |
|---|---|---|
| Public | gf_ara::com, gf_ara::exec, gf_ara::phm | ARA-like semantics |
| Internal | gf::com, gf::runtime, gf::trace | Recording, binding switch, and other extensions |
4. Three transports
Applications use gf_ara::com only. The binding router picks iceoryx, SOME/IP, or DDS from the manifest.
| Transport | Role | Typical use |
|---|---|---|
| iceoryx | On-SoC zero copy | Radar, frames, fusion |
| SOME/IP | Service-oriented, cross-ECU | Chassis, body, external SOA |
| DDS | Data-centric | ROS 2, cross-SoC, prototypes |
DDS and SOME/IP differences stay in the SOR and the mapping tables.
5. SOR and codegen
SOR is the requirements contract. The only direct codegen input is gf.sor.json. OEM arxml / dbc and req.yaml are normalized into it.
OEM.arxml | dbc + req.yaml → import → gf.sor.json → lint → generate → Proxy / Skeleton + EM / PHM manifests + bindings
A SOR needs schema_version, types, services, deployments with provides and requires on every process, dataflows, bindings, and imports_meta. Without provide and require there is no trustworthy DAG.
A shared signal such as vehicle speed has one provider, the gateway. Perception, planning, and control subscribe. Generated code lives under generated/. Hand-written logic stays in the application sources.
6. Service boundary and process boundary
SOA is a stable interface. A process is a fault domain. Platform residents are exec, phm, and sm. A crashing sensor SDK stays in its own process. Control is not colocated with IVI. A manifest may colocate light services without changing the service interface.
7. Deployment
| Class | What stays there |
|---|---|
| On board | EM, PHM, SM, adapters, the workload, the bindings it needs, a trace agent |
| Host only | Importer, codegen, DAG review, GTKWave, offline replay |
| vehicle-debug | Sampled record and diagnostic probes. Off in a production profile |
Phases run from desktop, to board plus host, to HIL, to vehicle debug, to a production trim. Boot starts EM only. EM then spawns optional daemons and the SOA applications through OSAL. Library cases are on process launch.
8. Observability
Design time uses the DAG and signal lineage. Fine runtime timing uses trace into GTKWave. Long runs use record and replay. Clocks are unified first. Replay is read-only before injection is allowed.
9. Portability
Applications
→ gf_ara API
→ runtime
→ bindings (iceoryx | someip | dds)
→ OSAL (clock, thread, process)
→ HAL
A platform change touches OSAL, HAL, bindings, and the deployment profile. Application code does not grow #ifdef SOC_X. EM calls OSAL process APIs and does not fork on its own.
10. Repository
One monorepo for now, because gf.sor.json ties the runtime, codegen, and the architect tools together. Board CI does not build the GUI tools. A schema change runs golden codegen and at least one multi-process end-to-end test. A customer vehicle project lives in its own repository and pins versions.
11. Four delivery rules
- Freeze the SOR subset before writing a generator
- Read-only replay before controllable injection
- One clock across the stack
- Write the binding and QoS mapping into the SOR
12. Milestones
| Acceptance | |
|---|---|
| M0 | Module matrix, SOR schema, import contract, and the SOA boundary reviewed |
| M1 | Desktop multi-process, three bindings, an OEM sample import, DAG review usable |
| M2 | EM and PHM recovery. A radar or IVI fault does not kill control |
| M3 | ROS via DDS, GTKWave, record and replay |
| M4 | At least one embedded Linux SoC. The production profile turns debug pieces off |
13. Risks
- Three stacks: plugins, and events first
- Too many processes: a decision table, and colocation where it fits
- OEM signal noise: a human mapping review, plus lint
- Diagrams drifting from code: tools read the SOR, and CI checks it
- Splitting repositories too early: stay in one repo