Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rtfm-klee-gdb
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KLEE
rtfm-klee-gdb
Commits
c285c2a3
Commit
c285c2a3
authored
Mar 15, 2017
by
Per Lindgren
Browse files
Options
Downloads
Patches
Plain Diff
TRACE related macros fixed
parent
3a2d55f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/SRP_wcet.h
+7
-6
7 additions, 6 deletions
include/SRP_wcet.h
src/main.c
+13
-13
13 additions, 13 deletions
src/main.c
with
20 additions
and
19 deletions
include/SRP_wcet.h
+
7
−
6
View file @
c285c2a3
...
@@ -50,13 +50,14 @@ int event_count = 0;
...
@@ -50,13 +50,14 @@ int event_count = 0;
/* Create array containing structs of type locks */
/* Create array containing structs of type locks */
#define MAX_NUM_LOCKS 10
#define MAX_NUM_LOCKS 10
event
eventlist
[
MAX_NUM_LOCKS
];
event
eventlist
[
MAX_NUM_LOCKS
];
void
__attribute__
((
noinline
))
trace_event
(
action
a
,
e
vent
e
)
{
void
__attribute__
((
noinline
))
trace_event
(
action
a
,
e
lem
e
)
{
eventlist
[
event_count
].
time
=
DWT
->
CYCCNT
;
eventlist
[
event_count
].
time
=
DWT
->
CYCCNT
;
eventlist
[
event_count
].
action
=
a
;
eventlist
[
event_count
].
action
=
a
;
eventlist
[
event_count
].
elem
=
e
;
eventlist
[
event_count
].
elem
=
e
;
event_count
+=
1
;
event_count
+=
1
;
}
}
#define TRACE_EVENT(A,E) trace_event(A, E);
#define LOCK(X) trace_event(L, X);
#define LOCK(X) trace_event(L, X);
#define UNLOCK(X) trace_event(R, X);
#define UNLOCK(X) trace_event(R, X);
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
13
−
13
View file @
c285c2a3
...
@@ -3,11 +3,11 @@
...
@@ -3,11 +3,11 @@
#ifdef KLEE
#ifdef KLEE
#include
"SRP_klee.h"
#include
"SRP_klee.h"
#define TRACE(X) {}
#define
ITM_
TRACE(X) {}
#elif defined KLEE_WCET
#elif defined KLEE_WCET
#include
"SRP_wcet.h"
#include
"SRP_wcet.h"
#define TRACE(X) {}
#define
ITM_
TRACE(X) {}
#else
#else
// Production code
// Production code
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include
<stm32f401xe.h>
#include
<stm32f401xe.h>
#include
"SRP.h"
#include
"SRP.h"
#define TRACE(X) trace_printf(X)
#define
ITM_
TRACE(X) trace_printf(X)
#endif
#endif
// job bindings
// job bindings
...
@@ -56,7 +56,7 @@ void work(int i)
...
@@ -56,7 +56,7 @@ void work(int i)
TASK
(
j1
)
TASK
(
j1
)
{
{
TRACE
(
"j1_enter
\n
"
);
ITM_
TRACE
(
"j1_enter
\n
"
);
LOCK
(
r2
);
LOCK
(
r2
);
if
(
state
>
0
)
{
if
(
state
>
0
)
{
work
(
10
);
work
(
10
);
...
@@ -64,18 +64,18 @@ TASK(j1)
...
@@ -64,18 +64,18 @@ TASK(j1)
work
(
5
);
work
(
5
);
}
}
LOCK
(
r1
);
LOCK
(
r1
);
TRACE
(
"j1_r1_locked
\n
"
);
ITM_
TRACE
(
"j1_r1_locked
\n
"
);
work
(
1
);
work
(
1
);
TRACE
(
"j1_r1_locked
\n
"
);
ITM_
TRACE
(
"j1_r1_locked
\n
"
);
UNLOCK
(
r1
);
UNLOCK
(
r1
);
UNLOCK
(
r2
);
UNLOCK
(
r2
);
}
}
TASK
(
j2
)
TASK
(
j2
)
{
{
TRACE
(
"j2_enter
\n
"
);
ITM_
TRACE
(
"j2_enter
\n
"
);
LOCK
(
r1
);
LOCK
(
r1
);
TRACE
(
"j2_r1_locked
\n
"
);
ITM_
TRACE
(
"j2_r1_locked
\n
"
);
work
(
5
);
work
(
5
);
UNLOCK
(
r1
);
UNLOCK
(
r1
);
...
@@ -84,17 +84,17 @@ TASK(j2)
...
@@ -84,17 +84,17 @@ TASK(j2)
}
else
{
}
else
{
work
(
1
);
work
(
1
);
}
}
TRACE
(
"j2_exit
\n
"
);
ITM_
TRACE
(
"j2_exit
\n
"
);
}
}
TASK
(
j3
)
TASK
(
j3
)
{
{
TRACE
(
"j3_enter
\n
"
);
ITM_
TRACE
(
"j3_enter
\n
"
);
LOCK
(
r2
);
LOCK
(
r2
);
TRACE
(
"j3_r2_locked
\n
"
);
ITM_
TRACE
(
"j3_r2_locked
\n
"
);
work
(
1
);
work
(
1
);
UNLOCK
(
r2
);
UNLOCK
(
r2
);
TRACE
(
"j3_exit
\n
"
);
ITM_
TRACE
(
"j3_exit
\n
"
);
// int b = 2 * state;
// int b = 2 * state;
// if (b < 10)
// if (b < 10)
...
@@ -170,7 +170,7 @@ int main()
...
@@ -170,7 +170,7 @@ int main()
// this will be run in the production code
// this will be run in the production code
int
main
()
int
main
()
{
{
TRACE
(
"
\n
Init
\n
"
);
ITM_
TRACE
(
"
\n
Init
\n
"
);
SETPRIO
(
j1
);
// Set HW priorities
SETPRIO
(
j1
);
// Set HW priorities
SETPRIO
(
j2
);
SETPRIO
(
j2
);
SETPRIO
(
j3
);
SETPRIO
(
j3
);
...
...
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