diff --git a/b_asic/signal_flow_graph.py b/b_asic/signal_flow_graph.py index 0f7bffa95814471312b49ad03a0cdb24943f76a3..c87c4129bde8d6fb51dd0116cd872a8b248a7d1e 100644 --- a/b_asic/signal_flow_graph.py +++ b/b_asic/signal_flow_graph.py @@ -21,9 +21,7 @@ class SFG(BasicOperation): _graph_id_generator: GraphIDGenerator def __init__(self, input_destinations: List[SignalDestination], output_sources: List[SignalSource]): - """ - Construct a SFG. - """ + """Constructs an SFG.""" super().__init__() # TODO: Allocate input/output ports with appropriate IDs. @@ -37,19 +35,23 @@ class SFG(BasicOperation): return [] # TODO: Implement def add_operation(self, operation: Operation) -> GraphID: - """ - Adds the entered operation to the SFG's dictionary of graph objects and + """Adds the entered operation to the SFG's dictionary of graph objects and returns a generated GraphID for it. + + Keyword arguments: + operation: Operation to add to the graph. """ - return self._add_graph_obj(operation, 'op') + return self._add_graph_obj(operation, operation.get_op_name()) def add_signal(self, signal: Signal) -> GraphID: - """ - Adds the entered signal to the SFG's dictionary of graph objects and returns + """Adds the entered signal to the SFG's dictionary of graph objects and returns a generated GraphID for it. + + Keyword argumentst: + signal: Signal to add to the graph. """ - return self._add_graph_obj(signal, 's') + return self._add_graph_obj(signal, 'sig') def _add_graph_obj(self, obj: Union[Operation, Signal], operation_id_type: str):