@h2loop/autosar 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +4 -0
  2. package/agents/autosar-integrator.md +34 -2
  3. package/package.json +4 -1
  4. package/plugins/index.js +53 -23
  5. package/python/ecuc_engine/__init__.py +1 -1
  6. package/python/ecuc_engine/add_signal.py +351 -0
  7. package/python/ecuc_engine/arxml_edit.py +387 -0
  8. package/python/ecuc_engine/audit.py +328 -48
  9. package/python/ecuc_engine/cli.py +114 -5
  10. package/python/ecuc_engine/codegen/__init__.py +185 -0
  11. package/python/ecuc_engine/codegen/binding.py +210 -0
  12. package/python/ecuc_engine/codegen/bindings/sip_standin.json +111 -0
  13. package/python/ecuc_engine/codegen/cdiff.py +395 -0
  14. package/python/ecuc_engine/codegen/cwriter.py +150 -0
  15. package/python/ecuc_engine/codegen/emit.py +395 -0
  16. package/python/ecuc_engine/codegen/handles.py +89 -0
  17. package/python/ecuc_engine/codegen/mcal/tc4d.json +60 -0
  18. package/python/ecuc_engine/codegen/model.py +259 -0
  19. package/python/ecuc_engine/codegen/modules/__init__.py +7 -0
  20. package/python/ecuc_engine/codegen/modules/comstack.py +14 -0
  21. package/python/ecuc_engine/codegen/modules/dem.py +22 -0
  22. package/python/ecuc_engine/codegen/modules/mcal.py +170 -0
  23. package/python/ecuc_engine/codegen/modules/memstack.py +24 -0
  24. package/python/ecuc_engine/codegen/registry.py +133 -0
  25. package/python/ecuc_engine/codegen/schm_memmap.py +159 -0
  26. package/python/ecuc_engine/context.py +481 -0
  27. package/python/ecuc_engine/csrc.py +189 -0
  28. package/python/ecuc_engine/defs.py +30 -0
  29. package/python/ecuc_engine/find.py +162 -0
  30. package/python/ecuc_engine/gen.py +105 -0
  31. package/python/ecuc_engine/history.py +146 -0
  32. package/python/ecuc_engine/model.py +4 -1
  33. package/python/ecuc_engine/probe.py +229 -0
  34. package/python/ecuc_engine/rte_api.py +935 -0
  35. package/python/ecuc_engine/rules/__init__.py +5 -3
  36. package/python/ecuc_engine/rules/mem.py +84 -0
  37. package/python/ecuc_engine/rules/nvm.py +131 -0
  38. package/python/ecuc_engine/rules/pdur.py +87 -0
  39. package/python/ecuc_engine/rules/system.py +162 -0
  40. package/python/ecuc_engine/sysmodel.py +152 -0
  41. package/python/ecuc_engine/validate.py +15 -2
  42. package/python/ecuc_engine/verify_rte.py +445 -0
  43. package/python/pyproject.toml +1 -1
  44. package/skills/autosar/SKILL.md +47 -1
  45. package/skills/autosar/references/codegen.md +30 -0
  46. package/skills/autosar/references/project-layout.md +7 -1
  47. package/skills/autosar/references/runnable-code.md +50 -0
