xDEVS no_std: A Rust Crate for Real-Time DEVS on Embedded Systems
Román Cárdenas, Pedro Malagón, Patricia Arroba, José L. Risco‐Martín · 2024
Modeling and Simulation (M&S) plays a crucial role in the design and analysis of complex systems, with the Discrete EVent System specification (DEVS) formalism being a widely adopted mathematical framework. This paper introduces xDEVS no_std, the first version of xDEVS written in the Rust programming language’s no_std environment. Rust’s features, including a data ownership mechanism, enable the development of high-performance, memory-safe simulations. xDEVS no_std focuses on Real-Time (RT) simulation for safety-critical embedded applications, leveraging Rust’s abstractions to simplify code sharing and cross-compilation. The paper outlines the implementation design and Application Programming Interface (API), which facilitates the creation of both atomic and coupled DEVS models. The RT simulator integrates with hardware, handling external interrupts and enabling interactions with the embedded system. A use case on a RISC-V microcontroller demonstrates xDEVS no_std’s capabilities, illustrating how it can effectively orchestrate tasks of Cyber-Physical System (CPS) on embedded platforms.