Skip to content
Snippets Groups Projects
Commit 5484238a authored by Frans Skarman's avatar Frans Skarman :tropical_fish: Committed by Oscar Gustafsson
Browse files

Add critical path computation

parent 45c7bb78
No related branches found
No related tags found
1 merge request!177Add critical path computation
Pipeline #89544 passed
...@@ -1451,3 +1451,9 @@ class SFG(AbstractOperation): ...@@ -1451,3 +1451,9 @@ class SFG(AbstractOperation):
if format is not None: if format is not None:
dg.format = format dg.format = format
dg.view() dg.view()
def critical_path(self):
# Import here needed to avoid circular imports
from b_asic.schedule import Schedule
return Schedule(self, scheduling_algorithm="ASAP").schedule_time
...@@ -1559,3 +1559,12 @@ class TestSFGErrors: ...@@ -1559,3 +1559,12 @@ class TestSFGErrors:
match=re.escape("Output index out of range (expected 0-0, got 1)"), match=re.escape("Output index out of range (expected 0-0, got 1)"),
): ):
sfg.inputs_required_for_output(1) sfg.inputs_required_for_output(1)
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
sfg_simple_accumulator.set_latency_of_type(Addition.type_name(), 6)
assert sfg_simple_accumulator.critical_path() == 6
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment