Skip to content

Commit

Permalink
Retiming (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgrubb13 authored Feb 28, 2023
1 parent f9e323b commit 777e28a
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions hammer/synthesis/genus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,18 @@ 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,
self.add_tieoffs,
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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 777e28a

Please sign in to comment.