diff --git a/b_asic/signal_flow_graph.py b/b_asic/signal_flow_graph.py index 140f275f0d04f0100eb21c45ad4049e7013e3c85..2bbab16c3ac27604bfbf55465f95b28679c7cd24 100644 --- a/b_asic/signal_flow_graph.py +++ b/b_asic/signal_flow_graph.py @@ -269,7 +269,7 @@ class SFG(AbstractOperation): """Get all operations of this graph in depth-first order.""" return self._operations_ordered - def find_components_with_type_name(self, type_name: TypeName) -> List[GraphComponent]: + def get_components_with_type_name(self, type_name: TypeName) -> List[GraphComponent]: """Get a list with all components in this graph with the specified type_name. Keyword arguments: @@ -478,7 +478,7 @@ class SFG(AbstractOperation): results[key] = value return value - def get_precedence_list(self): + def get_precedence_list(self) -> List[List[OutputPort]]: """Returns a Precedence list of the SFG where each element in n:th the list consists of elements that are executed in the n:th step. If the precedence list already has been calculated for the current SFG then returns the cached version.""" @@ -490,7 +490,7 @@ class SFG(AbstractOperation): # Find all operations with only outputs and no inputs. no_input_ops = list( filter(lambda op: op.input_count == 0, self.operations)) - reg_ops = self.find_components_with_type_name(Register.type_name()) + reg_ops = self.get_components_with_type_name(Register.type_name()) # Find all first iter output ports for precedence curr_iter_ports = [op.output(i) for op in ( diff --git a/test/test_sfg.py b/test/test_sfg.py index 25c4de3de0603b6920bec7ebeee7155c5203c766..eb31fd860addaee6043bdc9933badb09848e99ba 100644 --- a/test/test_sfg.py +++ b/test/test_sfg.py @@ -290,19 +290,19 @@ class TestFindComponentsWithTypeName: print(mac_sfg._components_by_id) - assert {comp.name for comp in mac_sfg.find_components_with_type_name( + assert {comp.name for comp in mac_sfg.get_components_with_type_name( inp1.type_name())} == {"INP1", "INP2", "INP3"} - assert {comp.name for comp in mac_sfg.find_components_with_type_name( + assert {comp.name for comp in mac_sfg.get_components_with_type_name( add1.type_name())} == {"ADD1", "ADD2"} - assert {comp.name for comp in mac_sfg.find_components_with_type_name( + assert {comp.name for comp in mac_sfg.get_components_with_type_name( mul1.type_name())} == {"MUL1"} - assert {comp.name for comp in mac_sfg.find_components_with_type_name( + assert {comp.name for comp in mac_sfg.get_components_with_type_name( out1.type_name())} == {"OUT1"} - assert {comp.name for comp in mac_sfg.find_components_with_type_name( + assert {comp.name for comp in mac_sfg.get_components_with_type_name( Signal.type_name())} == {"S1", "S2", "S3", "S4", "S5", "S6", "S7"}