2020-10-06 18:09:24 +00:00
|
|
|
### Top-level Clauses
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
(version <number>)
|
|
|
|
|
|
|
|
(rule <rule_name> <rule_clause> ...)
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
### Rule Clauses
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
(constraint <constraint_type> ...)
|
|
|
|
|
|
|
|
(condition "<expression>")
|
|
|
|
|
|
|
|
(layer "<layer_name>")
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
### Constraint Types
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
* annular_width
|
|
|
|
* clearance
|
2020-10-11 10:51:23 +00:00
|
|
|
* courtyard_clearance
|
|
|
|
* diff_pair_gap
|
|
|
|
* diff_pair_uncoupled
|
2020-10-04 11:25:59 +00:00
|
|
|
* disallow
|
2020-10-11 10:51:23 +00:00
|
|
|
* edge_clearance
|
|
|
|
* length
|
2020-10-04 11:25:59 +00:00
|
|
|
* hole
|
2020-10-11 10:51:23 +00:00
|
|
|
* hole_clearance
|
|
|
|
* silk_clearance
|
|
|
|
* skew
|
2020-10-04 11:25:59 +00:00
|
|
|
* track_width
|
2020-10-11 10:51:23 +00:00
|
|
|
* via_count
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
### Item Types
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
* buried_via
|
|
|
|
* graphic
|
|
|
|
* hole
|
|
|
|
* micro_via
|
|
|
|
* pad
|
|
|
|
* text
|
|
|
|
* track
|
|
|
|
* via
|
|
|
|
* zone
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
### Examples
|
2020-10-04 11:25:59 +00:00
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
# Comment
|
|
|
|
|
2020-10-04 11:25:59 +00:00
|
|
|
(rule "copper keepout"
|
|
|
|
(constraint disallow track via zone)
|
|
|
|
(condition "A.insideArea('zone3')"))
|
|
|
|
|
|
|
|
|
|
|
|
(rule "BGA neckdown"
|
|
|
|
(constraint track_width (min 0.2mm) (opt 0.25mm))
|
|
|
|
(constraint clearance (min 0.05) (opt 0.08mm))
|
|
|
|
(condition "A.insideCourtyard('U3')"))
|
|
|
|
|
|
|
|
|
|
|
|
(rule HV
|
|
|
|
(constraint clearance (min 1.5mm))
|
|
|
|
(condition "A.NetClass == 'HV'"))
|
|
|
|
|
|
|
|
|
|
|
|
(rule HV
|
|
|
|
(layer outer)
|
|
|
|
(constraint clearance (min 1.5mm))
|
|
|
|
(condition "A.NetClass == 'HV'"))
|
|
|
|
|
|
|
|
|
|
|
|
(rule HV_HV
|
|
|
|
# wider clearance between HV tracks
|
|
|
|
(constraint clearance (min "1.5mm + 2.0mm"))
|
|
|
|
(condition "A.NetClass == 'HV' && B.NetClass == 'HV'"))
|
|
|
|
|
|
|
|
|
|
|
|
(rule HV_unshielded
|
|
|
|
(constraint clearance (min 2mm))
|
|
|
|
(condition "A.NetClass == 'HV' && !A.insideArea('Shield*')))
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
### Notes
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
Version clause must be the first clause.
|
|
|
|
|
|
|
|
Rules should be ordered by specificity. Later rules take
|
|
|
|
precedence over earlier rules; once a matching rule is found
|
|
|
|
no further rules will be checked.
|
|
|
|
|
|
|
|
Use Ctrl+/ to comment or uncomment line(s).
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
### Expression functions
|
2020-10-04 11:25:59 +00:00
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
All function parameters support simple wildcards (`*` and `?`).
|
2020-10-04 11:25:59 +00:00
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
True if any part of `A` lies within the given footprint's courtyard.
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
A.insideCourtyard('<footprint_refdes>')
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
True if any part of `A` lies within the given zone's outline.
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
A.insideArea('<zone_name>')
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
True if `A` has a hole which is plated.
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
A.isPlated()
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
True if `A` is a member of the given group. Includes nested membership.
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
A.memberOf('<group_name>')
|
|
|
|
|
|
|
|
|
2020-10-06 18:09:24 +00:00
|
|
|
True if `A` exists on the given layer. The layer name can be
|
2020-10-04 11:25:59 +00:00
|
|
|
either the name assigned in Board Setup > Board Editor Layers or
|
2020-10-06 18:09:24 +00:00
|
|
|
the canonical name (ie: `F.Cu`).
|
2020-10-04 11:25:59 +00:00
|
|
|
|
2020-10-09 10:31:00 +00:00
|
|
|
A.existsOnLayer('<layer_name>')
|
2020-10-04 11:25:59 +00:00
|
|
|
|
|
|
|
NB: this returns true if `A` is on the given layer, independently
|
|
|
|
of whether or not the rule is being evaluated for that layer.
|
|
|
|
For the latter use a `(layer "layer_name")` clause in the rule.
|