Custom rules for differential pairs not working as expected

Hi,
I am currently trying to figure out how custom rules really work for differential pairs.
Sadly Kicad does not treat differential pairs as a truly coupled entity that can be dragged and edited as a single unit. I would really like to see that in the future.
Until then I am trying to build a work around bases on custom rules.

My goals:

  • min, opt, max DP Gap within a each differential pair of a netclass
  • a defined clearance between diff pair a other signals
  • different parameters for inner a outer layers
  • having all these parameters checked by the online drc while routing and editing

When I setup a simple netclass with a DP gap everything works as I would expect within the limits of the available parameters.

When I I route new diff pairs they have a gap of 0.35mm and when I drag them afterwards the online DRC highlights error when the gap is violated. Even though the DP gap is smaller than the clearance the online drc does not complain (-> as expected).

Here the output from the status bar when I select one of the routed tracks. Makes all sense to me.

The limitation is, that the same gap is applied to all layers and it only checks for the minimum gap.

So I have set up some rules based on this thread:

[solved] Custom differencing rule not working [DRC]

Blockquote
(rule DIFF-gap-outer
(severity error)
(layer outer)
(constraint diff_pair_gap (min 0.25mm) (opt 0.30mm) (max 0.35mm))
(constraint diff_pair_uncoupled (max 5.0mm))
(condition “A.NetClass == ‘Diff100’”))

This leads to the DP gap be overridden, but breaks the clearance constraint handling. I now get a clearance violation within the diff pair.

Within the following constraints

Blockquote
(rule DIFF-gap-outer
(severity error)
(layer outer)
(constraint diff_pair_gap (min 0.25mm) (opt 0.30mm) (max 0.35mm))
(constraint diff_pair_uncoupled (max 5.0mm))
(condition “AB.isCoupledDiffPair()”) )

I get the same result as without custom constraints (0.35mm DP gap) but the routed track properties are as follows:


When I move the tracks the drc complains when the DP gap is < 0.35mm though. Why is this the case, even if the properties say otherwise?

What works so far to ensure the desired minimum gap during routing and editing is defining multiple constraints:

Blockquote
(rule DIFF-gap-outer
(severity error)
(layer outer)
(constraint diff_pair_gap (min 0.25mm) (opt 0.30mm) (max 0.35mm))
(constraint diff_pair_uncoupled (max 5.0mm))
(condition “A.NetClass == ‘Diff100’”)
)
(rule DIFF-clearance-outer
(severity error)
(layer outer)
(constraint clearance (min 0.25mm))
(condition “AB.isCoupledDiffPair()”)
)

But to my understanding that should not be necessary and the online drc doesn’t throw errors when the maximum gap is violated. The offline drc correctly show those violations.

I am pretty confused because I don’t understand the logic behind that behavior. It seems like a bug to me.

Thanks for the support.

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