Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
d7020e_srp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
d7020e
d7020e_srp
Commits
1f305471
Commit
1f305471
authored
8 years ago
by
Henrik Tjäder
Browse files
Options
Downloads
Plain Diff
Merge branch 'klee' of gitlab.henriktjader.com:d7020e/d7020e_srp into klee
parents
020e9783
63e74303
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.c
+16
-6
16 additions, 6 deletions
src/main.c
with
16 additions
and
6 deletions
src/main.c
+
16
−
6
View file @
1f305471
//#define KLEE
//#define KLEE
#define KLEE_WCET
//
#define KLEE_WCET
#ifdef KLEE
#ifdef KLEE
#include
"SRP_klee.h"
#include
"SRP_klee.h"
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
// resource ceilings
// resource ceilings
#define r1_Ceiling 2
#define r1_Ceiling 2
#define r2_Ceiling
1
#define r2_Ceiling
3
// Analysis variables
// Analysis variables
static
volatile
int
state
;
static
volatile
int
state
;
...
@@ -49,7 +49,7 @@ static int job;
...
@@ -49,7 +49,7 @@ static int job;
void
work
(
int
i
)
void
work
(
int
i
)
{
{
volatile
int
k
=
0
;
volatile
int
k
=
0
;
for
(
int
j
=
0
;
j
<
10
0
*
i
;
j
++
)
for
(
int
j
=
0
;
j
<
5
0
*
i
;
j
++
)
{
{
k
++
;
k
++
;
}
}
...
@@ -86,16 +86,26 @@ TASK(j2)
...
@@ -86,16 +86,26 @@ TASK(j2)
TRACE
(
"j2_r1_locked
\n
"
);
TRACE
(
"j2_r1_locked
\n
"
);
work
(
5
);
work
(
5
);
UNLOCK
(
r1
);
UNLOCK
(
r1
);
if
(
state
==
100
)
{
work
(
2
);
}
else
{
work
(
1
);
}
TRACE
(
"j2_exit
\n
"
);
TRACE
(
"j2_exit
\n
"
);
}
}
TASK
(
j3
)
TASK
(
j3
)
{
{
TRACE
(
"j3_enter
\n
"
);
TRACE
(
"j3_enter
\n
"
);
LOCK
(
r1
);
LOCK
(
r2
);
TRACE
(
"j3_r1_locked
\n
"
);
TRACE
(
"j3_r2_locked
\n
"
);
work
(
1
);
work
(
1
);
UNLOCK
(
r
1
);
UNLOCK
(
r
2
);
JOB_REQUEST
(
j1
);
JOB_REQUEST
(
j1
);
TRACE
(
"j3_exit
\n
"
);
TRACE
(
"j3_exit
\n
"
);
}
}
...
...
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