-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This harness verifies RMI_VERSION's behaviors using model checking. Usage) (in islet/model-checking) $ RMI_TARGET=rmi_version make verify Signed-off-by: Changho Choi <ch754.choi@samsung.com>
- Loading branch information
Showing
8 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use islet_rmm::monitor::Monitor; | ||
use islet_rmm::rmi; | ||
|
||
#[kani::proof] | ||
#[kani::unwind(4)] | ||
fn verify_version() { | ||
// Initialize registers (symbolic input) | ||
let regs: [usize; 8] = kani::any(); | ||
kani::assume(regs[0] == rmi::VERSION); | ||
|
||
// Pre-conditions | ||
let no_failures_pre = true; | ||
|
||
// Execute command and read the result. | ||
let out = Monitor::new().run(regs); | ||
let result = out[0]; | ||
let lower = out[1]; | ||
let higher = out[2]; | ||
|
||
// Result assertion | ||
let prop_result_ante = no_failures_pre; | ||
|
||
kani::cover!(); | ||
if prop_result_ante { | ||
let prop_result_cons = (lower == (rmi::ABI_MAJOR_VERSION << 16) | rmi::ABI_MINOR_VERSION) | ||
&& (higher == (rmi::ABI_MAJOR_VERSION << 16) | rmi::ABI_MINOR_VERSION); | ||
|
||
kani::cover!(); | ||
assert!(prop_result_cons); | ||
} | ||
|
||
kani::cover!(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters