Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-uniquify hierarchical blocks in genus for hierarchical flows #812

Merged
merged 4 commits into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion hammer/synthesis/genus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from hammer.vlsi import HammerTool, HammerToolStep, HammerToolHookAction, HierarchicalMode
from hammer.utils import VerilogUtils
from hammer.vlsi import HammerSynthesisTool
from hammer.vlsi import HammerSynthesisTool, PlacementConstraintType
from hammer.logging import HammerVLSILogging
from hammer.vlsi import MMMCCornerType
import hammer.tech as hammer_tech
Expand Down Expand Up @@ -302,6 +302,19 @@ def syn_generic(self) -> bool:
# Clock mapping needs at least the attributes cts_inverter_cells and cts_logic_cells to be set
self.append("set_db map_clock_tree true")
self.verbose_append("syn_generic")

# With DDI, hierarchical instances may be uniquified. Use change_link to deuniquify them
if self.hierarchical_mode.is_nonleaf_hierarchical() and self.version() >= self.version_number("211"):
pcs = list(filter(lambda c: c.type == PlacementConstraintType.Hierarchical, self.get_placement_constraints()))
for pc in pcs:
self.append("""
# Attempt to deuniquify hinst:{inst}, incase it was uniquified
set uniquified_name [get_db hinst:{inst} .module.name]
if {{ $uniquified_name ne \"{master}\" }} {{
puts [format \"WARNING: instance hinst:{inst} was uniquified to be an instance of $uniquified_name, not {master}. Attempting to fix\"]
change_link -copy_attributes -instances {{{inst}}} -design_name module:{top}/{master}
}}""".format(inst=pc.path, top=self.top_module, master=pc.master))

return True

def syn_map(self) -> bool:
Expand Down