Skip to content

Commit

Permalink
sky130: fix I/O modifications
Browse files Browse the repository at this point in the history
The sky130 tech JSON references the modified I/O LEFs, so the plugin
as-is currently breaks with a missing file.
This commit un-comments the modifications and fixes it.
As of the following PDK commits, the begin/end lines are now correct
and this hack is no longer needed.

skywater-pdk 7198cf647113f56041e02abf3eb623692820c5e1
open_pdks 320597ea84b2816eb2fcc4fbe10c3874f19c92fc
  • Loading branch information
edwardcwang committed Oct 8, 2024
1 parent faa61a1 commit cd7429f
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions hammer/technology/sky130/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def post_install_script(self) -> None:
# check whether variables were overriden to point to a valid path
self.use_sram22 = os.path.exists(self.get_setting("technology.sky130.sram22_sky130_macros"))
self.setup_cdl()
# self.setup_verilog()
self.setup_verilog()
self.setup_techlef()
# self.setup_io_lefs()
self.setup_io_lefs()
self.logger.info('Loaded Sky130 Tech')


Expand Down Expand Up @@ -214,28 +214,6 @@ def setup_io_lefs(self) -> None:
start = [idx for idx, line in enumerate(sl) if f'MACRO {cell}' in line]
sl[start[0] + 1] = sl[start[0] + 1].replace('AREAIO', 'SPACER')

# Current version has two one-off error that break lef parser.
self.logger.info("Fixing broken sky130_ef_io__analog_esd_pad LEF definition.")
start_broken_macro_list = ["MACRO sky130_ef_io__analog_esd_pad\n", "MACRO sky130_ef_io__analog_pad\n"]
end_broken_macro_list = ["END sky130_ef_io__analog_pad\n", "END sky130_ef_io__analog_noesd_pad\n"]
end_fixed_macro_list = ["END sky130_ef_io__analog_esd_pad\n", "END sky130_ef_io__analog_pad\n"]

for start_broken_macro, end_broken_macro, end_fixed_macro in zip(start_broken_macro_list, end_broken_macro_list, end_fixed_macro_list):
# Get all start indices to be checked
start_check_indices = [idx for idx, line in enumerate(sl) if line == start_broken_macro]

# Extract broken macro
for idx_broken_macro in start_check_indices:
# Find the start of the next_macro
idx_start_next_macro = [idx for idx in range(idx_broken_macro+1, len(sl)) if "MACRO" in sl[idx]][0]
# Find the broken macro ending
idx_end_broken_macro = len(sl)
idx_end_broken_macro = [idx for idx in range(idx_broken_macro+1, len(sl)) if end_broken_macro in sl[idx]][0]

# Fix
if idx_end_broken_macro < idx_start_next_macro:
sl[idx_end_broken_macro] = end_fixed_macro

df.writelines(sl)

def get_tech_par_hooks(self, tool_name: str) -> List[HammerToolHookAction]:
Expand Down

0 comments on commit cd7429f

Please sign in to comment.