Submitted:
04 October 2023
Posted:
06 October 2023
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Related Works
-
B. Schlich studies a new method for verifying the assembly code of model checking software for microcontrollers [4]. A simulator based on static analysis constructs a state space, abstracts time, handles non-determinism, and over-approximates the behavior exhibited by the actual microcontroller. On the other hand, our previous paper has developed a model checker that uses static and dynamic analysis, such as undefined values [5]. This paper and the reference [4] adopt different approaches as follows. In the reference, when the model checker requests a successor to a state it has not yet generated, the state space generates the successor on the fly using the simulator. In this paper, the verification system completes the state transition system and passes it to the simulator.This article generates the entire CFG upfront. The latter is bette [4]r and we will achieve it in the future.
- Matthew Kuo and others [9] calculate the Worst-Case Response Time (WCRT) using reachability to analyze the assembly code. However, the model is different from our study, Matthew Kuo and others generate TCCFG (Timed Concurrent Control Flow Graph) by static analysis from each assembly code, but we verify microcontrollers that run on a single thread and perform model checking.
- Wu Yajun [10] defined a timed Kripke structure and verified its real-time nature. Timed Kripke structure is nondeterministic finite automaton but it is not appropriate for our study because its model does not hold the instruction element of the program. We have to control a model by the value of the program counter and the edges should hold the instruction.
- R. Alur and D. L. Dill studied timed automata [11]. Timed automaton is an extension of a finite state automaton and is a model that describes the system by both discrete event and continuous time-lapse according to state transitions. On the other hand, in this study, we develop timed CFA for the execution time of assembly program. Our study is different from timed automata. The proposed structure deals with discrete time in our study, and we use the execution time of each instruction of the assembly program in each state.
- The previous study in reference [12] reduces timer interrupts to include real-time performance. On the other hand, this study differs in that it does not consider real-time performance but defines the algorithm more concretely and conducts experiments using multiple timer interrupts in a case study.
- Recently, L. Lihao et al. proposed an efficient verification of low-level embedded C software with interrupts based on partial-order coding and symbolic execution [13]. On the other hand, this paper verifies an assembly program with an algorithm that also reduces timer interrupts based on the reduction of the number of interrupt handlers by IHER; if the method of Lihao Liang et al. is adopted, nested interrupts can be handled effectively in this paper.
3. IHER
-
Detect dependencies between IHsStep 1 performs when two or more IHs exist. IH depend on each other if either of the following conditions is true. Access here means both writing and reading.
- one IH enables or disables the other IH,
- one IH writes to a memory location accessed by the other IH, or
- one IH writes to the memory location used in an atomic proposition (AP).
Examples of APs include a variable being equal to a certain value. IHs that manipulate the memory location of an AP manipulate the core of the program. So, It is therefore necessarily associated with all IHs. In other words, only one IH is mentioned, and if one IH writes the memory location used by the AP, then all IHs are dependent on each other. -
Detect dependencies between program locations and IHsstep 2 shows the conditions under which two labels, the label and the label, are attached on locations to detect dependencies between the program and IH. An label allows the execution of an IH executed after the execution of the program instruction. On the other hand, the label denotes that there exists a dependency between that program location and an IH, and therefore, this IH needs to be executed before the instruction at that location is executed. In determining the label, we assume that program location k is a direct predecessor of program location l. Let program location k be a direct predecessor of program location l. Formally, for each , l is labeled with if one of the following conditions is satisfied:
- k enables or disables i,
- k writes a memory location that i accessed, or
- k writes a memory location that is used in an AP.
Also, for each IH, a program location l is labeled with if one of the following conditions is satisfied.- i writes a memory location that l accessed,
- l enables or disables i,
- l writes a memory location that i accessed, or
- l writes a memory location that is used in an AP.
-
Refine resultsStep 3 performs refinement on the label. Each label is moved until one of the following conditions is satisfied.
- a program location labeled with is reached,
- a loop entry is found, or
- a loop exit is found.
-
Label blocking locationsIn the last step, all program node positions are labeled IH. At this point IH, we assign a label to any location without an label.
4. Formal Model of an Assembly Program
- -
- L : a set of program locations,
- -
- : L, and the initial location of the program,
- -
- O : a finite set of instructions in main (non-interrupt),
- -
- I : a finite set of executinos of interrupt handlers,
- -
- T : execution times such as OT and IT of each instruction in O and I at each program location,
- -
- → : →⊆, the set of transition relations.
5. Proposed Method of timed IHER
5.1. Verification system

