Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cortex-m-rtfm-klee
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KLEE
cortex-m-rtfm-klee
Commits
4908ee36
Commit
4908ee36
authored
7 years ago
by
Per
Browse files
Options
Downloads
Patches
Plain Diff
fixup
parent
f2d8ba03
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/resource.rs
+19
-6
19 additions, 6 deletions
examples/resource.rs
with
19 additions
and
6 deletions
examples/resource.rs
+
19
−
6
View file @
4908ee36
...
...
@@ -51,8 +51,7 @@ fn exti1(t: &mut Threshold, EXTI1::Resources { X, mut Y }: EXTI1::Resources) {
Y
.claim_mut
(
t1
,
|
y
,
_
|
{
if
*
x
<
10
{
for
_
in
0
..*
x
{
//*y += 1;
*
y
=
(
*
y
)
.wrapping_add
(
1
);
*
y
+=
1
;
}
}
});
...
...
@@ -63,8 +62,7 @@ fn exti1(t: &mut Threshold, EXTI1::Resources { X, mut Y }: EXTI1::Resources) {
fn
exti2
(
t
:
&
mut
Threshold
,
mut
r
:
EXTI2
::
Resources
)
{
r
.Y
.claim_mut
(
t
,
|
y
,
_
|
{
if
*
y
<
10
{
//*y += 1;
*
y
=
(
*
y
)
.wrapping_add
(
1
);
*
y
+=
1
;
}
else
{
*
y
-=
1
;
}
...
...
@@ -74,8 +72,7 @@ fn exti2(t: &mut Threshold, mut r: EXTI2::Resources) {
#[allow(non_snake_case)]
fn
exti3
(
t
:
&
mut
Threshold
,
mut
r
:
EXTI3
::
Resources
)
{
r
.X
.claim_mut
(
t
,
|
x
,
_
|
{
//*x += 1;
*
x
=
(
*
x
)
.wrapping_add
(
1
);
*
x
+=
1
;
});
}
...
...
@@ -499,3 +496,19 @@ fn idle() -> ! {
//
// Can you come up with a case where --release mode based analysis would miss cricital cases.
// ** your answer here, --- actually a research question, we will discuss in class --- **
//
// On a side note.
// Rust in --release mode makes the job for KLEE much easier. Look the number of instuctions carried out.
// In dev/debug you had som 10 000 instuctions executed for generating the test cases.
// In --relesase you had 34!!!!!
//
// This vastly improves on the performance of analysis, allowing larger applications to be scrutenized.
// The code we looked at here was by intention simple (to facilitate inspection).
// However, the code is NOT trivial, under the hood it utilizes advanced language features, such as
// closures and intence use of abstractions, such as Traits/genecics etc. It indeed covers a large
// degree of the Rust, for which it demonstrates that our approach to based program analysis
// actually works.
//
// For the future we intend the framework to cover the reading and writing to peripherals, and the
// sequenced access to resources. In class we will further discuss current limitations, and
// oportunitios to improvements.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment