#!/bin/bash
# Identify top ROM consumers by BSW module
arm-none-eabi-nm --size-sort --print-size ECU_EPS.elf | tail -40
# Per-section breakdown
arm-none-eabi-size --format=sysv ECU_EPS.elf | sort -k2 -rn | head -30
# COM signal table is typically the #1 ROM consumer:
# _ZN3Com12signalTable_E .rodata 0x0800A000 0x4C00 (19.2 KB)
# Com_PBcfg_SignalInit .rodata 0x0800F000 0x3800 (14.0 KB)
# OS stack allocations:
# OsStack_Task_1ms .bss 0x20004000 0x0800 (2.0 KB)
# Python map file parser for CI budget gate:
python3 ci_map_budget.py --elf ECU_EPS.elf \
--budget "COM_PARTITION:65536" \
--budget "OS_STACKS:16384" \
--fail-on-exceed| Typical Top ROM Consumer | Size on 256KB ECU | Optimization Lever |
|---|---|---|
| COM signal init tables | 18–25 KB | Disable unused PDUs: ComIPduEnabled=FALSE |
| OS task stacks | 12–20 KB | Right-size with paint-pattern watermark |
| DEM event descriptors | 8–12 KB | Remove events for unsupported HW variants |
| DCM service table | 6–10 KB | Disable unused UDS services per variant |
| PduR routing tables | 4–8 KB | Post-build config moves these to PBcfg section |