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
d8f29ea3
Commit
d8f29ea3
authored
8 years ago
by
Henrik Tjäder
Browse files
Options
Downloads
Patches
Plain Diff
Autoformat main
parent
9fc20c8c
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
+113
-103
113 additions, 103 deletions
src/main.c
with
113 additions
and
103 deletions
src/main.c
+
113
−
103
View file @
d8f29ea3
...
...
@@ -46,21 +46,27 @@
static
volatile
int
state
;
static
int
job
;
void
work
(
int
i
)
{
void
work
(
int
i
)
{
volatile
int
k
=
0
;
for
(
int
j
=
0
;
j
<
100
*
i
;
j
++
)
{
for
(
int
j
=
0
;
j
<
100
*
i
;
j
++
)
{
k
++
;
}
}
TASK
(
j1
)
{
TASK
(
j1
)
{
TRACE
(
"j1_enter
\n
"
);
LOCK
(
r2
);
JOB_REQUEST
(
j2
);
// job execution request for j2
if
(
state
>
0
)
{
if
(
state
>
0
)
{
work
(
10
);
}
else
{
}
else
{
work
(
5
);
}
...
...
@@ -73,7 +79,8 @@ TASK(j1) {
UNLOCK
(
r2
);
}
TASK
(
j2
)
{
TASK
(
j2
)
{
TRACE
(
"j2_enter
\n
"
);
LOCK
(
r1
);
TRACE
(
"j2_r1_locked
\n
"
);
...
...
@@ -82,7 +89,8 @@ TASK(j2) {
TRACE
(
"j2_exit
\n
"
);
}
TASK
(
j3
)
{
TASK
(
j3
)
{
TRACE
(
"j3_enter
\n
"
);
LOCK
(
r1
);
TRACE
(
"j3_r1_locked
\n
"
);
...
...
@@ -95,12 +103,14 @@ TASK(j3) {
#ifdef KLEE
/* The case when KLEE makes the path analysis */
int
main
()
{
int
main
()
{
klee_make_symbolic
(
&
job
,
sizeof
(
job
),
"job"
);
klee_assume
(
job
>
0
&&
job
<
4
);
switch
(
job
)
{
switch
(
job
)
{
default:
klee_make_symbolic
(
&
state
,
sizeof
(
state
),
"state"
);
// check task 1
...
...
@@ -118,20 +128,20 @@ int main() {
klee_make_symbolic
(
&
state
,
sizeof
(
state
),
"state"
);
EXTI3_IRQHandler
();
break
;
/*klee_make_symbolic(&state, sizeof(state), "state");*/
/*break;*/
}
}
#elif defined KLEE_WCET
/* The case when gdb runs WCET benchmarking */
static
int
job
;
int
main
()
{
int
main
()
{
dwt_enable
();
DWT
->
CYCCNT
=
0
;
switch
(
job
)
{
switch
(
job
)
{
case
1
:
TRACE_EVENT
(
S
,
j1
);
EXTI1_IRQHandler
();
...
...
@@ -150,12 +160,12 @@ int main() {
}
finish_execution
();
// gdb breakpoint
// terminate_execution();
}
#else
// this will be run in the production code
int
main
()
{
int
main
()
{
TRACE
(
"
\n
Init
\n
"
);
SETPRIO
(
j1
);
// Set HW priorities
SETPRIO
(
j2
);
...
...
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