A PROMELA model of FreeRTOS kernel.
- the Spin model checker (on Ubuntu)
or (source code)
apt install spingit clone https://github.com/nimble-code/Spin.git cd Spin && make
-
Check free RAM on your machine and set the memory limitation in
mk/config.mk. By default, memory usage is bounded to 20GB. Also, set max search depth if the verification reaches the max depth. There are some predefined depth configurations below. -
Check configurations in
platform/stm32p103_FreeRTOSConfig.pml, especially the configurations of scheduling policies. Check architecture inFreeRTOS.pml. -
Perform verification
- Safety verification (depth-first search algorithm)
make safety_dfs TARGET=Demo/<<APP_NAME>>or simply
make safety_dfsif the default target is set inmk/config.mk. Changesafety_dfstosafety_bfsto perform the verification with the breadth-first search algorithm.- Liveness verification (LTL formulas are defined in
./Demo/property/)
make acceptance TARGET=Demo/<<APP_NAME>>or simply
make acceptanceif the default target is set.- Some applications have a correction. Append term
CORRECTION=1behind a verificationmakecommand to apply it. - We provide a script
./scripts/verify_all.shto perform verification to all the applications inDemofolder. Results are stored in./outputfolder. Usages:
./scripts/verify_all [-dfs|-bfs|-ltl] [-correction] -
Trace a counterexample.
- Simple (for safety verification only)
make trail- Full (for safety verification only)
make trail_full- Full (for acceptance verification only)
make trail_ltl- Use
J=<<N_STEPS>>to jump over N steps andU=<<Nth_STEP>>to stop the trail at Nth setp. Usegrepcommand to highlight key words. For example:
make trail J=<<N_STEPS>> U=<<Nth_STEP>> | grep <<KEY_WORDS>>