AoU: ETAS_RTACAR_SM_OS_102 ************************** The ETAS_RTACAR_SM_OS_102 AoU requires that all extended tasks are implemented as endless loops around any calls to ``WaitEvent()``. An extended task that is not structured as an endless loop may terminate unexpectedly. Calling ``WaitEvent()`` outside an infinite loop means the task body executes only once: after the first ``WaitEvent()`` returns, execution falls through the end of the task entry-point function and the task terminates. This is a violation of the AUTOSAR OS model for extended tasks and may cause undefined behaviour in safety-relevant systems. Events and the ``WaitEvent`` API are exclusively used by extended tasks. If the project does not use extended tasks at all, no events are declared and no ``WaitEvent`` calls are made, so the AoU is trivially satisfied. Verification Approach ===================== The verification is performed by analyzing the OS ECUC configuration files (ARXML) provided via the ``--os-arxml`` parameter or discovered in the project directory specified by ``--dir``. The tool performs the following steps: 1. **Configuration Loading**: Parses the ARXML files to extract the OS configuration, including task definitions and their properties. 2. **Extended Task Detection**: Identifies tasks configured as extended tasks (tasks that reference events via ``OsTaskEventRef``). 3. **Scalability Class Validation**: Checks that the ``OsScalabilityClass`` parameter is consistent across all configuration files. If incompatible values are detected, manual verification is required. 4. **Result Reporting**: Generates one of the following results based on the analysis outcome. .. important:: Automated Verification Scope The current implementation **detects** the presence of extended tasks in the ECUC configuration but does **not yet implement full automated verification** that all extended tasks are implemented as endless loops around any calls to ``WaitEvent()``. When extended tasks are detected, the tool reports a **review** result, requiring manual verification that: - Every extended task entry-point function contains an outer infinite loop (``while(1)``, ``for(;;)``, or equivalent). - All calls to ``WaitEvent()`` are reachable only from within that infinite loop. This manual verification must confirm compliance with the complete AoU requirement as stated in the RTA-CAR Safety Manual. ARXML Configuration Requirements ================================ To enable this check, the OS ECUC configuration must be provided in AUTOSAR ARXML format. The tool analyzes: - **Task definitions** (``OsTask`` containers) to identify extended tasks - **Event references** (``OsTaskEventRef``) to determine which tasks are extended - **Scalability class settings** (``OsScalabilityClass``) to ensure configuration consistency .. include:: ../rules/ETAS_RTACAR_SM_OS_102.rst See Also ======== - :ref:`os_command_options` for information on providing ARXML files via ``--os-arxml`` or ``--dir`` - :cite:t:`ETAS_SM` section on extended task implementation requirements and the WaitEvent API - :cite:t:`AUTOSAR` specification for extended task scheduling semantics