| Step | Activity | Constraint to Satisfy |
|---|---|---|
| 1 | Allocate 15 functions to 4 ECUs | All ASIL constraints satisfied |
| 2 | Compute resource budgets | All ECUs < 70% CPU; < 80% ROM/RAM |
| 3 | Optimise: reduce BOM cost by moving functions | Maintain ASIL; reduce ECU count if possible |
Lab: Function Distribution Exercise
Exercise 1: Allocation and Constraint Check
"""Function distribution exercise: allocate and check constraints."""
ECUS = [
{"id":"ECU_HPC", "name":"HPC (NVIDIA Orin)", "max_asil":"ASIL-B", "cpu":254000, "rom_kb":65536, "ram_kb":16384},
{"id":"ECU_ZONE_F", "name":"Zone ECU Front (S32K3)","max_asil":"ASIL-D","cpu":200, "rom_kb":4096, "ram_kb":512},
{"id":"ECU_ZONE_R", "name":"Zone ECU Rear (S32K3)", "max_asil":"ASIL-D","cpu":200, "rom_kb":2048, "ram_kb":256},
{"id":"ECU_GW", "name":"Gateway (S32G3)", "max_asil":"ASIL-B","cpu":800, "rom_kb":8192, "ram_kb":2048},
]
FUNCTIONS = [
{"id":"F-001","name":"Camera Object Detection", "asil":"ASIL-B","cpu":80000,"rom_kb":8192,"ram_kb":4096},
{"id":"F-002","name":"Radar Target Fusion", "asil":"ASIL-B","cpu":12000,"rom_kb":512, "ram_kb":256},
{"id":"F-003","name":"AEB Brake Request", "asil":"ASIL-B","cpu":5, "rom_kb":128, "ram_kb":32},
{"id":"F-004","name":"EPS Torque Monitor", "asil":"ASIL-D","cpu":18, "rom_kb":256, "ram_kb":64},
{"id":"F-005","name":"Window Lift Control", "asil":"QM", "cpu":3, "rom_kb":64, "ram_kb":16},
{"id":"F-006","name":"Infotainment HMI", "asil":"QM", "cpu":50000,"rom_kb":4096,"ram_kb":2048},
{"id":"F-007","name":"OTA Update Manager", "asil":"QM", "cpu":50, "rom_kb":512, "ram_kb":256},
{"id":"F-008","name":"SOME/IP Service Discovery", "asil":"QM", "cpu":100, "rom_kb":256, "ram_kb":128},
{"id":"F-009","name":"Diagnostic Gateway UDS", "asil":"QM", "cpu":80, "rom_kb":512, "ram_kb":128},
]
ASIL_ORDER = {"QM":0,"ASIL-A":1,"ASIL-B":2,"ASIL-C":3,"ASIL-D":4}
def check_allocation(allocation: dict) -> list:
"""allocation: {func_id: ecu_id}. Returns list of violations."""
violations = []
ecu_map = {e["id"]: e for e in ECUS}
func_map = {f["id"]: f for f in FUNCTIONS}
for fid, eid in allocation.items():
f = func_map[fid]; e = ecu_map[eid]
if ASIL_ORDER[f["asil"]] > ASIL_ORDER[e["max_asil"]]:
violations.append(f"{fid} ASIL {f['asil']} > ECU max {e['max_asil']}")
return violations
# Proposed allocation -- exercise: can you do better?
ALLOCATION = {
"F-001": "ECU_HPC", "F-002": "ECU_HPC",
"F-003": "ECU_ZONE_F", "F-004": "ECU_ZONE_F",
"F-005": "ECU_ZONE_F", "F-006": "ECU_HPC",
"F-007": "ECU_GW", "F-008": "ECU_GW",
"F-009": "ECU_GW",
}
violations = check_allocation(ALLOCATION)
print(f"Constraint violations: {violations if violations else 'None -- allocation valid'}")Summary
The function distribution exercise reveals the typical trade-offs in automotive allocation decisions. The EPS Torque Monitor (ASIL-D) can only be allocated to Zone ECU Front (max ASIL-D) -- it cannot be co-located with the HPC (max ASIL-B) without additional ASIL decomposition. The Camera Object Detection function (80,000 MIPS) can only run on the HPC -- no zone ECU has enough compute. These hard constraints reduce the allocation design space significantly; the optimisation then focuses on the remaining degrees of freedom: can the OTA Manager and Diagnostic Gateway move to the same ECU? Can a zone ECU be eliminated by consolidating functions? The constraint checker script makes these decisions systematic rather than intuitive.
🔬 Deep Dive — Core Concepts Expanded
This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.
Key principles to reinforce:
- Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
- Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
- Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.
🏭 How This Topic Appears in Production Projects
- Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
- Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
- Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.
⚠️ Common Mistakes and How to Avoid Them
- Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
- Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
- Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
- Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.
📊 Industry Note
Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.