Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
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
8c2c08f3
authored
Jun 29, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'embb375_dataflow_priorities_and_affinities' into development
parents
298a6e03
b1ecc318
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
11 deletions
+39
-11
dataflow_cpp/include/embb/dataflow/internal/node.h
+5
-0
dataflow_cpp/include/embb/dataflow/internal/process.h
+2
-2
dataflow_cpp/include/embb/dataflow/internal/scheduler.h
+9
-2
dataflow_cpp/include/embb/dataflow/internal/scheduler_mtapi.h
+15
-4
dataflow_cpp/include/embb/dataflow/internal/scheduler_sequential.h
+7
-2
dataflow_cpp/include/embb/dataflow/internal/sink.h
+1
-1
dataflow_cpp/include/embb/dataflow/network.h
+0
-0
No files found.
dataflow_cpp/include/embb/dataflow/internal/node.h
View file @
8c2c08f3
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <cstddef>
#include <cstddef>
#include <embb/base/exceptions.h>
#include <embb/base/exceptions.h>
#include <embb/mtapi/execution_policy.h>
#include <embb/dataflow/internal/scheduler.h>
#include <embb/dataflow/internal/scheduler.h>
#include <embb/dataflow/internal/clock_listener.h>
#include <embb/dataflow/internal/clock_listener.h>
...
@@ -58,10 +59,14 @@ class Node {
...
@@ -58,10 +59,14 @@ class Node {
SetSlices
(
0
);
SetSlices
(
0
);
}
}
}
}
void
SetPolicy
(
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
{
policy_
=
policy
;
}
protected
:
protected
:
Scheduler
*
sched_
;
Scheduler
*
sched_
;
static
int
next_process_id_
;
static
int
next_process_id_
;
embb
::
mtapi
::
ExecutionPolicy
policy_
;
static
int
GetNextProcessID
()
{
return
next_process_id_
++
;
}
static
int
GetNextProcessID
()
{
return
next_process_id_
++
;
}
virtual
void
SetSlices
(
int
/*slices*/
)
{}
virtual
void
SetSlices
(
int
/*slices*/
)
{}
...
...
dataflow_cpp/include/embb/dataflow/internal/process.h
View file @
8c2c08f3
...
@@ -146,7 +146,7 @@ class Process< Serial, Inputs<I1, I2, I3, I4, I5>,
...
@@ -146,7 +146,7 @@ class Process< Serial, Inputs<I1, I2, I3, I4, I5>,
for
(
int
ii
=
clk
;
ii
<
clk_res
;
ii
++
)
{
for
(
int
ii
=
clk
;
ii
<
clk_res
;
ii
++
)
{
const
int
idx
=
ii
%
slices_
;
const
int
idx
=
ii
%
slices_
;
action_
[
idx
]
=
Action
(
this
,
ii
);
action_
[
idx
]
=
Action
(
this
,
ii
);
sched_
->
Enqueue
(
queue_id_
,
action_
[
idx
]);
sched_
->
Enqueue
(
queue_id_
,
action_
[
idx
]
,
policy_
);
}
}
queued_clock_
.
Store
(
clk_res
);
queued_clock_
.
Store
(
clk_res
);
retry
=
false
;
retry
=
false
;
...
@@ -158,7 +158,7 @@ class Process< Serial, Inputs<I1, I2, I3, I4, I5>,
...
@@ -158,7 +158,7 @@ class Process< Serial, Inputs<I1, I2, I3, I4, I5>,
}
else
{
}
else
{
const
int
idx
=
clock
%
slices_
;
const
int
idx
=
clock
%
slices_
;
action_
[
idx
]
=
Action
(
this
,
clock
);
action_
[
idx
]
=
Action
(
this
,
clock
);
sched_
->
Start
(
action_
[
idx
]);
sched_
->
Start
(
action_
[
idx
]
,
policy_
);
}
}
}
}
...
...
dataflow_cpp/include/embb/dataflow/internal/scheduler.h
View file @
8c2c08f3
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
#ifndef EMBB_DATAFLOW_INTERNAL_SCHEDULER_H_
#ifndef EMBB_DATAFLOW_INTERNAL_SCHEDULER_H_
#define EMBB_DATAFLOW_INTERNAL_SCHEDULER_H_
#define EMBB_DATAFLOW_INTERNAL_SCHEDULER_H_
#include <embb/mtapi/execution_policy.h>
namespace
embb
{
namespace
embb
{
namespace
dataflow
{
namespace
dataflow
{
namespace
internal
{
namespace
internal
{
...
@@ -37,8 +39,13 @@ class Scheduler {
...
@@ -37,8 +39,13 @@ class Scheduler {
public
:
public
:
Scheduler
()
{}
Scheduler
()
{}
virtual
~
Scheduler
()
{}
virtual
~
Scheduler
()
{}
virtual
void
Start
(
Action
&
action
)
=
0
;
virtual
void
Start
(
virtual
void
Enqueue
(
int
process_id
,
Action
&
action
)
=
0
;
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
=
0
;
virtual
void
Enqueue
(
int
process_id
,
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
=
0
;
virtual
void
WaitForSlice
(
int
slice
)
=
0
;
virtual
void
WaitForSlice
(
int
slice
)
=
0
;
virtual
int
GetSlices
()
=
0
;
virtual
int
GetSlices
()
=
0
;
};
};
...
...
dataflow_cpp/include/embb/dataflow/internal/scheduler_mtapi.h
View file @
8c2c08f3
...
@@ -96,14 +96,25 @@ class SchedulerMTAPI : public Scheduler {
...
@@ -96,14 +96,25 @@ class SchedulerMTAPI : public Scheduler {
embb
::
base
::
Allocation
::
Free
(
group_
);
embb
::
base
::
Allocation
::
Free
(
group_
);
embb
::
base
::
Allocation
::
Free
(
queue_
);
embb
::
base
::
Allocation
::
Free
(
queue_
);
}
}
virtual
void
Start
(
Action
&
action
)
{
virtual
void
Start
(
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
{
const
int
idx
=
action
.
GetClock
()
%
slices_
;
const
int
idx
=
action
.
GetClock
()
%
slices_
;
group_
[
idx
].
Start
(
job_
,
&
action
,
static_cast
<
void
*>
(
NULL
));
embb
::
mtapi
::
TaskAttributes
task_attr
;
task_attr
.
SetPolicy
(
policy
);
group_
[
idx
].
Start
(
job_
,
&
action
,
static_cast
<
void
*>
(
NULL
),
task_attr
);
}
}
virtual
void
Enqueue
(
int
process_id
,
Action
&
action
)
{
virtual
void
Enqueue
(
int
process_id
,
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
policy
)
{
const
int
idx
=
action
.
GetClock
()
%
slices_
;
const
int
idx
=
action
.
GetClock
()
%
slices_
;
const
int
queue_id
=
process_id
%
queue_count_
;
const
int
queue_id
=
process_id
%
queue_count_
;
queue_
[
queue_id
].
Enqueue
(
&
action
,
static_cast
<
void
*>
(
NULL
),
group_
[
idx
]);
embb
::
mtapi
::
TaskAttributes
task_attr
;
task_attr
.
SetPolicy
(
policy
);
queue_
[
queue_id
].
Enqueue
(
&
action
,
static_cast
<
void
*>
(
NULL
),
task_attr
,
group_
[
idx
]);
}
}
virtual
void
WaitForSlice
(
int
slice
)
{
virtual
void
WaitForSlice
(
int
slice
)
{
group_
[
slice
].
WaitAll
(
MTAPI_INFINITE
);
group_
[
slice
].
WaitAll
(
MTAPI_INFINITE
);
...
...
dataflow_cpp/include/embb/dataflow/internal/scheduler_sequential.h
View file @
8c2c08f3
...
@@ -38,10 +38,15 @@ class SchedulerSequential : public Scheduler {
...
@@ -38,10 +38,15 @@ class SchedulerSequential : public Scheduler {
public
:
public
:
SchedulerSequential
()
{}
SchedulerSequential
()
{}
virtual
~
SchedulerSequential
()
{}
virtual
~
SchedulerSequential
()
{}
virtual
void
Start
(
Action
&
action
)
{
virtual
void
Start
(
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
)
{
action
.
RunSequential
();
action
.
RunSequential
();
}
}
virtual
void
Enqueue
(
int
,
Action
&
action
)
{
virtual
void
Enqueue
(
int
,
Action
&
action
,
embb
::
mtapi
::
ExecutionPolicy
const
&
)
{
action
.
RunSequential
();
action
.
RunSequential
();
}
}
virtual
void
WaitForSlice
(
int
/*slice*/
)
{}
virtual
void
WaitForSlice
(
int
/*slice*/
)
{}
...
...
dataflow_cpp/include/embb/dataflow/internal/sink.h
View file @
8c2c08f3
...
@@ -113,7 +113,7 @@ class Sink< Inputs<I1, I2, I3, I4, I5> >
...
@@ -113,7 +113,7 @@ class Sink< Inputs<I1, I2, I3, I4, I5> >
for
(
int
ii
=
clk
;
ii
<
clk_res
;
ii
++
)
{
for
(
int
ii
=
clk
;
ii
<
clk_res
;
ii
++
)
{
const
int
idx
=
ii
%
slices_
;
const
int
idx
=
ii
%
slices_
;
action_
[
idx
]
=
Action
(
this
,
ii
);
action_
[
idx
]
=
Action
(
this
,
ii
);
sched_
->
Enqueue
(
queue_id_
,
action_
[
idx
]);
sched_
->
Enqueue
(
queue_id_
,
action_
[
idx
]
,
policy_
);
}
}
queued_clock_
.
Store
(
clk_res
);
queued_clock_
.
Store
(
clk_res
);
retry
=
false
;
retry
=
false
;
...
...
dataflow_cpp/include/embb/dataflow/network.h
View file @
8c2c08f3
This diff is collapsed.
Click to expand it.
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