5.2. Algorithm
| Algorithm 1:Timed IHER |
![]() |
![]() |
5.3. Example
5.4. The correctness of timed IHER
6. Experiment
7. Conclusions
References
- Edmund, M. Clarke Jr., Orna Grumberg, Doron Peled. Model Checking. The MIT Press, 1999.
- Schlich, B.; Kowalewski, S. Model checking C source code for embedded systems. Int. J. Softw. Tools Technol. Transf. 2009, 11, 187–202. [Google Scholar] [CrossRef]
- Bastian Schlich, Thomas Noll, Jorg Brauer, and Lucas Brutschy. Reduction of interrupt handler executions for model checking embedded software. In Haifa Verification Conference, pp. 5?20. Springer, 2009.
- Schlich, B. Model Checking of Software for Microcontrollers. ACM Trans. Embed. Comput. Syst. 2010, 9, 1–27. [Google Scholar] [CrossRef]
- Yamane, S.; Konoshita, R.; Kato, T. Model checking of embedded assembly program based on simulation. IEICE Trans. Inf. Syst. 2017, 100, 1819–1826. [Google Scholar] [CrossRef]
- Schlich, B.; Brauer, J.; Kowalewski, S. Application of static analyses for state-space reduction to the microcontroller binary code. Sci. Comput. Program 2011, 76, 100–118. [Google Scholar] [CrossRef]
- Armando, A.; Mantovani, J.; Platania, L. Bounded model checking of software using SMT solvers instead of SAT solvers. Int. J. Softw. Tools Technol. Transf. 2009, 11, 69–83. [Google Scholar] [CrossRef]
- Yamane, Satoshi; Kobashi, Junpei; Uemura, Kosuke. Verification Method of Safety Properties of Embedded Assembly Program by Combining SMT-Based Bounded Model Checking and Reduction of Interrupt Handler Executions. Electronics, 2020, 9.7: 1060.
- Matthew Kuo, Roopak Sinha, and Partha Roop. 2011. Efficient WCRT analysis of synchronous programs using reachability. In Proceedings of the 48th Design Automation Conference (DAC ’11). Association for Computing Machinery, New York, NY, USA, 480?485.
- Wu, Yajun, and Satoshi Yamane. "Model Checking of Real-Time Properties for Embedded Assembly Program Using Real-Time Temporal Logic RTCTL and Its Application to Real Microcontroller Software." IEICE TRANSACTIONS on Information and Systems 103.4 (2020): 800-812.
- Alur, Rajeev, and David Dill. "The theory of timed automata." Real-Time: Theory in Practice: REX Workshop Mook, The Netherlands, ?7, 1991 Proceedings. Springer Berlin Heidelberg, 1992. 3 June.
- KIRIYAMA, Taro; WU, Yajun; YAMANE, Satoshi. Reduction of Timer Interrupts for Embedded Assembly Programs Based on Reduction of Interrupt Handler Executions. In: 2021 IEEE 10th Global Conference on Consumer Electronics (GCCE). IEEE, 2021. p. 464-466.
- Liang, L.; Melham, T.; Kroening, D.; Schrammel, P.; Tautschnig, M. Effective Verification for Low-Level Software with Competing Interrupts. ACM Trans. Embed. Comput. Syst. 2018, 17, 36:1–36:26. [Google Scholar] [CrossRef]
- Peled, D. : Ten years of partial order reduction. In: Y. Vardi, M. (ed.) CAV 1998. LNCS, vol. 1427, pp. 17?28. Springer, Heidelberg (1998).
- Browne, M.C.; Clarke, E.M.; Grumberg, O. Characterizing Finite Kripke Structures in Propositional Temporal Logic. Theor. Comput. Sci. 1988, 59, 115–131. [Google Scholar] [CrossRef]
- Dirk Beyer, Thomas A Henzinger, Ranjit Jhala, and Rupak Majumdar, The software model checker blast. International Journal on Software Tools for Technology Transfer, Vol. 9, No. 5-6, pp. 505 525, 2007.
- Muchnick, S. Advanced Compiler Design and Implementation; Morgan Kaufmann Publishers Inc.: Burlington, MA, USA, 1997. [Google Scholar]
- Aho, A.V.; Sethi, R.; Ullman, J.D. Compilers: Principles, Techniques and Tools, 2 Revised ed of International ed.; Pearson: London, UK, 2006. [Google Scholar]
- Toth, T.; and Majzik, I. : Formal Modeling of Real-Time Systems with Data Processing. In Pataki, B., editor(s), Proceedings of the 23rd PhD Mini-Symposium, pages 46-49, 2016.
- Andreas Ermedahl, Jakob Engblom: Execution Time Analysis for Embedded Real-Time Systems. 2007.
- Gang Hou, Weiqiang Kong, Kuanjiu Zhou, Jie Wang, Xun Cao, Akira Fukuda: Analysis of Interrupt Behavior Based on Probabilistic Model Checking. IIAI-AAI 2018: 86-91.
- Corporation, R. E. : Renesas Electronics, Renesas Electronics Corporation (online), http://japan.renesas.com/.
- JFlex-The Fast Scanner Generator for Java. 2015. Available online: http://jflex.de/ (accessed on 3 September 2022).
- BYACC/J Java Extension. 2013. Available online: http://byaccj.sourceforge.net/ (accessed on 3 September 2022).
- van Glabbeek, R., Weijland, W.: Branching time and abstraction in bisimulation semantics. Journal of the ACM 43(3), 555-600 (1996).
- ZMP Inc. Nuvo R WHEEL. 2010. Available online: https://robot.watch.impress.co.jp/cda/news/2006/07/12/81.html (accessed on 3 September 2022).





| OS | macOS Monterey 12.4 |
| CPU | Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz |
| Memory | 8GB |
| Java | 11.0.4 |
| Program | 12000lines |
| case | TI | SI | Without | Without | Reduction | ||
| Timed | Timed | Timed | Timed | ||||
| IHER | IHER | IHER | IHER | ||||
| (required | (execution | (required | (execution | ||||
| memory(kb)) | time(s)) | memory(kb)) | time(s)) | ||||
| 1 | 2 | 0 | 117448 | 1889.6 | 7134 | 997.2 | 94% |
| 2 | 1 | 158747 | 2125.8 | 8049 | 1075.2 | 95% | |
| 2 | 1 | 1 | 20260 | 304.3 | 8624 | 280.4 | 57% |
| 2 | 0 | 26324 | 253.8 | 10520 | 131 | 60% | |
| 3 | 2 | 0 | 2160677 | 45032.7 | 204433 | 25032.7 | 91% |
| 2 | 1 | 2528550 | 52042 | 573202 | 32051.3 | 77% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

