Skip to content

Expose sram_exclude flag to KLayout FEOL/BEOL checks for sky130A projects #108

@shivarammysore

Description

@shivarammysore

Summary

The sky130A_mr.drc deck (shipped in src/cf_precheck/drc_scripts/) exposes a $sram_exclude runtime variable that gates off rule blocks inside vendor SRAM cells. Projects integrating commercial SRAMs (signed off by the vendor under their own deck) need to enable it to avoid floods of false-positive DRC violations inside the macro guts. cf-precheck does not currently pass it — the flag is dead-code from the caller's perspective.

Repro

Integrate any commercial sky130A SRAM (e.g. ChipFoundry CF_SRAM_1024x32) whose GDS has internal hierarchy that isn't signed off against the public sky130A_mr.drc deck. Running cf precheck produces tens of thousands of BEOL violations inside the vendor cell, plus a FEOL stat=6 error when KLayout can't parse some internal structures.

Observed on vyges/vyges-edge-sensor-soc run 24674550255:

  • [ 4/13] Klayout FEOL — FAIL (stat=6)
  • [ 5/13] Klayout BEOL — FAIL, 29,730 DRC violations (all inside CF_SRAM_1024x32_macro)

Separately, Magic's DRC step silently swallows the same cell with "Error while reading cell", producing a false DRC-clean, so the 29,730 KLayout violations are the only signal — and they're noise.

Root cause

src/cf_precheck/checks/klayout_drc.py builds klayout_cmd_extra_args:

```python
class KlayoutFEOL(_KlayoutDRCBase):
self.klayout_cmd_extra_args = ["-rd", "feol=true"] + self._pdk_extra_args()

class KlayoutBEOL(_KlayoutDRCBase):
self.klayout_cmd_extra_args = ["-rd", "beol=true"] + self._pdk_extra_args()
```

_pdk_extra_args() has gf180mcu branches but returns [] for sky130A/sky130B. There is no hook to pass -rd sram_exclude=true, even though sky130A_mr.drc defaults it to "false" since 2024-09-01 and supports it explicitly:

```ruby

sky130A_mr.drc

if not defined? $sram_exclude
$sram_exclude = "false"
end
...
if SRAM_EXCLUDE

rule blocks skipped inside vendor SRAMs

end
```

Proposed fix

Add a sram_exclude knob to project config (e.g. in .cf/project.json or CLI flag --sram-exclude), propagate through to KlayoutFEOL / KlayoutBEOL klayout_cmd_extra_args:

```python
if self.project_config.get("sram_exclude"):
self.klayout_cmd_extra_args += ["-rd", "sram_exclude=true"]
```

Default false to preserve current behavior; opt-in for projects using vendor SRAMs. This matches the deck's own opt-in design and is consistent with how other rule-block toggles (e.g. conn_drc for gf180) are currently surfaced per-PDK.

Why this matters

Every sky130A tapeout that uses a commercial SRAM (OpenRAM-generated variants aside) currently faces this. The established industry practice is to black-box vendor IP for integrator signoff — cf-precheck has the mechanism built-in at the deck layer but no caller-side switch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions