diff --git a/hammer/synthesis/genus/__init__.py b/hammer/synthesis/genus/__init__.py index 9bd8107..98786a8 100644 --- a/hammer/synthesis/genus/__init__.py +++ b/hammer/synthesis/genus/__init__.py @@ -85,7 +85,7 @@ def get_tool_hooks(self) -> List[HammerToolHookAction]: @property def steps(self) -> List[HammerToolStep]: - return self.make_steps_from_methods([ + steps_methods = [ self.init_environment, self.syn_generic, self.syn_map, @@ -93,7 +93,10 @@ def steps(self) -> List[HammerToolStep]: self.write_regs, self.generate_reports, self.write_outputs - ]) + ] + if self.get_setting("synthesis.inputs.retime_modules"): + steps_methods.insert(1, self.retime_modules) + return self.make_steps_from_methods(steps_methods) def do_pre_steps(self, first_step: HammerToolStep) -> bool: assert super().do_pre_steps(first_step) @@ -264,6 +267,21 @@ def init_environment(self) -> bool: return True + def retime_modules(self) -> bool: + retime_mods = self.get_setting("synthesis.inputs.retime_modules") + + if retime_mods: + rt_tcl = ( + f"set rt_mods [get_designs \"{' '.join(retime_mods)}\"]\n" \ + "foreach rt_mod $rt_mods {\n" \ + " set_db $rt_mod .retime true\n" \ + "}\n" \ + "set_db / .retime_verification_flow true" + ) + self.append(rt_tcl) + + return True + def syn_generic(self) -> bool: self.verbose_append("syn_generic") return True