

CO5.a / CO5.b rules are not implemented correctly in KLayout DRC deck.NPLUS generated by magic. And the NPLUS does overlap the contact by 0.1um which is all that's needed. Yes, the COMP ends before 0.1um but CO5.b doesn't require COMP to enclose the contact by 0.1um, only the NPLUS.

co_5a_ncomp_butted = ncomp.interacting(pcomp).not_overlapping(pcomp)
co_ncomp_check = contact.interacting(co_5a_ncomp_butted)
co5a_l1 = co_ncomp_check.enclosed(co_5a_ncomp_butted, 0.1.um, euclidian)
co5a_l1.output('CO.5a', 'CO.5a : Nplus overlap of contact on COMP (butted N+/P+) : 0.1µm') co5a_l1 = co_ncomp_check.enclosed(nplus, 0.1.um, euclidian)
