From 1f4478cb60403e7bd70e4500707a1b9474f02932 Mon Sep 17 00:00:00 2001 From: Oscar Gustafsson <oscar.gustafsson@gmail.com> Date: Fri, 12 May 2023 10:38:30 +0200 Subject: [PATCH] Add set_execution_time_of_type for Schedule --- b_asic/schedule.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/b_asic/schedule.py b/b_asic/schedule.py index ce5f96e9..d35fcca7 100644 --- a/b_asic/schedule.py +++ b/b_asic/schedule.py @@ -479,6 +479,23 @@ class Schedule: self._schedule_time = self._schedule_time // factor return self + def set_execution_time_of_type( + self, type_name: TypeName, execution_time: int + ) -> None: + """ + Set the execution time of all operations with the given type name. + + Parameters + ---------- + type_name : TypeName + The type name of the operation. For example, obtained as + ``Addition.type_name()``. + execution_time : int + The execution time of the operation. + """ + self._sfg.set_execution_time_of_type(type_name, execution_time) + self._original_sfg.set_execution_time_of_type(type_name, execution_time) + def move_y_location( self, graph_id: GraphID, new_y: int, insert: bool = False ) -> None: -- GitLab