Skip to content

Commit 0b9f0af

Browse files
authored
Merge pull request #1 from ucb-eecs151tapeout/jim-changes
add yml key for drc decks, add hook to turn off false rules for Pegasus DRC - More details see #1
2 parents 518ee4e + dba7fc7 commit 0b9f0af

File tree

3 files changed

+42
-24
lines changed

3 files changed

+42
-24
lines changed

hammer/technology/sky130/__init__.py

Lines changed: 39 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -221,20 +221,13 @@ def gen_config(self) -> None:
221221
]
222222
drc_decks = [
223223
DRCDeck(
224-
tool_name="calibre",
225-
deck_name="calibre_drc",
226-
path="$SKY130_NDA/s8/V2.0.1/DRC/Calibre/s8_drcRules",
227-
),
228-
DRCDeck(
229-
tool_name="klayout",
230-
deck_name="klayout_drc",
231-
path="$SKY130A/libs.tech/klayout/drc/sky130A.lydrc",
232-
),
233-
DRCDeck(
234-
tool_name="pegasus",
235-
deck_name="pegasus_drc",
236-
path="$SKY130_CDS/Sky130_DRC/sky130_rev_0.0_2.2.drc.pvl",
237-
),
224+
tool_name=self.get_setting("vlsi.core.drc_tool").replace(
225+
"hammer.drc.", ""
226+
),
227+
deck_name=f"{self.get_setting('vlsi.core.drc_tool').replace('hammer.drc.', '')}_drc",
228+
path=path,
229+
)
230+
for path in self.get_setting("technology.sky130.drc_deck_sources")
238231
]
239232

240233
elif slib == "sky130_scl":
@@ -300,17 +293,13 @@ def gen_config(self) -> None:
300293
]
301294
drc_decks = [
302295
DRCDeck(
303-
tool_name="calibre",
304-
deck_name="calibre_drc",
305-
path="$SKY130_NDA/s8/V2.0.1/DRC/Calibre/s8_drcRules",
306-
),
307-
DRCDeck(
308-
tool_name="pegasus",
309-
deck_name="pegasus_drc",
310-
path=os.path.join(
311-
SKY130_CDS, "Sky130_DRC", "sky130_rev_0.0_2.2.drc.pvl"
296+
tool_name=self.get_setting("vlsi.core.drc_tool").replace(
297+
"hammer.drc.", ""
312298
),
313-
),
299+
deck_name=f"{self.get_setting('vlsi.core.drc_tool').replace('hammer.drc.', '')}_drc",
300+
path=path,
301+
)
302+
for path in self.get_setting("technology.sky130.drc_deck_sources")
314303
]
315304

316305
else:
@@ -850,6 +839,11 @@ def get_tech_drc_hooks(self, tool_name: str) -> List[HammerToolHookAction]:
850839
"generate_drc_ctl_file", pegasus_drc_blackbox_io_cells
851840
)
852841
)
842+
pegasus_hooks.append(
843+
HammerTool.make_post_insertion_hook(
844+
"generate_drc_ctl_file", false_rules_off
845+
)
846+
)
853847
hooks = {"calibre": calibre_hooks, "pegasus": pegasus_hooks}
854848
return hooks.get(tool_name, [])
855849

@@ -1149,6 +1143,27 @@ def pegasus_drc_blackbox_io_cells(ht: HammerTool) -> bool:
11491143
f.write(drc_box)
11501144
return True
11511145

1146+
def false_rules_off(x: HammerTool) -> bool:
1147+
# 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
1148+
# if FALSEOFF is defined, the rules are turned off
1149+
# docs for hooks: /scratch/ee198-20-aaf/barduino-ofot/vlsi/hammer/hammer/drc/pegasus/README.md
1150+
drc_box = """
1151+
//=== Configurator controls ===
1152+
// Turn OFF rules that may be inaccurate due to out-of-date DRM information
1153+
// (these rules are on by default and may produce false violations)
1154+
#DEFINE FALSEOFF
1155+
// Recommended Rules (RC,RR) & Guidelines (NC)
1156+
#UNDEFINE RC
1157+
#UNDEFINE NC
1158+
// Optional Switches
1159+
#UNDEFINE frontend
1160+
#UNDEFINE backend
1161+
//=== End of configurator controls ===
1162+
"""
1163+
run_file = x.drc_ctl_file # type: ignore
1164+
with open(run_file, "a") as f:
1165+
f.write(drc_box)
1166+
return True
11521167

11531168
def pegasus_drc_blackbox_srams(ht: HammerTool) -> bool:
11541169
assert isinstance(ht, HammerDRCTool), "Exlude SRAMs only in DRC"

hammer/technology/sky130/defaults.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ technology.sky130:
2828

2929
pdk_home: "${technology.sky130.sky130_nda}/s8/V2.0.1" # Shouldn't need to change these
3030
pdk_home_meta: lazysubst
31+
drc_deck_sources: # DRC decks, one element for each deck
32+
- "${technology.sky130.sky130_cds}/Sky130_DRC/sky130_rev_0.0_2.6.drc.pvl"
3133
lvs_deck_sources:
3234
- "${technology.sky130.pdk_home}/LVS/Calibre/lvsControlFile_s8"
3335
lvs_deck_sources_meta: lazysubst

hammer/technology/sky130/defaults_types.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ technology.sky130:
2727

2828
# Shouldn't need to change these
2929
pdk_home: Optional[str]
30+
drc_deck_sources: Optional[list[str]]
3031
lvs_deck_sources: Optional[list[str]]
3132

3233
# Path to IO file

0 commit comments

Comments
 (0)