I am using kicad version 6.0.4. I am designing 4 layer PCB which contains differential pairs of 100 ohm & 90 ohm impedance in two different layers. I want to create two netclasses, one for 100 ohm & another for 90 ohm impedance.
I want to create these two netclasses with custom rules in different layers and assign them to their respective Nets. I have tried some of the custom rules which i am atteching below but i am not getting the result from any of them instead i am getting the results of default netclass that i have set for the other nets other than the differential nets.
(Here i have not considered the actual trace width, clearance & diff pair gap for 100 and 90 ohm impedance for testing purpose)
-
Here i have used USB_P & USB_N with 100 ohm differential impedance.
(version 1)
(rule “diffpair”
(layer F.Cu)
(condition “A.NetName == ‘/USB’”)
(condition “A.inDiffPair(’’) && AB.isCoupledDiffPair()")
(constraint diff_pair_gap (min 0.25mm))
(constraint track_width (min 0.1mm))
(constraint clearance (min “0.05mm”))
)
(rule “diffpair”
(layer B.Cu)
(condition “A.NetName == ‘/USB’”)
(condition "A.inDiffPair(’’) && AB.isCoupledDiffPair()”)
(constraint diff_pair_gap (min 0.2mm))
(constraint track_width (min 0.1mm))
(constraint clearance (min “0.05mm”))
) -
Here i have used USB_P & USB_N with 100 ohm differential impedance.
(version 1)
(rule “diffpair”
(layer B.Cu)
(constraint diff_pair_gap (min 0.3mm))
(constraint track_width (min 0.3mm))
(constraint clearance (min “0.1mm”))
(condition “A.inDiffPair(‘USB_P’) && B.inDiffPair(‘USB_N’) && AB.isCoupledDiffPair()”)
)
(rule “diffpair”
(layer F.Cu)
(constraint diff_pair_gap (min 0.2mm))
(constraint track_width (min 0.25mm))
(constraint clearance (min “0.1mm”))
(condition “A.inDiffPair(‘USB_P’) && B.inDiffPair(‘USB_N’) && AB.isCoupledDiffPair()”)
) -
Here i have used USB_P & USB_N with 100 ohm differential impedance.
(version 1)
(rule “diffpair”
(layer F.Cu)
(condition “A.inDiffPair(‘USB’)”)
(constraint diff_pair_gap (min 0.4mm))
(constraint track_width (min 0.1mm))
(constraint clearance (min “0.05mm”))
) -
Here i have created Netclass for 100 ohm & 90 ohm differential pair.
(version 1)
(rule DIFFERENTIAL90
(constraint track_width (min 0.5mm))
(condition “A.NetClass == ''DIFFERENTIAL90”))
(rule DIFFERENTIAL100
(constraint track_width (min 0.15mm))
(condition “A.NetClass == ‘DIFFERENTIAL100’”)
)