Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Tobias Langer
/
experiment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
94649d4d
authored
Oct 11, 2016
by
Tobias Langer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate arguments beforehand.
parent
73b26540
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
templates/normal/experiment.cpp
+5
-7
No files found.
templates/normal/experiment.cpp
View file @
94649d4d
...
@@ -125,6 +125,9 @@ static void IdleTask(const void* args, mtapi_size_t, void*, mtapi_size_t,
...
@@ -125,6 +125,9 @@ static void IdleTask(const void* args, mtapi_size_t, void*, mtapi_size_t,
* Main loop of task starter core.
* Main loop of task starter core.
****/
****/
/* Make place to store the arguments for any running task instance. */
std
::
vector
<
std
::
pair
<
int
,
int
>>
task_arguments
[
taskset_length
];
static
void
TaskStarter
()
static
void
TaskStarter
()
{
{
/* Initialize task starter */
/* Initialize task starter */
...
@@ -134,15 +137,10 @@ static void TaskStarter()
...
@@ -134,15 +137,10 @@ static void TaskStarter()
auto
hyperperiod
=
calculate_hyperperiod
();
auto
hyperperiod
=
calculate_hyperperiod
();
/* Storage for task parameters. */
int
task_cnt
=
0
;
for
(
int
i
=
0
;
i
<
taskset_length
;
i
++
)
{
for
(
int
i
=
0
;
i
<
taskset_length
;
i
++
)
{
node
.
CreateAction
(
ACTION_ID
+
i
+
1
,
IdleTask
);
node
.
CreateAction
(
ACTION_ID
+
i
+
1
,
IdleTask
);
task_cnt
+=
hyperperiod
/
taskset
[
i
].
period
;
std
::
cout
<<
"Task "
<<
i
<<
" wcet: "
<<
taskset
[
i
].
wcet
<<
" period: "
<<
taskset
[
i
].
period
<<
" deadline: "
<<
taskset
[
i
].
deadline
<<
std
::
endl
;
std
::
cout
<<
"Task "
<<
i
<<
" wcet: "
<<
taskset
[
i
].
wcet
<<
" period: "
<<
taskset
[
i
].
period
<<
" deadline: "
<<
taskset
[
i
].
deadline
<<
std
::
endl
;
}
}
std
::
vector
<
std
::
pair
<
int
,
int
>>
running_num
(
task_cnt
);
int
task_ptr
=
0
;
using
namespace
std
::
chrono
;
using
namespace
std
::
chrono
;
...
@@ -181,10 +179,10 @@ static void TaskStarter()
...
@@ -181,10 +179,10 @@ static void TaskStarter()
* to make sure that all possible running tasks can access their
* to make sure that all possible running tasks can access their
* parameters.
* parameters.
*/
*/
running_num
[
task_ptr
++
]
=
std
::
make_pair
(
i
,
count
);
task_arguments
[
i
][
count
-
1
]
=
std
::
make_pair
(
i
,
count
);
auto
job
=
node
.
GetJob
(
ACTION_ID
+
i
+
1
,
DOMAIN_ID
);
auto
job
=
node
.
GetJob
(
ACTION_ID
+
i
+
1
,
DOMAIN_ID
);
int
tmp
;
auto
t
=
node
.
Start
(
job
,
&
running_num
[
task_ptr
-
1
],
&
tmp
);
int
tmp
;
auto
t
=
node
.
Start
(
job
,
&
task_arguments
[
i
][
count
-
1
],
&
tmp
);
/* Store task to wait for it. */
/* Store task to wait for it. */
running
.
push_back
(
t
);
running
.
push_back
(
t
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment