← Back to team overview

kicad-developers team mailing list archive

Re: DRC rules

 

I've just tested this on a design and the drc-rules is read, which I
know because if I don't add "(version 1)" at the first line I get an
error message. Other than that I doesn't seem to do anything.

I tried to add "(priority 100)" to the rules, but that is refused when
reading the drc file. It's also not clear to me what the clearance
dimension is, so I assumed nanometers.

I've been using a hack to get clearance rules working for some time, so
the design is already pretty large and uses 209 different netclasses. I
did a clean built of 0658d297e528616e233b4074c27f1bdcb870dede,created
drc-rules and edited the pcb file to create all the netclasses. I then
loaded the board and rebuilt the planes, but all the rules seem to
be ignored. I've attached the drc-rules file for reference.

regards,

Mark
(version 1)
(selector (match_netclass "+12V_ui") (match_netclass "+16P") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "+800V") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "+SOLAR") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "/battery/B+") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "/battery/B-") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "/battery/Flyback_control/DISABLE") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "/battery/Flyback_control/sw") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "/battery/M+") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "/battery/M-") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "/control/CAN1_N") (rule "1mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(J45-Pad1)") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(J46-Pad1)") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(J47-Pad1)") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(J48-Pad1)") (rule "5.5mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R15-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R25-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R269-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R270-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R28-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R306-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R426-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R429-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R432-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R435-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R438-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R440-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R45-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R78-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+12V_ui") (match_netclass "Net-(R79-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "+800V") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/NEUTRAL_out") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "/Vin-") (rule "5.5mm"))
(selector (match_netclass "+16P") (match_netclass "/balancer/GH+") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/battery/B-") (rule "5.5mm"))
(selector (match_netclass "+16P") (match_netclass "/battery/Flyback/sw") (rule "5.5mm"))
(selector (match_netclass "+16P") (match_netclass "/battery/M+") (rule "5.5mm"))
(selector (match_netclass "+16P") (match_netclass "/battery/M-") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/flyback_mains/sw") (rule "5.5mm"))
(selector (match_netclass "+16P") (match_netclass "/half-bridge1/-5V_hs") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/half-bridge2/-5V_hs") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/half-bridge3/-5V_hs") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar0/hv") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar0/pf1") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar0/pf2") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar0/sw1") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar0/sw2") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar1/hv") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar1/pf1") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar1/pf2") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar1/sw1") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/solar1/sw2") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "/supplies/Vin+") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "/supplies/flyback_solar/Vstr") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "/supplies/flyback_solar/sw") (rule "3.2mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(C266-Pad1)") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(C268-Pad1)") (rule "2.4mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(D28-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(D58-Pad2)") (rule "0.56mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(J2-Pad1)") (rule "5.5mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R12-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R169-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R173-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R178-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R18-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R190-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R193-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R241-Pad1)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R373-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R53-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R56-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R58-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R61-Pad2)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R67-Pad1)") (rule "1.3mm"))
(selector (match_netclass "+16P") (match_netclass "Net-(R74-Pad1)") (rule "1.3mm"))
(selector (match_netclass "+800V") (match_netclass "+SOLAR") (rule "2.4mm"))
(selector (match_netclass "+800V") (match_netclass "/NEUTRAL_out") (rule "2.4mm"))
(selector (match_netclass "+800V") (match_netclass "/balancer/GH+") (rule "2.4mm"))
(selector (match_netclass "+800V") (match_netclass "/battery/M+") (rule "2.4mm"))
(selector (match_netclass "+800V") (match_netclass "/half-bridge1/-5V_hs") (rule "2.4mm"))
(selector (match_netclass "+800V") (match_netclass "/half-bridge2/-5V_hs") (rule "2.4mm"))
(selector (match_netclass "+800V") (match_netclass "/half-bridge3/-5V_hs") (rule "2.4mm"))
(selector (match_netclass "+800V") (match_netclass "Net-(D60-Pad2)") (rule "0.56mm"))
(selector (match_netclass "+800V") (match_netclass "Net-(R65-Pad1)") (rule "1.3mm"))
(selector (match_netclass "+SOLAR") (match_netclass "/solar0/hv") (rule "2.4mm"))
(selector (match_netclass "+SOLAR") (match_netclass "/solar1/hv") (rule "2.4mm"))
(selector (match_netclass "+SOLAR") (match_netclass "/supplies/Vin+") (rule "1.3mm"))
(selector (match_netclass "+SOLAR") (match_netclass "Net-(R199-Pad1)") (rule "1.3mm"))
(selector (match_netclass "+SOLAR") (match_netclass "Net-(R277-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L1") (match_netclass "/L2") (rule "1.5mm"))
(selector (match_netclass "/L1") (match_netclass "Net-(R15-Pad1)") (rule "1.3mm"))
(selector (match_netclass "/L1") (match_netclass "Net-(R52-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L1_out") (match_netclass "/NEUTRAL_out") (rule "1.8mm"))
(selector (match_netclass "/L1_out") (match_netclass "Net-(R295-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L1_out") (match_netclass "Net-(R55-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L2") (match_netclass "Net-(R17-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L2") (match_netclass "Net-(R24-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L2_out") (match_netclass "/NEUTRAL_out") (rule "1.8mm"))
(selector (match_netclass "/L2_out") (match_netclass "Net-(R169-Pad1)") (rule "1.3mm"))
(selector (match_netclass "/L2_out") (match_netclass "Net-(R354-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L3") (match_netclass "/N") (rule "1.3mm"))
(selector (match_netclass "/L3") (match_netclass "/Vin+") (rule "1.3mm"))
(selector (match_netclass "/L3") (match_netclass "Net-(R11-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L3") (match_netclass "Net-(R27-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L3_out") (match_netclass "/NEUTRAL_out") (rule "1.8mm"))
(selector (match_netclass "/L3_out") (match_netclass "Net-(R172-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/L3_out") (match_netclass "Net-(R358-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/N") (match_netclass "/Vin-") (rule "1.3mm"))
(selector (match_netclass "/N") (match_netclass "Net-(R176-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/N") (match_netclass "Net-(R44-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/NEUTRAL_out") (match_netclass "/battery/Flyback_control/DISABLE") (rule "0.2mm"))
(selector (match_netclass "/NEUTRAL_out") (match_netclass "Net-(R66-Pad1)") (rule "1.3mm"))
(selector (match_netclass "/Vin+") (match_netclass "/Vin-") (rule "1.3mm"))
(selector (match_netclass "/Vin+") (match_netclass "/flyback_mains/Vstr") (rule "1.3mm"))
(selector (match_netclass "/Vin+") (match_netclass "/flyback_mains/sw") (rule "1.3mm"))
(selector (match_netclass "/Vin-") (match_netclass "/flyback_mains/Vstr") (rule "1.3mm"))
(selector (match_netclass "/Vin-") (match_netclass "/flyback_mains/sw") (rule "3.2mm"))
(selector (match_netclass "/battery/B+") (match_netclass "/battery/B-") (rule "2.4mm"))
(selector (match_netclass "/battery/B+") (match_netclass "/battery/Flyback_control/DISABLE") (rule "1.3mm"))
(selector (match_netclass "/battery/B+") (match_netclass "/battery/Flyback_control/Vstr") (rule "1.3mm"))
(selector (match_netclass "/battery/B+") (match_netclass "/battery/Flyback_control/sw") (rule "1.3mm"))
(selector (match_netclass "/battery/B+") (match_netclass "/battery/M+") (rule "2.4mm"))
(selector (match_netclass "/battery/B+") (match_netclass "Net-(D55-Pad2)") (rule "0.56mm"))
(selector (match_netclass "/battery/B+") (match_netclass "Net-(R431-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/battery/B-") (match_netclass "/battery/Flyback/Vstr") (rule "1.3mm"))
(selector (match_netclass "/battery/B-") (match_netclass "/battery/Flyback/sw") (rule "3.2mm"))
(selector (match_netclass "/battery/B-") (match_netclass "/battery/Flyback_control/DISABLE") (rule "1.3mm"))
(selector (match_netclass "/battery/B-") (match_netclass "/battery/M-") (rule "2.4mm"))
(selector (match_netclass "/battery/B-") (match_netclass "Net-(D53-Pad2)") (rule "0.56mm"))
(selector (match_netclass "/battery/B-") (match_netclass "Net-(R428-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/battery/Flyback/Vstr") (match_netclass "/battery/Flyback/sw") (rule "3.2mm"))
(selector (match_netclass "/battery/Flyback/Vstr") (match_netclass "/battery/Flyback_control/DISABLE") (rule "1.3mm"))
(selector (match_netclass "/battery/Flyback/sw") (match_netclass "/battery/Flyback_control/DISABLE") (rule "1.3mm"))
(selector (match_netclass "/battery/Flyback_control/DISABLE") (match_netclass "/battery/Flyback_control/Vstr") (rule "1.3mm"))
(selector (match_netclass "/battery/Flyback_control/DISABLE") (match_netclass "/battery/Flyback_control/sw") (rule "3.2mm"))
(selector (match_netclass "/battery/Flyback_control/DISABLE") (match_netclass "Net-(D53-Pad2)") (rule "0.56mm"))
(selector (match_netclass "/battery/Flyback_control/DISABLE") (match_netclass "Net-(D55-Pad2)") (rule "0.56mm"))
(selector (match_netclass "/battery/Flyback_control/DISABLE") (match_netclass "Net-(D58-Pad2)") (rule "0.56mm"))
(selector (match_netclass "/battery/Flyback_control/DISABLE") (match_netclass "Net-(D60-Pad2)") (rule "0.56mm"))
(selector (match_netclass "/battery/Flyback_control/DISABLE") (match_netclass "Net-(R425-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/battery/Flyback_control/Vstr") (match_netclass "/battery/Flyback_control/sw") (rule "3.2mm"))
(selector (match_netclass "/battery/M+") (match_netclass "Net-(R437-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/battery/M-") (match_netclass "Net-(R434-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/flyback_mains/Vstr") (match_netclass "/flyback_mains/sw") (rule "3.2mm"))
(selector (match_netclass "/half-bridge1/-5V_hs") (match_netclass "Net-(R205-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/half-bridge2/-5V_hs") (match_netclass "Net-(R298-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/half-bridge3/-5V_hs") (match_netclass "Net-(R357-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/solar0/hv") (match_netclass "Net-(C267-Pad1)") (rule "2.4mm"))
(selector (match_netclass "/solar0/pf1") (match_netclass "/solar0/sw1") (rule "2.4mm"))
(selector (match_netclass "/solar0/pf1") (match_netclass "Net-(R164-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/solar0/pf1") (match_netclass "Net-(R57-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/solar0/pf2") (match_netclass "/solar0/sw2") (rule "2.4mm"))
(selector (match_netclass "/solar0/pf2") (match_netclass "Net-(R268-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/solar0/pf2") (match_netclass "Net-(R60-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/solar1/hv") (match_netclass "Net-(C265-Pad1)") (rule "2.4mm"))
(selector (match_netclass "/solar1/pf1") (match_netclass "/solar1/sw1") (rule "2.4mm"))
(selector (match_netclass "/solar1/pf1") (match_netclass "Net-(R186-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/solar1/pf1") (match_netclass "Net-(R76-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/solar1/pf2") (match_netclass "/solar1/sw2") (rule "2.4mm"))
(selector (match_netclass "/solar1/pf2") (match_netclass "Net-(R192-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/solar1/pf2") (match_netclass "Net-(R77-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/supplies/Vin+") (match_netclass "/supplies/flyback_solar/Vstr") (rule "1.3mm"))
(selector (match_netclass "/supplies/Vin+") (match_netclass "/supplies/flyback_solar/sw") (rule "1.3mm"))
(selector (match_netclass "/supplies/Vin+") (match_netclass "Net-(D28-Pad2)") (rule "1.3mm"))
(selector (match_netclass "/supplies/flyback_solar/Vstr") (match_netclass "/supplies/flyback_solar/sw") (rule "3.2mm"))
(selector (match_netclass "Net-(R11-Pad2)") (match_netclass "Net-(R12-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R15-Pad1)") (match_netclass "Net-(R15-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R164-Pad2)") (match_netclass "Net-(R269-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R169-Pad1)") (match_netclass "Net-(R169-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R17-Pad2)") (match_netclass "Net-(R18-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R172-Pad2)") (match_netclass "Net-(R173-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R176-Pad2)") (match_netclass "Net-(R178-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R186-Pad2)") (match_netclass "Net-(R190-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R192-Pad2)") (match_netclass "Net-(R193-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R199-Pad1)") (match_netclass "Net-(R241-Pad1)") (rule "1.3mm"))
(selector (match_netclass "Net-(R205-Pad2)") (match_netclass "Net-(R295-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R24-Pad2)") (match_netclass "Net-(R25-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R268-Pad2)") (match_netclass "Net-(R270-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R27-Pad2)") (match_netclass "Net-(R28-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R277-Pad2)") (match_netclass "Net-(R306-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R298-Pad2)") (match_netclass "Net-(R354-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R357-Pad2)") (match_netclass "Net-(R358-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R373-Pad2)") (match_netclass "Net-(R440-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R425-Pad2)") (match_netclass "Net-(R426-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R428-Pad2)") (match_netclass "Net-(R429-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R431-Pad2)") (match_netclass "Net-(R432-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R434-Pad2)") (match_netclass "Net-(R435-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R437-Pad2)") (match_netclass "Net-(R438-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R44-Pad2)") (match_netclass "Net-(R45-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R52-Pad2)") (match_netclass "Net-(R53-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R55-Pad2)") (match_netclass "Net-(R56-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R57-Pad2)") (match_netclass "Net-(R58-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R60-Pad2)") (match_netclass "Net-(R61-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R65-Pad1)") (match_netclass "Net-(R67-Pad1)") (rule "1.3mm"))
(selector (match_netclass "Net-(R66-Pad1)") (match_netclass "Net-(R74-Pad1)") (rule "1.3mm"))
(selector (match_netclass "Net-(R76-Pad2)") (match_netclass "Net-(R78-Pad2)") (rule "1.3mm"))
(selector (match_netclass "Net-(R77-Pad2)") (match_netclass "Net-(R79-Pad2)") (rule "1.3mm"))
(rule "0.2mm" (clearance 200000))
(rule "0.56mm" (clearance 560000))
(rule "1mm" (clearance 1000000))
(rule "1.3mm" (clearance 1300000))
(rule "1.5mm" (clearance 1500000))
(rule "1.8mm" (clearance 1800000))
(rule "2.4mm" (clearance 2400000))
(rule "3.2mm" (clearance 3200000))
(rule "5.5mm" (clearance 5500000))

Follow ups

References