A PROMELA model of FreeRTOS kernel.
- the Spin model checker (on Ubuntu)
or (source code)
apt install spin
git 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_dfs
if the default target is set inmk/config.mk
. Changesafety_dfs
tosafety_bfs
to 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 acceptance
if the default target is set.- Some applications have a correction. Append term
CORRECTION=1
behind a verificationmake
command to apply it. - We provide a script
./scripts/verify_all.sh
to perform verification to all the applications inDemo
folder. Results are stored in./output
folder. 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. Usegrep
command to highlight key words. For example:
make trail J=<<N_STEPS>> U=<<Nth_STEP>> | grep <<KEY_WORDS>>