diff --git a/dataflow_cpp/include/embb/dataflow/internal/in.h b/dataflow_cpp/include/embb/dataflow/internal/in.h index 60b4024..d5989f3 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/in.h +++ b/dataflow_cpp/include/embb/dataflow/internal/in.h @@ -57,9 +57,7 @@ class In { Type GetValue(int clock) const { SignalType const & signal = GetSignal(clock); - if (signal.IsBlank()) - EMBB_THROW(embb::base::ErrorException, - "Signal is blank, cannot get a value.") + assert(!signal.IsBlank()); return signal.GetValue(); } @@ -86,9 +84,7 @@ class In { void Receive(SignalType const & value) { const int idx = value.GetClock() % Slices; - if (values_[idx].GetClock() >= value.GetClock()) - EMBB_THROW(embb::base::ErrorException, - "Received signal does not increase clock."); + assert(values_[idx].GetClock() < value.GetClock()); values_[idx] = value; listener_->OnClock(value.GetClock()); #if EMBB_DATAFLOW_TRACE_SIGNAL_HISTORY diff --git a/dataflow_cpp/include/embb/dataflow/internal/inputs.h b/dataflow_cpp/include/embb/dataflow/internal/inputs.h index 7fc87b6..28c2dd8 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/inputs.h +++ b/dataflow_cpp/include/embb/dataflow/internal/inputs.h @@ -143,10 +143,7 @@ class InputsOnClock(clock); @@ -260,10 +257,7 @@ class Inputs } virtual void OnClock(int clock) { const int idx = clock % Slices; - if (count_[idx] == 0) { - EMBB_THROW(embb::base::ErrorException, - "All inputs already fired for this clock."); - } + assert(count_[idx] == 0); if (--count_[idx] == 0) { count_[idx] = 4; listener_->OnClock(clock); @@ -325,10 +319,7 @@ class Inputs } virtual void OnClock(int clock) { const int idx = clock % Slices; - if (count_[idx] == 0) { - EMBB_THROW(embb::base::ErrorException, - "All inputs already fired for this clock."); - } + assert(count_[idx] == 0); if (--count_[idx] == 0) { count_[idx] = 5; listener_->OnClock(clock); diff --git a/dataflow_cpp/include/embb/dataflow/internal/process.h b/dataflow_cpp/include/embb/dataflow/internal/process.h index e6f001a..214fbb8 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/process.h +++ b/dataflow_cpp/include/embb/dataflow/internal/process.h @@ -108,10 +108,7 @@ class Process< Slices, Serial, Inputs, } virtual void OnClock(int clock) { - if (!inputs_.AreAtClock(clock)) { - EMBB_THROW(embb::base::ErrorException, - "Some inputs are not at expected clock.") - } + assert(inputs_.AreAtClock(clock)); bool ordered = Serial; if (ordered) { diff --git a/dataflow_cpp/include/embb/dataflow/internal/select.h b/dataflow_cpp/include/embb/dataflow/internal/select.h index e184e2b..f4d4383 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/select.h +++ b/dataflow_cpp/include/embb/dataflow/internal/select.h @@ -112,9 +112,7 @@ class Select virtual void OnClock(int clock) { //const int idx = clock % Slices; - if (!inputs_.AreAtClock(clock)) - EMBB_THROW(embb::base::ErrorException, - "Some inputs are not at expected clock.") + assert(inputs_.AreAtClock(clock)); Run(clock); } diff --git a/dataflow_cpp/include/embb/dataflow/internal/sink.h b/dataflow_cpp/include/embb/dataflow/internal/sink.h index 2c835ed..61bfc33 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/sink.h +++ b/dataflow_cpp/include/embb/dataflow/internal/sink.h @@ -88,10 +88,8 @@ class Sink< Slices, Inputs > } virtual void OnClock(int clock) { - if (!inputs_.AreAtClock(clock)) { - EMBB_THROW(embb::base::ErrorException, - "Some inputs are not at expected clock.") - } + EMBB_UNUSED_IN_RELEASE(clock); + assert(inputs_.AreAtClock(clock)); bool retry = true; while (retry) { diff --git a/dataflow_cpp/include/embb/dataflow/internal/switch.h b/dataflow_cpp/include/embb/dataflow/internal/switch.h index 0015ad9..2f23482 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/switch.h +++ b/dataflow_cpp/include/embb/dataflow/internal/switch.h @@ -110,9 +110,7 @@ class Switch virtual void OnClock(int clock) { //const int idx = clock % Slices; - if (!inputs_.AreAtClock(clock)) - EMBB_THROW(embb::base::ErrorException, - "Some inputs are not at expected clock.") + assert(inputs_.AreAtClock(clock)); Run(clock); } diff --git a/dataflow_cpp/include/embb/dataflow/network.h b/dataflow_cpp/include/embb/dataflow/network.h index 33dbaff..371a7ec 100644 --- a/dataflow_cpp/include/embb/dataflow/network.h +++ b/dataflow_cpp/include/embb/dataflow/network.h @@ -843,9 +843,7 @@ class Network : public internal::ClockListener { virtual void OnClock(int clock) { const int idx = clock % Slices; const int cnt = --sink_counter_[idx]; - if (cnt < 0) - EMBB_THROW(embb::base::ErrorException, - "More sinks than expected signaled reception of given clock.") + assert(cnt == 0); } /**