Hello,
I found the feature of custom DRC rules and so I tried it out in a simple example (see schematic and layout below). The idea is to create a keepout area around the oscillator circuit and only the capacitors C1 and C2 and the crystal Y1 are allowed in this area. The keepout zone is on all areas so the capacitor C3 is not allowed in this area. Furthermore all signals GND_C, OSCIN and OSCOUT are allowed.
The idea (i don’t like it) is to create a keepout zone called “RestrictedAreaCrystal” around the circuit but don’t set any restrictions:
Then I create custom DRC rules:
To allow vias inside of this area the custom rule is:
# only vias of the net "GND_C" are allowed in this area
(rule "keepout crystal area via"
(constraint disallow via)
(condition "A.insideArea('RestrictedAreaCrystal') && A.NetName != '/GND_C'")
)
To use it for vias, pads and tracks too:
(rule "keepout crystal area track pad"
(constraint disallow track pad via)
(condition "A.insideArea('RestrictedAreaCrystal') && (A.NetName != '/GND_C' && A.NetName != '/OSCIN' && A.NetName != '/OSCOUT')"))
Schematic:
Layout:
One thing I don’t like on this approach is, that I uncheck all disallowances from the keepout area menu.
What is the best approach solving this problem
- Creating such rules and allowing everything from the keepout area menu
- Excluding the errors once they occur
- Something else
KicadCustomKeepOut.zip (24.0 KB)