A model-based I/O interface synthesis framework for the cross-platform software modeling

BaekGyu Kim, Linh T. X. Phan, Insup Lee, Oleg Sokolsky

TL;DR

This paper introduces a framework for automatically generating I/O interfaces that bridge the semantic gap between platform-independent software models and platform-specific hardware. This ensures that software developed using high-level models can be reliably integrated with real-world embedded systems, reducing manual effort and improving traceability.

What Problem Does This Paper Address?

Developing software for embedded systems often involves creating high-level models that are then automatically translated into executable code. However, a significant challenge arises during integration: the communication semantics assumed by the abstract model (e.g., instantaneous, synchronous communication) often differ from how the actual hardware platform handles communication (e.g., with delays, asynchronous events). This mismatch necessitates manual "glue code" to adapt the two, which is error-prone and hard to trace back to the original model. Furthermore, some model semantics might be impossible to implement directly on a given platform, requiring careful relaxation. This paper addresses the need for a systematic, model-driven approach to generate these crucial I/O interfaces, ensuring correct and traceable integration.

Methods

The core of the paper is a framework for synthesizing I/O interfaces. This involves:

  • Interface Policy Definition: A novel concept called an "interface policy" is introduced. This policy explicitly captures the necessary information to adapt the model's communication semantics to the platform's. It's defined by a tuple including:
  • Delay: Maximum permissible delay.
  • Bufsize: Buffer size (finite or infinite).
  • Overrun: How to handle buffer overflow (overwrite, drop, disallow).
  • Access: Permissions for different components (Input-Device, Software, Output-Device) to access buffers.
  • Semantic Classification: The paper categorizes external communication semantics into four types: synchronous input, synchronous output, asynchronous input, and asynchronous output.
  • System Boundary Separation: The framework uses a four-variable model (monitored, controlled, input, output) to formally define the system boundary between the platform-independent software and the input/output devices.
  • Interface Synthesis: Based on the extracted external I/O from the model and the defined interface policies, the framework systematically synthesizes:
  • I/O Interfaces: These act as intermediaries, containing FIFO buffers for each communication variable.
  • Interface APIs: A set of read() and write() methods that allow the platform-independent software and platform-dependent code to communicate.
  • Customization for Implementability: The interface policy allows for the relaxation of model semantics (e.g., introducing delays, limiting buffer sizes) to make them implementable on real hardware, while maintaining traceability.

Datasets

Not discussed in the paper. The paper uses a case study of a Generic PCA (GPCA) infusion pump system for illustration and evaluation.

Key Insights and Ideas

  • Explicitly Defining the Semantic Gap: The paper highlights that the "semantic gap" isn't just about data formats but about the timing and synchronization assumptions of communication.
  • Interface Policy as a Contract: The interface policy acts as a formal contract between the model's assumptions and the platform's realities, making the adaptation explicit and manageable.
  • Traceability Through Synthesis: By generating interfaces directly from the model and policies, the system ensures that the implemented behavior is traceable to the original, verified model, enhancing safety and reliability.
  • Handling Non-Implementable Semantics: The framework provides a structured way to codify and manage relaxations of model semantics, crucial for real-world deployment where ideal conditions rarely exist.
  • Reducing Manual Glue Code: The systematic synthesis of I/O interfaces significantly reduces the need for error-prone, ad-hoc glue code, leading to more robust integration.

Key Results

The paper demonstrates the framework's applicability through a case study of an infusion pump system. The key result is the successful synthesis of I/O interfaces and APIs that enable platform-independent software to communicate with platform-dependent device drivers. The generated interfaces enforce the specified interface policies, including handling timeouts and buffer management, thereby ensuring that communication adheres to the adapted semantics. The framework's ability to manage relaxed semantics, like introducing a 100ms delay for bolus requests and allowing a buffer of 5 pending requests, is also demonstrated.

Limitations and Future Work

  • Assumption of Annotated Environment Model: The framework relies on the environment model being a priori annotated to distinguish external communication.
  • Platform-Dependent Exception Handling: While the framework identifies exceptions (e.g., timeout, invalid access), the actual implementation of exception handlers is platform-dependent and outside the scope of this paper.
  • Future Work: The authors plan to extend the framework to synthesize I/O interfaces for distributed code generation, where multiple models are deployed across physically distributed systems. They also aim to explore how relaxed semantics affect the safety properties of the platform-independent code.

Summary updated

Abstract

In model-based development, executable software (e.g., C or Java code) can be generated from a high-level model using a code generator. However, the execution of the generated software on a target platform remains a challenge due to a mismatch in communication semantics assumed by the model and the platform-dependent software (e.g., sampling/actuation routines). This paper proposes an input/output (I/O) interface module that bridges this semantic gap by means of buffers and interface policies, which explicitly capture the information required to adapt the model's communication semantics to that of the platform. We present a framework that can be used to systematically synthesize - directly from the model - the I/O interfaces and accompanying APIs that the generated software and the platform-dependent software need to communicate with one another. Our interface policies can also encode relaxations of a model semantics that may not be implementable, thus making derivations of the implemented systems from the model traceable. We illustrate the applicability and the benefits of our framework with a case study of an infusion pump.
BibTeX
@inproceedings{kim2012model,
  author = {BaekGyu Kim and Linh T. X. Phan and Insup Lee and Oleg Sokolsky},
  title = {{A model-based I/O interface synthesis framework for the cross-platform software modeling}},
  booktitle = {RSP},
  year = {2012},
  doi = {10.1109/rsp.2012.6380685},
}

Loading related content...

Figure