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

sky130: fix I/O modifications #878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
Loading