Skip to content
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
63 changes: 39 additions & 24 deletions hammer/technology/sky130/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,13 @@ def gen_config(self) -> None:
]
drc_decks = [
DRCDeck(
tool_name="calibre",
deck_name="calibre_drc",
path="$SKY130_NDA/s8/V2.0.1/DRC/Calibre/s8_drcRules",
),
DRCDeck(
tool_name="klayout",
deck_name="klayout_drc",
path="$SKY130A/libs.tech/klayout/drc/sky130A.lydrc",
),
DRCDeck(
tool_name="pegasus",
deck_name="pegasus_drc",
path="$SKY130_CDS/Sky130_DRC/sky130_rev_0.0_2.2.drc.pvl",
),
tool_name=self.get_setting("vlsi.core.drc_tool").replace(
"hammer.drc.", ""
),
deck_name=f"{self.get_setting('vlsi.core.drc_tool').replace('hammer.drc.', '')}_drc",
path=path,
)
for path in self.get_setting("technology.sky130.drc_deck_sources")
]

elif slib == "sky130_scl":
Expand Down Expand Up @@ -300,17 +293,13 @@ def gen_config(self) -> None:
]
drc_decks = [
DRCDeck(
tool_name="calibre",
deck_name="calibre_drc",
path="$SKY130_NDA/s8/V2.0.1/DRC/Calibre/s8_drcRules",
),
DRCDeck(
tool_name="pegasus",
deck_name="pegasus_drc",
path=os.path.join(
SKY130_CDS, "Sky130_DRC", "sky130_rev_0.0_2.2.drc.pvl"
tool_name=self.get_setting("vlsi.core.drc_tool").replace(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably fine

"hammer.drc.", ""
),
),
deck_name=f"{self.get_setting('vlsi.core.drc_tool').replace('hammer.drc.', '')}_drc",
path=path,
)
for path in self.get_setting("technology.sky130.drc_deck_sources")
]

else:
Expand Down Expand Up @@ -850,6 +839,11 @@ def get_tech_drc_hooks(self, tool_name: str) -> List[HammerToolHookAction]:
"generate_drc_ctl_file", pegasus_drc_blackbox_io_cells
)
)
pegasus_hooks.append(
HammerTool.make_post_insertion_hook(
"generate_drc_ctl_file", false_rules_off
)
)
hooks = {"calibre": calibre_hooks, "pegasus": pegasus_hooks}
return hooks.get(tool_name, [])

Expand Down Expand Up @@ -1149,6 +1143,27 @@ def pegasus_drc_blackbox_io_cells(ht: HammerTool) -> bool:
f.write(drc_box)
return True

def false_rules_off(x: HammerTool) -> bool:
# in sky130_rev_0.0_2.3 rules, cadence included a .cfg to turn off false rules - this typically has to be loaded via the GUI but this step hacks the flags into pegasusdrcctl and turns the false rules off
# if FALSEOFF is defined, the rules are turned off
# docs for hooks: /scratch/ee198-20-aaf/barduino-ofot/vlsi/hammer/hammer/drc/pegasus/README.md
drc_box = """
//=== Configurator controls ===
// Turn OFF rules that may be inaccurate due to out-of-date DRM information
// (these rules are on by default and may produce false violations)
#DEFINE FALSEOFF
// Recommended Rules (RC,RR) & Guidelines (NC)
#UNDEFINE RC
#UNDEFINE NC
// Optional Switches
#UNDEFINE frontend
#UNDEFINE backend
//=== End of configurator controls ===
"""
run_file = x.drc_ctl_file # type: ignore
with open(run_file, "a") as f:
f.write(drc_box)
return True

def pegasus_drc_blackbox_srams(ht: HammerTool) -> bool:
assert isinstance(ht, HammerDRCTool), "Exlude SRAMs only in DRC"
Expand Down
2 changes: 2 additions & 0 deletions hammer/technology/sky130/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ technology.sky130:

pdk_home: "${technology.sky130.sky130_nda}/s8/V2.0.1" # Shouldn't need to change these
pdk_home_meta: lazysubst
drc_deck_sources: # DRC decks, one element for each deck
- "${technology.sky130.sky130_cds}/Sky130_DRC/sky130_rev_0.0_2.6.drc.pvl"
lvs_deck_sources:
- "${technology.sky130.pdk_home}/LVS/Calibre/lvsControlFile_s8"
lvs_deck_sources_meta: lazysubst
Expand Down
1 change: 1 addition & 0 deletions hammer/technology/sky130/defaults_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ technology.sky130:

# Shouldn't need to change these
pdk_home: Optional[str]
drc_deck_sources: Optional[list[str]]
lvs_deck_sources: Optional[list[str]]

# Path to IO file
Expand Down
Loading