From dfa29032dd9eee2e253f025f8a24cf0d69d17c83 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson <rasmus@rasmus.local> Date: Thu, 23 Apr 2020 10:29:23 +0200 Subject: [PATCH] Added assertions before functionality of Split --- b_asic/signal_flow_graph.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/b_asic/signal_flow_graph.py b/b_asic/signal_flow_graph.py index d0e44afd..4f17b4c0 100644 --- a/b_asic/signal_flow_graph.py +++ b/b_asic/signal_flow_graph.py @@ -234,7 +234,10 @@ class SFG(AbstractOperation): def split(self) -> Iterable[Operation]: """ Iterates over the SFG's Input- and OutputSignals to reconnect them to each necessary operation inside the SFG, so that the inner operations of the SFG can function on their own, effectively replacing the SFG. """ - + + assert len(self.inputs) == len(self.input_operations), "Number of inputs does not match the number of input_operations in SFG." + assert len(self.outputs) == len(self.output_operations), "Number of outputs does not match the number of output_operations SFG." + # For each input_signal, connect it to the corresponding operation for port, input_operation in zip(self.inputs, self.input_operations): # Connect the signal to the new destination -- GitLab