Skip to content

Commit 0f5388e

Browse files
authored
Merge pull request #2 from ucb-eecs151tapeout/barduino-sky130_scl-changes
Hammer flows for Cadence accepted Barduino run
2 parents 7bd1cc2 + b28da70 commit 0f5388e

File tree

1 file changed

+69
-44
lines changed

1 file changed

+69
-44
lines changed

hammer/technology/sky130/__init__.py

Lines changed: 69 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def gen_config(self) -> None:
8383
libs += [
8484
Library(
8585
lef_file=os.path.join(SKY130_SCL, "sky130_scl_9T_tech/lef/sky130_scl_9T_phyCells.lef"),
86+
gds_file=os.path.join(SKY130_SCL, "sky130_scl_9T_tech/gds/sky130_scl_9T_tech.gds"),
8687
provides=[Provide(lib_type="technology")],
8788
),
8889
]
@@ -236,7 +237,14 @@ def gen_config(self) -> None:
236237
# The cadence PDK (as of version 0.0.3) doesn't seem to have tap nor decap cells, so par won't run (and if we forced it to, lvs would fail)
237238
spcl_cells = [
238239
SpecialCell(
239-
cell_type="stdfiller", name=[f"FILL{i**2}" for i in range(7)]
240+
cell_type=CellType("stdfiller"), name=["FILL1", "FILL2", "FILL4", "FILL8", "FILL16"]
241+
),
242+
SpecialCell(
243+
cell_type=CellType("decap"),
244+
name=[
245+
"FILL_DECAP8",
246+
"FILL_DECAP16",
247+
],
240248
),
241249
SpecialCell(
242250
cell_type="driver",
@@ -803,9 +811,9 @@ def get_tech_par_hooks(self, tool_name: str) -> List[HammerToolHookAction]:
803811
if self.get_setting("technology.sky130.stdcell_library") == "sky130_scl":
804812
hooks["innovus"].extend(
805813
[
806-
HammerTool.make_pre_insertion_hook(
807-
"power_straps", power_rail_straps_no_tapcells
808-
),
814+
# HammerTool.make_pre_insertion_hook(
815+
# "power_straps", power_rail_straps_no_tapcells
816+
# ), # replaced by manual power rail settings in design-ofo.yml - jim 8/2/2025
809817
HammerTool.make_pre_insertion_hook(
810818
"clock_tree", set_cts_base_cells
811819
),
@@ -834,11 +842,7 @@ def get_tech_drc_hooks(self, tool_name: str) -> List[HammerToolHookAction]:
834842
"generate_drc_ctl_file", pegasus_drc_blackbox_srams
835843
)
836844
)
837-
pegasus_hooks.append(
838-
HammerTool.make_post_insertion_hook(
839-
"generate_drc_ctl_file", pegasus_drc_blackbox_io_cells
840-
)
841-
)
845+
# jim - removed 8/9/2025: previously had hook to pegasus_drc_blackbox_io_cells - we need to run drc on io cells since cadence will not black box io cells for signoff
842846
pegasus_hooks.append(
843847
HammerTool.make_post_insertion_hook(
844848
"generate_drc_ctl_file", false_rules_off
@@ -864,7 +868,7 @@ def get_tech_lvs_hooks(self, tool_name: str) -> List[HammerToolHookAction]:
864868
)
865869
pegasus_hooks.append(
866870
HammerTool.make_post_insertion_hook(
867-
"generate_lvs_ctl_file", pegasus_lvs_blackbox_srams
871+
"generate_lvs_ctl_file", pegasus_lvs_blackbox
868872
)
869873
)
870874

@@ -980,6 +984,8 @@ def sky130_innovus_settings(ht: HammerTool) -> bool:
980984
set_db place_global_solver_effort high
981985
set_db place_detail_check_cut_spacing true
982986
set_db place_global_cong_effort high
987+
set_db place_detail_use_check_drc true
988+
set_db place_detail_check_route true
983989
set_db add_fillers_with_drc false
984990
985991
##########################################################
@@ -1016,7 +1022,7 @@ def sky130_innovus_settings(ht: HammerTool) -> bool:
10161022
set_db route_design_with_timing_driven true
10171023
set_db route_design_concurrent_minimize_via_count_effort high
10181024
set_db opt_consider_routing_congestion true
1019-
set_db route_design_detail_use_multi_cut_via_effort medium
1025+
set_db route_design_detail_use_multi_cut_via_effort high
10201026
"""
10211027
)
10221028
if ht.hierarchical_mode in {HierarchicalMode.Top, HierarchicalMode.Flat}:
@@ -1126,40 +1132,24 @@ def calibre_drc_blackbox_srams(ht: HammerTool) -> bool:
11261132
return True
11271133

11281134

1129-
# pegasus won't be able to drc the sky130a ios
1130-
def pegasus_drc_blackbox_io_cells(ht: HammerTool) -> bool:
1131-
assert isinstance(ht, HammerDRCTool) and ht.tool_config_prefix() == "drc.pegasus", (
1132-
"Exlude IOs only for Pegasus DRC"
1133-
)
1134-
drc_box = ""
1135-
io_cell_names = [
1136-
"sky130_ef_io__*"
1137-
] # TODO i don't think epgasus actually recognizes these?
1138-
# io_cell_names = ["sky130_ef_io__gpiov2_pad_wrapped"]
1139-
for name in io_cell_names:
1140-
drc_box += f"\nexclude_cell {name}"
1141-
run_file = ht.drc_ctl_file # type: ignore
1142-
with open(run_file, "a") as f:
1143-
f.write(drc_box)
1144-
return True
1145-
11461135
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
1136+
# in sky130_rev_0.0_2.3 or newer decks, 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
11481137
# if FALSEOFF is defined, the rules are turned off
11491138
# docs for hooks: /scratch/ee198-20-aaf/barduino-ofot/vlsi/hammer/hammer/drc/pegasus/README.md
11501139

1151-
# Version 0.0_2.7 June 13, 2025
1140+
# Following is for version 0.0_2.10 of DRC decks - configurator options in sky130_release_0.0.9/Sky130_DRC/sky130.drc.cfg
1141+
# to update these, load the cfg file into the GUI, then look at the updated pegasusdrcctl file and see what the configurator sets variables to
11521142
drc_box = """
11531143
//=== Configurator controls ===
1154-
#DEFINE FALSEOFF
1144+
#UNDEFINE FALSEOFF
11551145
// (these rules are on by default and may produce false violations)
1156-
#DEFINE SRAM
1146+
#UNDEFINE SRAM
11571147
// These are the affected rules and alternate implementation:
11581148
// licon.4a: licon in areaid.ce must overlap LI
11591149
// licon.4b: licon in areaid.ce must overlap (poly or diff or tap)
11601150
// mcon.cover.1: mcon in areaid.ce must overlap LI
11611151
// ** WARNING: This switch is for debugging purposes only, errors may be missed **
1162-
#DEFINE NODEN
1152+
#UNDEFINE NODEN
11631153
// Recommended Rules (RC,RR) & Guidelines (NC)
11641154
#UNDEFINE RC
11651155
#UNDEFINE NC
@@ -1173,6 +1163,7 @@ def false_rules_off(x: HammerTool) -> bool:
11731163
f.write(drc_box)
11741164
return True
11751165

1166+
11761167
def pegasus_drc_blackbox_srams(ht: HammerTool) -> bool:
11771168
assert isinstance(ht, HammerDRCTool), "Exlude SRAMs only in DRC"
11781169
drc_box = ""
@@ -1218,26 +1209,60 @@ def pegasus_lvs_add_130a_primitives(ht: HammerTool) -> bool:
12181209
f.write(fixed_contents)
12191210
return True
12201211

1221-
1222-
def pegasus_lvs_blackbox_srams(ht: HammerTool) -> bool:
1212+
# we'll use 1 hook for all lvs backboxes
1213+
def pegasus_lvs_blackbox(ht: HammerTool) -> bool:
12231214
assert isinstance(ht, HammerLVSTool), "Blackbox and filter SRAMs only in LVS"
12241215
lvs_box = ""
1225-
for (
1226-
name
1227-
# + SKY130Tech.sky130_sram_primitive_names()
1228-
) in SKY130Tech.sky130_sram_names():
1216+
for name in SKY130Tech.sky130_sram_names():
12291217
lvs_box += f"\nlvs_black_box {name} -gray"
12301218
run_file = ht.lvs_ctl_file # type: ignore
1219+
lvs_box += f"\nlvs_black_box simple_por -gray"
1220+
lvs_box += f"\nlvs_black_box sky130_ef_io__* -black"
1221+
lvs_box += f"\nlvs_black_box sky130_fd_io__* -black"
1222+
lvs_box += f"\nlvs_black_box sky130_ef_io__vssio_hvc_clamped_pad -black"
1223+
lvs_box += f"\nlvs_black_box sky130_ef_io__vssa_hvc_clamped_pad -black"
1224+
lvs_box += f"\nlvs_black_box sky130_ef_io__vssd_lvc_clamped3_pad -black"
1225+
lvs_box += f"\nlvs_black_box sky130_ef_io__vdda_hvc_clamped_pad -black"
1226+
lvs_box += f"\nlvs_black_box sky130_ef_io__vccd_lvc_clamped3_pad -black"
1227+
lvs_box += f"\nlvs_black_box sky130_ef_io__vssd_lvc_clamped_pad -black"
1228+
lvs_box += f"\nlvs_black_box sky130_ef_io__vccd_lvc_clamped_pad -black"
1229+
lvs_box += f"\nlvs_black_box sky130_ef_io__vddio_hvc_clamped_pad -black"
1230+
lvs_box += f"\nlvs_discard_pins yes"
1231+
lvs_box += f"\nlvs_report_max -all"
1232+
12311233
with open(run_file, "r+") as f:
1232-
# Remove SRAM SPICE file includes.
1233-
pattern = "schematic_path.*({}).*spice;\n".format(
1234-
"|".join(SKY130Tech.sky130_sram_names())
1235-
)
1234+
# Remove SRAM SPICE file includes and specific hardcoded sram22.spice include - this file is on bwrc servers, not on inst machines
1235+
sram_names_regex = "|".join(SKY130Tech.sky130_sram_names())
1236+
pattern = rf'schematic_path\s+.*({sram_names_regex}|sram22\.spice)".*spice;\n'
12361237
matcher = re.compile(pattern)
1238+
12371239
contents = f.read()
1238-
fixed_contents = matcher.sub("", contents) + lvs_box
1240+
fixed_contents = matcher.sub("", contents)
1241+
1242+
# Replace layout_path line (FIXME)
1243+
fixed_contents = re.sub(
1244+
r'layout_path\s+".*?";',
1245+
'layout_path "/scratch/jfx/barduino-ofot/vlsi/build/chipyard.harness.TestHarness.BarduinoConfig-ChipTop/par-rundir/ChipTop_drc_lvs.gds";',
1246+
fixed_contents,
1247+
)
1248+
1249+
# Replace lvs_power_name and lvs_ground_name lines
1250+
fixed_contents = re.sub(
1251+
r'lvs_power_name\s+VDD\s*;',
1252+
'lvs_power_name VDD VPWR vdd VPB VPWR vdd1v8 VCCD VCCHIB VCCD1;',
1253+
fixed_contents
1254+
)
1255+
fixed_contents = re.sub(
1256+
r'lvs_ground_name\s+VSS\s*;',
1257+
'lvs_ground_name VSS VGND vss VNB LVGND vss1v8 VGND vss3v3 VNB VSSIO VSSIO_Q VSSD VSSD1 VSSA;',
1258+
fixed_contents
1259+
)
1260+
1261+
fixed_contents += lvs_box
1262+
12391263
f.seek(0)
12401264
f.write(fixed_contents)
1265+
f.truncate()
12411266
return True
12421267

12431268

0 commit comments

Comments
 (0)