Skip to content

Commit a41b44b

Browse files
committed
move hvl ls hack from hammer-driver to tech init
1 parent f29444f commit a41b44b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

hammer/technology/sky130/__init__.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ def post_install_script(self) -> None:
491491
self.setup_techlef()
492492
self.setup_io_lefs()
493493
self.setup_calibre_lvs_deck()
494+
self.setup_hvl_ls_lef()
494495
print("Loaded Sky130 Tech")
495496

496497
def setup_calibre_lvs_deck(self) -> bool:
@@ -772,6 +773,35 @@ def setup_io_lefs(self) -> None:
772773

773774
df.writelines(sl)
774775

776+
def setup_hvl_ls_lef(self) -> bool:
777+
# Treat HVL cells as if they were hard macros to avoid needing to set them
778+
# up "properly" with multiple power domains
779+
780+
lef_name = "sky130_fd_sc_hvl__lsbufhv2lv_1.lef"
781+
782+
sky130A_path = Path(self.get_setting('technology.sky130.sky130A'))
783+
source_path = sky130A_path / 'libs.ref' / 'sky130_fd_sc_hvl' / 'lef' / "sky130_fd_sc_hvl.lef"
784+
cache_path = Path(self.cache_dir) / "fd_sc_hvl__lef" / lef_name
785+
cache_path.parent.mkdir(exist_ok=True)
786+
787+
with source_path.open("r") as sf, cache_path.open("w") as df:
788+
self.logger.info(f"Patching HVL LS LEF: {source_path} -> {cache_path}")
789+
is_in_site_def = False
790+
is_in_macro_def = False
791+
for line in sf:
792+
if is_in_site_def:
793+
if 'END unithv' in line:
794+
is_in_site_def = False
795+
elif not is_in_macro_def and 'SITE unithv' in line:
796+
is_in_site_def = True
797+
elif 'MACRO ' in line:
798+
is_in_macro_def = True
799+
df.write(line)
800+
elif 'SITE unithv' in line:
801+
pass
802+
else:
803+
df.write(line.replace("CLASS CORE", "CLASS BLOCK") if not (("ANTENNACELL" in line) or ("SPACER" in line)) else line)
804+
775805
def get_tech_par_hooks(self, tool_name: str) -> List[HammerToolHookAction]:
776806
hooks = {
777807
"innovus": [

0 commit comments

Comments
 (0)