Skip to content
Snippets Groups Projects
Commit 0ffa8c8e authored by Frans Skarman's avatar Frans Skarman :tropical_fish:
Browse files

Add critical path computation

parent 45c7bb78
No related branches found
No related tags found
1 merge request!177Add critical path computation
Pipeline #89506 passed
......@@ -1451,3 +1451,9 @@ class SFG(AbstractOperation):
if format is not None:
dg.format = format
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,11 @@ class TestSFGErrors:
match=re.escape("Output index out of range (expected 0-0, got 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)
sfg_simple_accumulator.inputs[0].latency_offset = 0
sfg_simple_accumulator.outputs[0].latency_offset = 0
assert sfg_simple_accumulator.critical_path() == 5
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