So an issue that we encounter quite often in tinytapeout when hardening with the
hd
library is that it fails the
npc.2
klayout FEOL precheck.
After investigating a bit the cases that happens and how the various cells are laid out, I think the main culprit is actually the
conb_1
cell.
To make sure cells can abut properly, the
npc
geometry of the cell must have the "central" band which is common to all cells and if it needs more geometry to contact a gate outside of that area then either that geometry needs to be more than 0.27u away from the edge, or it must extend right to the edge. This avoid forming a small gap between two abutting cells.
The current geometry of
conb_1
doesn't respect this.
I have written a demonstration python script using
gdspy
that corrects the
npc
geometry inside the
conb_1
cell and this has fixed the issue in the various cases we encountered (
https://pastebin.com/uQqhi3eY ). The geometry still doesn't strictly conform to the requirements above, so it's not 100% fool proof but AFAICT it's enough to fix compatibility with all the other cells. (I'll need to write a quick script to verify that though).
So how would one go about getting this fixed in the PDK ? If we're following the same path as for the
decap_12
issue, I think a new
sky130_ef_hd__conb_1
should be added and then pointing yosys to use this instead of the one in the library ?