Skip to content

Commit

Permalink
Add some assertions to sanity check the tech plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jwright6323 authored and edwardcwang committed May 19, 2019
1 parent 063e111 commit 984e657
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/hammer-tech/stackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ def get_width_spacing_start_twwt(self, tracks: int, force_even: bool = False) ->
"""
widths_and_spacings = self.power_strap_widths_and_spacings
spacing = widths_and_spacings[0].min_spacing
assert self.pitch - self.min_width == spacing, "Tech plugin is malformed for metal {}, the minimum spacing in the width-spacing list must be the same as (pitch - min_width).".format(self.name)
# the T W W T pattern contains two wires (W2) and 3 spaces (S3)
s3w2 = ((2 * tracks) + 1) * self.pitch - self.min_width
width = (s3w2 - spacing * 3) / 2
Expand Down
2 changes: 2 additions & 0 deletions src/hammer-vlsi/hammer_vlsi/hammer_vlsi_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,8 @@ def specify_power_straps_by_tracks(self, layer_name: str, bottom_via_layer: str,
width, spacing, strap_start = layer.get_width_spacing_start_twt(track_width)
spacing = 2*spacing + (track_spacing - 1) * layer.pitch + layer.min_width
offset = track_offset + track_start * layer.pitch + strap_start
assert width > Decimal(0), "Width must be greater than zero. You probably have a malformed tech plugin on layer {}.".format(layer_name)
assert spacing > Decimal(0), "Spacing must be greater than zero. You probably have a malformed tech plugin on layer {}.".format(layer_name)
return self.specify_power_straps(layer_name, bottom_via_layer, blockage_spacing, pitch, width, spacing, offset, bbox, nets, add_pins)

def specify_all_power_straps_by_tracks(self, layer_names: List[str], ground_net: str, power_nets: List[str], power_weights: List[int], bbox: Optional[List[Decimal]], pin_layers: List[str]) -> List[str]:
Expand Down

0 comments on commit 984e657

Please sign in to comment.