diff --git a/b_asic/signal_flow_graph.py b/b_asic/signal_flow_graph.py index 366f93cdfa6b6f08a6c54157c5b5b3befab294c7..91831fb952163174ac0f35bf8b58f8f77c8218f8 100644 --- a/b_asic/signal_flow_graph.py +++ b/b_asic/signal_flow_graph.py @@ -1378,7 +1378,8 @@ class SFG(AbstractOperation): dg.format = fmt dg.view() - def critical_path(self): + def critical_path_time(self) -> int: + """Return the time of the critical path.""" # Import here needed to avoid circular imports from b_asic.schedule import Schedule diff --git a/test/test_sfg.py b/test/test_sfg.py index 6ece14588c56a5fbdfbbd4f6373616f3c35fa4e3..a40a111f47d8e495d6676c37cbd898735157e603 100644 --- a/test/test_sfg.py +++ b/test/test_sfg.py @@ -1502,10 +1502,10 @@ class TestInputDuplicationBug: class TestCriticalPath: def test_single_accumulator(self, sfg_simple_accumulator: SFG): sfg_simple_accumulator.set_latency_of_type(Addition.type_name(), 5) - assert sfg_simple_accumulator.critical_path() == 5 + assert sfg_simple_accumulator.critical_path_time() == 5 sfg_simple_accumulator.set_latency_of_type(Addition.type_name(), 6) - assert sfg_simple_accumulator.critical_path() == 6 + assert sfg_simple_accumulator.critical_path_time() == 6 class TestUnfold: diff --git a/test/test_sfg_generators.py b/test/test_sfg_generators.py index 7b4755dc304fee0b5dca2cea85d1a49f37a4ea2f..65c1412bee88073fe291cd8b9313ac99080d2a56 100644 --- a/test/test_sfg_generators.py +++ b/test/test_sfg_generators.py @@ -49,20 +49,15 @@ def test_direct_form_fir(): ) == 3 ) - assert ( - len([comp for comp in sfg.components if isinstance(comp, Addition)]) - == 2 - ) - assert ( - len([comp for comp in sfg.components if isinstance(comp, Delay)]) == 2 - ) + assert len([comp for comp in sfg.components if isinstance(comp, Addition)]) == 2 + assert len([comp for comp in sfg.components if isinstance(comp, Delay)]) == 2 sfg = direct_form_fir( (0.3, 0.4, 0.5, 0.6, 0.3), mult_properties={'latency': 2, 'execution_time': 1}, add_properties={'latency': 1, 'execution_time': 1}, ) - assert sfg.critical_path() == 6 + assert sfg.critical_path_time() == 6 def test_transposed_direct_form_fir(): @@ -77,17 +72,12 @@ def test_transposed_direct_form_fir(): ) == 3 ) - assert ( - len([comp for comp in sfg.components if isinstance(comp, Addition)]) - == 2 - ) - assert ( - len([comp for comp in sfg.components if isinstance(comp, Delay)]) == 2 - ) + assert len([comp for comp in sfg.components if isinstance(comp, Addition)]) == 2 + assert len([comp for comp in sfg.components if isinstance(comp, Delay)]) == 2 sfg = transposed_direct_form_fir( (0.3, 0.4, 0.5, 0.6, 0.3), mult_properties={'latency': 2, 'execution_time': 1}, add_properties={'latency': 1, 'execution_time': 1}, ) - assert sfg.critical_path() == 3 + assert sfg.critical_path_time() == 3