feat(precheck): port the gds/lef pin consistency check to gf180mcuD

This commit is contained in:
htfab
2026-07-29 17:39:19 +02:00
parent d869909e41
commit ff75e344cd
2 changed files with 41 additions and 32 deletions
+7 -4
View File
@@ -410,7 +410,6 @@ def pin_check(
gds_errors = 0 gds_errors = 0
if tech != "gf180mcuD":
gds_layers = valid_lef_port_layers[tech] gds_layers = valid_lef_port_layers[tech]
gds_layer_lookup = {j: i for i, j in gds_layers.items()} gds_layer_lookup = {j: i for i, j in gds_layers.items()}
polygon_list = {layer: [] for layer in gds_layers} polygon_list = {layer: [] for layer in gds_layers}
@@ -425,13 +424,17 @@ def pin_check(
for current_pin, lef_rects in sorted(lef_ports_orig.items()): for current_pin, lef_rects in sorted(lef_ports_orig.items()):
for layer, lx, by, rx, ty in lef_rects: for layer, lx, by, rx, ty in lef_rects:
if layer + ".pin" not in gds_layers: if tech == "gf180mcuD":
pin_layer = f"{layer}_label"
else:
pin_layer = f"{layer}.pin"
if pin_layer not in gds_layers:
raise PrecheckFailure( raise PrecheckFailure(
f"Unexpected port layer in LEF: {current_pin} is on layer {layer}" f"Unexpected port layer in LEF: {current_pin} is on layer {layer}"
) )
pin_ok = False pin_ok = False
for poly in merged_layers[layer + ".pin"]: for poly in merged_layers[pin_layer]:
if poly.contain_all( if poly.contain_all(
((lx + 1) / 1000, (by + 1) / 1000), ((lx + 1) / 1000, (by + 1) / 1000),
((rx - 1) / 1000, (by + 1) / 1000), ((rx - 1) / 1000, (by + 1) / 1000),
@@ -442,7 +445,7 @@ def pin_check(
if not pin_ok: if not pin_ok:
logging.error( logging.error(
f"Port {current_pin} missing from layer {layer}.pin in {gds}" f"Port {current_pin} missing from layer {pin_layer} in {gds}"
) )
gds_errors += 1 gds_errors += 1
+6
View File
@@ -163,6 +163,12 @@ valid_lef_port_layers = {
"Metal5.pin": (67, 2), "Metal5.pin": (67, 2),
"TopMetal1.pin": (126, 2), "TopMetal1.pin": (126, 2),
}, },
"gf180mcuD": {
"Metal1_label": (34, 10),
"Metal2_label": (36, 10),
"Metal3_label": (42, 10),
"Metal4_label": (46, 10),
},
} }
forbidden_layers = { forbidden_layers = {
"sky130A": [ "sky130A": [