Rule editor priority / specificity?

HI. I’ve looked at the custom rule editor. OK Expression functions etc etc
The notes say “Rules should be ordered by specificity. Later rules take precedence over earlier rules;”

  1. PLease explain ‘specificity’ in this context.
  2. order: so the LAST rules are evaluated first ?

example, and it needs to be evaluated in this order where the ‘specificity’ overlaps
take this example for a mix : this is the CLEARANCE rule set for one board I have .

  1. different differential pairs must have track to track clearance of 0.5mm
  2. If in polygon and is a top layer polygon , and has footprint ‘xyz’ OR has footprint(‘avc’ then IF same net, clearance >= 0
  3. If in polygon AND on bottom layer , different nets clearance >= 0.3mm except for vias which is >= 0.25mm
  4. if in polygon and on top layer AND different net, then clerance >= 0.25mm except if SMT pad, clearance> 0.6mm
  5. If in polygon and on MID layer and is ANY differential pair, for different nets only, clearance >= 0.4mm
  6. If in polygon and on MID layer and NET CLASS in MV then for different nets only, clearance to be >=0.5mm
  7. If in polygon AND on MID layer, and has footprint(‘fff’) and if different net, clearance >=0.5mm
  8. If in Polygon and on MID layer , and different nets , clearance >=0.3mm
  9. if NOT in polygon, clearance >- 0.099mm

So, for the example of 5,6,7,8 , clearly 8 is the catch all and needs to be evaaluated if the the match does not occur with 5,6,7.

and the last rule (9) is the catch all- if none of the rules match, the the clearance > 0.099mm .

(what 0.099 ? because altium has precision issues- I think internally it is all 64 bit integer tenth mil)

I do not use rules (netclass rules) ** much but to me the idea of the last being most specific makes sense.

My take is that this one is the most broad, least specific, and belongs first.

So if you assign a broad rule such as a speed limit on a motorway being 120 KPH. That would be first.

But you have a narrower exception for vehicles exceeding 5 tons. Those are limited to 100 KPH. That instruction belongs last.

I can imagine the software following the instructions and setting switches accordingly. The last instruction read puts the switches into the positions that will “stick.” Does that help?

**https://www.youtube.com/watch?v=w9KBOhPXhds

2 Likes

Bob is correct.

But another way to say it is “last rule which matches wins”.

I assume you’ve found the Inspect > Clearance Resolution dialog?

I have, thanks. have not yet found how to do a rule for connection to zones based on designators or footprint names etc

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.