How can I allow a smaller clearance value for differential pairs in Altium?

I have finished routing a PCB in Altium (v17) and am resolving design rules violations.

In short, everything checks out except differential pairs that are violating the Electrical > Clearance rule which has a minimum clearance of 0.152mm for all objects. My differential pairs have a minimum clearance of 0.127mm within the same pair.

I created a new Clearance rule named Clearance_Diff which requires the first and second objects to both match a custom query IsDifferentialPair, and specifies a clearance value of 0.127mm. Testing the query correctly selects the number of differential pairs I have on the PCB.

The violation occurs whether the new rule is prioritized above or below the previous clearance rule.

How do I set up design rules such that differential pairs won't violate the general clearance rule?

• Not really a solution, but would a workaround be to disregard the general clearance rule (i.e. set it to some value less than any other rule, where the other rules cover all possibilities) and make one that applies to everything not a differential pair? – Hearth Feb 1 at 19:39
• You could set up a net class and put all your differential nets into it. Or just set your general clearance rule to 0.1 mm --- any reputable PCB manufacturer can achieve good yield with that clearance nowadays. – The Photon Feb 1 at 19:41
• @Hearth I thought of doing something like that but I'm not sure how negation works in Altium queries yet. Maybe I could use a NOT operator with IsDifferentialPair to achieve that - but it feels hacky. – JYelton Feb 1 at 19:41
• @ThePhoton I agree I could just drop the value and be done with it! But I'm trying to better understand Altium's DRC so I can apply it to future problems, too. I do have four Differential Net Classes, but would that be different from simply using IsDifferentialPair in the query? – JYelton Feb 1 at 19:43
• @ThePhoton I just tried your suggestion and it worked. The rule behaves differently if I specify the four classes instead of just using IsDifferentialPair. That seems broken. – JYelton Feb 1 at 19:47

2 Answers

I'd set up a net class and assign all differential pairs to it.

I suspect that what you tried doesn't work because the clearance rule applies to individual copper features, and a single copper feature can't be a differential pair, it can only be part of a differential pair.

• Thanks for the tip, @ThePhoton - I posted an answer with my understanding of it from your nudging me in the right direction. – JYelton Feb 1 at 19:53

There's a difference between using IsDifferentialPair and InDifferentialPairClass('*').

Change the query to use InDifferentialPairClass('*'). (Use the wildcard to select all differential pair classes, or specify individual classes and concatenate with or as necessary).

IsDifferentialPair looks at the entire net as an object, but doesn't examine the track sections for clearance-checking. Since the net as a whole can't conceptually have clearance between itself and itself, using the InDifferentialPairClass convention will select track segments instead and produce the desired result.