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
6a0eb53f
authored
9 years ago
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dataflow_cpp: changed internal exceptions to asserts
parent
3891cb15
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
35 deletions
+11
-35
dataflow_cpp/include/embb/dataflow/internal/in.h
+2
-6
dataflow_cpp/include/embb/dataflow/internal/inputs.h
+3
-12
dataflow_cpp/include/embb/dataflow/internal/process.h
+1
-4
dataflow_cpp/include/embb/dataflow/internal/select.h
+1
-3
dataflow_cpp/include/embb/dataflow/internal/sink.h
+2
-4
dataflow_cpp/include/embb/dataflow/internal/switch.h
+1
-3
dataflow_cpp/include/embb/dataflow/network.h
+1
-3
No files found.
dataflow_cpp/include/embb/dataflow/internal/in.h
View file @
6a0eb53f
...
@@ -57,9 +57,7 @@ class In {
...
@@ -57,9 +57,7 @@ class In {
Type
GetValue
(
int
clock
)
const
{
Type
GetValue
(
int
clock
)
const
{
SignalType
const
&
signal
=
GetSignal
(
clock
);
SignalType
const
&
signal
=
GetSignal
(
clock
);
if
(
signal
.
IsBlank
())
assert
(
!
signal
.
IsBlank
());
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"Signal is blank, cannot get a value."
)
return
signal
.
GetValue
();
return
signal
.
GetValue
();
}
}
...
@@ -86,9 +84,7 @@ class In {
...
@@ -86,9 +84,7 @@ class In {
void
Receive
(
SignalType
const
&
value
)
{
void
Receive
(
SignalType
const
&
value
)
{
const
int
idx
=
value
.
GetClock
()
%
Slices
;
const
int
idx
=
value
.
GetClock
()
%
Slices
;
if
(
values_
[
idx
].
GetClock
()
>=
value
.
GetClock
())
assert
(
values_
[
idx
].
GetClock
()
<
value
.
GetClock
());
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"Received signal does not increase clock."
);
values_
[
idx
]
=
value
;
values_
[
idx
]
=
value
;
listener_
->
OnClock
(
value
.
GetClock
());
listener_
->
OnClock
(
value
.
GetClock
());
#if EMBB_DATAFLOW_TRACE_SIGNAL_HISTORY
#if EMBB_DATAFLOW_TRACE_SIGNAL_HISTORY
...
...
This diff is collapsed.
Click to expand it.
dataflow_cpp/include/embb/dataflow/internal/inputs.h
View file @
6a0eb53f
...
@@ -143,10 +143,7 @@ class Inputs<Slices, T1, T2, embb::base::internal::Nil,
...
@@ -143,10 +143,7 @@ class Inputs<Slices, T1, T2, embb::base::internal::Nil,
}
}
virtual
void
OnClock
(
int
clock
)
{
virtual
void
OnClock
(
int
clock
)
{
const
int
idx
=
clock
%
Slices
;
const
int
idx
=
clock
%
Slices
;
if
(
count_
[
idx
]
==
0
)
{
assert
(
count_
[
idx
]
==
0
);
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"All inputs already fired for this clock."
);
}
if
(
--
count_
[
idx
]
==
0
)
{
if
(
--
count_
[
idx
]
==
0
)
{
count_
[
idx
]
=
2
;
count_
[
idx
]
=
2
;
listener_
->
OnClock
(
clock
);
listener_
->
OnClock
(
clock
);
...
@@ -260,10 +257,7 @@ class Inputs<Slices, T1, T2, T3, T4, embb::base::internal::Nil>
...
@@ -260,10 +257,7 @@ class Inputs<Slices, T1, T2, T3, T4, embb::base::internal::Nil>
}
}
virtual
void
OnClock
(
int
clock
)
{
virtual
void
OnClock
(
int
clock
)
{
const
int
idx
=
clock
%
Slices
;
const
int
idx
=
clock
%
Slices
;
if
(
count_
[
idx
]
==
0
)
{
assert
(
count_
[
idx
]
==
0
);
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"All inputs already fired for this clock."
);
}
if
(
--
count_
[
idx
]
==
0
)
{
if
(
--
count_
[
idx
]
==
0
)
{
count_
[
idx
]
=
4
;
count_
[
idx
]
=
4
;
listener_
->
OnClock
(
clock
);
listener_
->
OnClock
(
clock
);
...
@@ -325,10 +319,7 @@ class Inputs
...
@@ -325,10 +319,7 @@ class Inputs
}
}
virtual
void
OnClock
(
int
clock
)
{
virtual
void
OnClock
(
int
clock
)
{
const
int
idx
=
clock
%
Slices
;
const
int
idx
=
clock
%
Slices
;
if
(
count_
[
idx
]
==
0
)
{
assert
(
count_
[
idx
]
==
0
);
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"All inputs already fired for this clock."
);
}
if
(
--
count_
[
idx
]
==
0
)
{
if
(
--
count_
[
idx
]
==
0
)
{
count_
[
idx
]
=
5
;
count_
[
idx
]
=
5
;
listener_
->
OnClock
(
clock
);
listener_
->
OnClock
(
clock
);
...
...
This diff is collapsed.
Click to expand it.
dataflow_cpp/include/embb/dataflow/internal/process.h
View file @
6a0eb53f
...
@@ -108,10 +108,7 @@ class Process< Slices, Serial, Inputs<Slices, I1, I2, I3, I4, I5>,
...
@@ -108,10 +108,7 @@ class Process< Slices, Serial, Inputs<Slices, I1, I2, I3, I4, I5>,
}
}
virtual
void
OnClock
(
int
clock
)
{
virtual
void
OnClock
(
int
clock
)
{
if
(
!
inputs_
.
AreAtClock
(
clock
))
{
assert
(
inputs_
.
AreAtClock
(
clock
));
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"Some inputs are not at expected clock."
)
}
bool
ordered
=
Serial
;
bool
ordered
=
Serial
;
if
(
ordered
)
{
if
(
ordered
)
{
...
...
This diff is collapsed.
Click to expand it.
dataflow_cpp/include/embb/dataflow/internal/select.h
View file @
6a0eb53f
...
@@ -112,9 +112,7 @@ class Select
...
@@ -112,9 +112,7 @@ class Select
virtual
void
OnClock
(
int
clock
)
{
virtual
void
OnClock
(
int
clock
)
{
//const int idx = clock % Slices;
//const int idx = clock % Slices;
if
(
!
inputs_
.
AreAtClock
(
clock
))
assert
(
inputs_
.
AreAtClock
(
clock
));
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"Some inputs are not at expected clock."
)
Run
(
clock
);
Run
(
clock
);
}
}
...
...
This diff is collapsed.
Click to expand it.
dataflow_cpp/include/embb/dataflow/internal/sink.h
View file @
6a0eb53f
...
@@ -88,10 +88,8 @@ class Sink< Slices, Inputs<Slices, I1, I2, I3, I4, I5> >
...
@@ -88,10 +88,8 @@ class Sink< Slices, Inputs<Slices, I1, I2, I3, I4, I5> >
}
}
virtual
void
OnClock
(
int
clock
)
{
virtual
void
OnClock
(
int
clock
)
{
if
(
!
inputs_
.
AreAtClock
(
clock
))
{
EMBB_UNUSED_IN_RELEASE
(
clock
);
EMBB_THROW
(
embb
::
base
::
ErrorException
,
assert
(
inputs_
.
AreAtClock
(
clock
));
"Some inputs are not at expected clock."
)
}
bool
retry
=
true
;
bool
retry
=
true
;
while
(
retry
)
{
while
(
retry
)
{
...
...
This diff is collapsed.
Click to expand it.
dataflow_cpp/include/embb/dataflow/internal/switch.h
View file @
6a0eb53f
...
@@ -110,9 +110,7 @@ class Switch
...
@@ -110,9 +110,7 @@ class Switch
virtual
void
OnClock
(
int
clock
)
{
virtual
void
OnClock
(
int
clock
)
{
//const int idx = clock % Slices;
//const int idx = clock % Slices;
if
(
!
inputs_
.
AreAtClock
(
clock
))
assert
(
inputs_
.
AreAtClock
(
clock
));
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"Some inputs are not at expected clock."
)
Run
(
clock
);
Run
(
clock
);
}
}
...
...
This diff is collapsed.
Click to expand it.
dataflow_cpp/include/embb/dataflow/network.h
View file @
6a0eb53f
...
@@ -843,9 +843,7 @@ class Network : public internal::ClockListener {
...
@@ -843,9 +843,7 @@ class Network : public internal::ClockListener {
virtual
void
OnClock
(
int
clock
)
{
virtual
void
OnClock
(
int
clock
)
{
const
int
idx
=
clock
%
Slices
;
const
int
idx
=
clock
%
Slices
;
const
int
cnt
=
--
sink_counter_
[
idx
];
const
int
cnt
=
--
sink_counter_
[
idx
];
if
(
cnt
<
0
)
assert
(
cnt
==
0
);
EMBB_THROW
(
embb
::
base
::
ErrorException
,
"More sinks than expected signaled reception of given clock."
)
}
}
/**
/**
...
...
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