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

Power straps updates #808

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions hammer/par/innovus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1047,10 +1047,14 @@ def generate_floorplan_tcl(self) -> List[str]:
current_top_layer = None
if current_top_layer is not None:
bot_layer = self.get_stackup().get_metal_by_index(1).name
cover_layers = list(map(lambda m: m.name, self.get_stackup().get_metals_below_layer(current_top_layer)))
output.append("create_place_halo -insts {inst} -halo_deltas {{{s} {s} {s} {s}}} -snap_to_site".format(
inst=new_path, s=spacing))
output.append("create_route_halo -bottom_layer {b} -space {s} -top_layer {t} -inst {inst}".format(
inst=new_path, b=bot_layer, t=current_top_layer, s=spacing))
output.append("create_route_blockage -pg_nets -inst {inst} -layers {{{layers}}} -cover".format(
inst=new_path, layers=" ".join(cover_layers)))

elif constraint.type == PlacementConstraintType.Obstruction:
obs_types = get_or_else(constraint.obs_types, []) # type: List[ObstructionType]
if ObstructionType.Place in obs_types:
Expand Down Expand Up @@ -1096,7 +1100,6 @@ def specify_std_cell_power_straps(self, blockage_spacing: Decimal, bbox: Optiona
layer = self.get_stackup().get_metal(layer_name)
results = [
"# Power strap definition for layer {} (rails):\n".format(layer_name),
"reset_db -category add_stripes",
"set_db add_stripes_stacked_via_bottom_layer {}".format(layer_name),
"set_db add_stripes_stacked_via_top_layer {}".format(layer_name),
"set_db add_stripes_spacing_from_block {}".format(blockage_spacing)
Expand Down Expand Up @@ -1144,10 +1147,8 @@ def specify_power_straps(self, layer_name: str, bottom_via_layer_name: str, bloc
# TODO warn if the straps are off-pitch
results = ["# Power strap definition for layer %s:\n" % layer_name]
results.extend([
"reset_db -category add_stripes",
"set_db add_stripes_stacked_via_top_layer {}".format(layer_name),
"set_db add_stripes_stacked_via_bottom_layer {}".format(bottom_via_layer_name),
"set_db add_stripes_trim_antenna_back_to_shape {stripe}",
"set_db add_stripes_spacing_from_block {}".format(blockage_spacing)
])
layer = self.get_stackup().get_metal(layer_name)
Expand Down
16 changes: 16 additions & 0 deletions hammer/tech/stackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,22 @@ def get_metal(self, name: str) -> Metal:
return m
raise ValueError("Metal named %s is not defined in stackup %s" % (name, self.name))

def get_metals_below_layer(self, name: str) -> List[Metal]:
"""
Get all the metals below the specified metal layer.

:param index: Index of the metal layer
:return: A list of metal layer objects
"""
try:
index = next(m.index for m in self.metals if m.name == name)
if index > 1:
return list(filter(lambda m: m.index in range(1, index), self.metals))
else:
raise ValueError("There are no metals below layer %s in stackup %s" % (name, self.name))
except StopIteration:
raise ValueError("Metal named %s is not defined in stackup %s" % (name, self.name))

def get_metal_by_index(self, index: int) -> Metal:
"""
Get a given metal layer by index.
Expand Down