<@U016EM8L91B> I took another look at the antenna ...
# magic
a
@Tim Edwards I took another look at the antenna violation differences between magic and Openroad. I now see the partial mode in magic (which sky130 is using), but it looks like magic include the connected vias.
Ugly hack, but I can fix the problematic net (with a 2x larger antenna violation) by ignoring vias (met2 is also summing v1 and v2).
Copy code
@@ -557,8 +561,9 @@ antennacheckVisit(dev, hc, scale, trans, editUse)
                    {
                        if (ExtCurStyle->exts_antennaRatio[i].ratioGate > 0)
                        {
-                           anttotal += (double)antennaarea[i] /
-                                   (double)ExtCurStyle->exts_antennaRatio[i].ratioGate;
+                           if (DBTypeShortName(i)[0] != 'v')
+                               anttotal += (double)antennaarea[i] /
+                                       (double)ExtCurStyle->exts_antennaRatio[i].ratioGate;
                        }
                        if (ExtCurStyle->exts_antennaRatio[i].ratioGate > saveRatio)
                            saveRatio = ExtCurStyle->exts_antennaRatio[i].ratioGate;
Just to reiterate, I've only spent a bit of time looking at this part of the LEF spec, so am somewhat guessing here.
t
Sounds likely. Descriptions of antenna violations, rules, and fixing usually don't address what you're supposed to do about vias. However, what you want in the code above is probably
if (!DBIsContact(i))
.
a
Thanks @Tim Edwards I submitted a fix to ignore vias when in partial mode: https://github.com/RTimothyEdwards/magic/pull/180
t
I'll need to take a close look at that modification; you can't necessarily ignore contacts because in magic the contact type comprises both the cut and the surrounding metal. I think that is already properly handled but I want to be certain before I merge the code. I intend to get to it today.