Custom Rule on NetClass and Filled Zone

I’m looking for a way to create a custom rule that defines the clearance between a specific NetClass and filled zones. For example, I’m working on an RMII layout connecting a PHY to an MCU. I need the GND filled zone to be retracted from the RMII signals, but there are pins and vias close to these signals, which could cause DRC errors. I want this retraction to apply only to the RMII signals and not to any other signals, so I prefer not to use a default clearance.

I considered using a custom rule, but it ends up affecting other zones as well. I understand why this happens, but I’m unsure how to resolve it. Additionally, I would like the rule to apply based on the NetClass of the filled zone, rather than specifying its name.

In the example below, I want the GND fill to retract from the RMII signals. However, the power filled zone is also being retracted. I could address this by routing it differently, but I’d prefer a cleaner solution.

Rule:

(rule "RMII to Filled Zones clearance"
   # Define a wider clearance to Filled Zones
	(constraint clearance (min 0.8mm))
	(condition " A.NetClass == 'RMII' && A.intersectsArea('GND_FILL') "))

PS: I found an example which uses “opt” and “max” for clearance, however I found only “min” as a valid option in the manual.

Thanks for your Help.

I am not very profficient concerning custom rules, but you can give a zone a name, and very likely you can use the name of a zone in a custom rule.

Paul gives one approach. If you instead want to increase clearance between RMII and all GND zones rather than just one, you can do something like:

(rule "RMII to Filled Zones clearance"
   # Define a wider clearance to Filled Zones on the GND net
	(constraint clearance (min 0.8mm))
	(condition " A.NetClass == 'RMII' && B.Type == 'Zone' && B.Net == 'GND' "))

I have already done this and named the zone

GND_FILL

I should have pointed this out.

This is exactly what I wanted. Thanks a lot!

Now the small power plane is filled.