Table of Contents
Fetching ...

TECS/Rust-OE: Optimizing Exclusive Control in Rust-based Component Systems for Embedded Devices

Nao Yoshimura, Hiroshi Oyama, Takuya Azumi

TL;DR

The paper tackles the overhead of exclusive control in TECS-based embedded systems by introducing TECS/Rust-OE, a memory-safe CBD framework that uses call-flow analysis to determine when exclusive control is needed. It generates Rust code from CDL-described components in two passes: the first applies generic exclusive control, and the second refines the code based on call-flow, generating optimized code and an RTOS configuration. The approach employs data structures with UnsafeCell and LockManager-backed exclusive controls to ensure memory safety while enabling selective synchronization; dummy constructs and dynamic reconfiguration remove unnecessary locks. Evaluations on STM32 hardware show no additional overhead compared to plain Rust and clear reductions in exclusive-control overhead, with hand-coding dropping to zero after optimization, underscoring high code reusability. The work advances memory-safe CBD for embedded systems and demonstrates practical gains in performance predictability and developer productivity through automated Rust code generation and optimization.

Abstract

The diversification of functionalities and the development of the IoT are making embedded systems larger and more complex in structure. Ensuring system reliability, especially in terms of security, necessitates selecting an appropriate programming language. As part of existing research, TECS/Rust has been proposed as a framework that combines Rust and component-based development (CBD) to enable scalable system design and enhanced reliability. This framework represents system structures using static mutable variables, but excessive exclusive controls applied to ensure thread safety have led to performance degradation. This paper proposes TECS/Rust-OE, a memory-safe CBD framework utilizing call flows to address these limitations. The proposed Rust code leverages real-time OS exclusive control mechanisms, optimizing performance without compromising reusability. Rust code is automatically generated based on component descriptions. Evaluations demonstrate reduced overhead due to optimized exclusion control and high reusability of the generated code.

TECS/Rust-OE: Optimizing Exclusive Control in Rust-based Component Systems for Embedded Devices

TL;DR

The paper tackles the overhead of exclusive control in TECS-based embedded systems by introducing TECS/Rust-OE, a memory-safe CBD framework that uses call-flow analysis to determine when exclusive control is needed. It generates Rust code from CDL-described components in two passes: the first applies generic exclusive control, and the second refines the code based on call-flow, generating optimized code and an RTOS configuration. The approach employs data structures with UnsafeCell and LockManager-backed exclusive controls to ensure memory safety while enabling selective synchronization; dummy constructs and dynamic reconfiguration remove unnecessary locks. Evaluations on STM32 hardware show no additional overhead compared to plain Rust and clear reductions in exclusive-control overhead, with hand-coding dropping to zero after optimization, underscoring high code reusability. The work advances memory-safe CBD for embedded systems and demonstrates practical gains in performance predictability and developer productivity through automated Rust code generation and optimization.

Abstract

The diversification of functionalities and the development of the IoT are making embedded systems larger and more complex in structure. Ensuring system reliability, especially in terms of security, necessitates selecting an appropriate programming language. As part of existing research, TECS/Rust has been proposed as a framework that combines Rust and component-based development (CBD) to enable scalable system design and enhanced reliability. This framework represents system structures using static mutable variables, but excessive exclusive controls applied to ensure thread safety have led to performance degradation. This paper proposes TECS/Rust-OE, a memory-safe CBD framework utilizing call flows to address these limitations. The proposed Rust code leverages real-time OS exclusive control mechanisms, optimizing performance without compromising reusability. Rust code is automatically generated based on component descriptions. Evaluations demonstrate reduced overhead due to optimized exclusion control and high reusability of the generated code.

Paper Structure

This paper contains 14 sections, 4 figures, 1 table.

Figures (4)

  • Figure 1: System model.
  • Figure 2: Data structure of Rust code considering exclusive control.
  • Figure 3: Example of trait impl code.
  • Figure 4: Evaluation Time of SPIKE-RT APIs.