@@ -0,0 +1,50 @@
1
+ # Runnable code: allowed RTE API, verify, context
2
+
3
+ ## Three tiers of an RTE API name (AUTOSAR CP R25-11 SWS_RTE 5.6)
4
+ - **allowed** for runnable R: R has the access point the API's *Existence* requirement names. Only these may be
5
+ called from R and the functions it calls (SWS_Rte_CONSTR_09017/09083/...: "may only be used by the runnable that
6
+ contains the corresponding ..."). Shown in `autosar_build_context` section 3.
7
+ - **generated**: some runnable of the SW-C is allowed it, so it is in `Rte_<Swc>.h`. Calling it from another runnable
8
+ compiles but is wrong (NOT-ALLOWED).
9
+ - **derivable**: the port/element/IRV exists, but no runnable has the access point, so the API is not generated yet.
10
+
11
+ | API | Access point (role) | Existence | Signature |
12
+ |---|---|---|---|
13
+ | `Rte_Write_<p>_<o>` / `Rte_Send_<p>_<o>` | dataSendPoint, data / queued element | SWS_Rte_01280 / 01281 | SWS_Rte_01071 / 01072 |
14
+ | `Rte_Read_<p>_<o>` / `Rte_Receive_<p>_<o>` | dataReceivePointByArgument | SWS_Rte_01289 / 01288 | SWS_Rte_01091 / 01092 |
15
+ | `Rte_DRead_<p>_<o>` | dataReceivePointByValue (primitive) | SWS_Rte_07395 | SWS_Rte_07394 |
16
+ | `Rte_IRead[Ref]_<re>_<p>_<o>`, `Rte_IStatus_...` | dataReadAccess | SWS_Rte_01301 / 04578 / 02600 | SWS_Rte_03741 / 04577 / 02599 |
17
+ | `Rte_IWrite[Ref]_<re>_<p>_<o>`, `Rte_IInvalidate_...` | dataWriteAccess | SWS_Rte_01302 / 05510 / 03801 | SWS_Rte_03744 / 05509 / 03800 |
18
+ | `Rte_Call_<p>_<o>` / `Rte_Result_<p>_<o>` | (a)synchronousServerCallPoint / ...ResultPoint | SWS_Rte_01293/01294 / 01296 | SWS_Rte_01102 / 01111 |
19
+ | `Rte_Mode_<p>_<o>` / `Rte_Switch_<p>_<o>` | modeAccessPoint / modeSwitchPoint | SWS_Rte_02629 / 02632 | SWS_Rte_02628 / 02631 |
20
+ | `Rte_Prm_<p>_<o>` / `Rte_CData_<name>` | parameterAccess (port / local) | SWS_Rte_03929 / 01300 | SWS_Rte_03928 / 01252 |
21
+ | `Rte_IrvRead/IrvWrite_<re>_<o>` | read/writtenLocalVariable, explicit IRV | SWS_Rte_01305 / 01306 | SWS_Rte_03560 / 03565 |
22
+ | `Rte_IrvIRead/IrvIWrite[Ref]_<re>_<o>` | read/writtenLocalVariable, implicit IRV | SWS_Rte_01303 / 01304 | SWS_Rte_03550 / 03553 |
23
+ | `Rte_Pim_<name>` | any runnable | SWS_Rte_01299 | SWS_Rte_01118 |
24
+ | `Rte_Enter/Exit_<ea>` | canEnterExclusiveArea | SWS_Rte_01307 / 01308 | SWS_Rte_01120 / 01123 |
25
+
26
+ Parameter passing: IN primitive by value (SWS_Rte_01017), IN struct/union by `const T*` (01018, 07086), IN array as
27
+ pointer to the base type (05107); OUT always by pointer (01019, 07082, 05108); a struct/array return is a const
28
+ pointer (07071, 07072). Multiple instantiation adds `Rte_Instance self` first. `Rte_IsUpdated`, `Rte_Invalidate`,
29
+ `Rte_Feedback`, `Rte_IStatus` exist only with their ComSpec / InvalidationPolicy settings.
30
+
31
+ ## autosar_verify_rte
32
+ Each `Rte_*` call is mapped to its enclosing function and to every runnable whose SYMBOL reaches it through the call
33
+ graph (a static helper called from two runnables is checked for both). Statuses:
34
+ - **OK**.
35
+ - **NOT-ALLOWED**: rewrite with an allowed API, or add the access point to the runnable (ops given). For
36
+ `Rte_I*`/`Rte_Irv*` the runnable name is part of the API name: use the caller's.
37
+ - **INVENTED**: no such port/element/runnable, or the wrong API kind for the port's direction or the element's
38
+ data/event semantics (the hint names the right one). When new data is truly needed the ops add the data
39
+ element (to the port's interface — note other users of that interface) or a new port + interface, then the access
40
+ point. New element types default to the type of a same-named element elsewhere, else `uint8` (flagged).
41
+ After applying ops: `autosar_generate`, then verify again; then `autosar_build`. RTE lifecycle calls (`Rte_Start`, ...)
42
+ in integration code are listed as not checked.
43
+
44
+ ## autosar_build_context
45
+ Sections, in fixed order: 1 task, 2 SW-C definition, 3 allowed RTE API (exact header text), 4 runnable code,
46
+ 5 callees, 6 Com signals / NvM blocks behind its ports and calls, 7 FUZZY similar functions in other SW-Cs, 8 FUZZY
47
+ similar past git changes (ARXML semantic delta + C hunks, ranked by overlap with the task's ports/elements/words and
48
+ recency). Over budget (~4 chars/token): drop 8, drop 7, callees → prototypes, truncate code, truncate config,
49
+ callees → names, code → head, compact 2. Sections 1 and 3 are never reduced. Output is byte-identical for the same
50
+ inputs; the MANIFEST lists every source (file:line, sha1, included mode). Treat 7–8 as hints, never as truth.