Violations in a large design belong to blocks, and blocks have owners. Automatic assignment by hierarchy prefix saves time and shows who carries the load. Endpoints that match no rule are orphans; they are the ones nobody will look at unless the process makes them visible.
rules = {"core/alu": "alu owner", "core": "core owner", "mem": "memory owner", "io": "io owner"}
default = "integration owner"
endpoints = ["core/alu/r1", "core/lsu/r7", "mem/ctrl/q3", "io/pad/d2", "top/glue/x1", "core/alu/r9", "mem/ctrl/q8", "top/misc/m4"]
def owner(path):
best = None
for prefix in rules:
if path == prefix or path.startswith(prefix + "/"):
if best is None or len(prefix) > len(best):
best = prefix
return (rules[best], False) if best else (default, True)
assigned = {e: owner(e) for e in endpoints}
load = {}
for e, (o, orphan) in assigned.items():
load[o] = load.get(o, 0) + 1
orphans = sorted(e for e, (o, orphan) in assigned.items() if orphan)
assert load == {"alu owner": 2, "core owner": 1, "memory owner": 2, "io owner": 1, "integration owner": 2}
assert orphans == ["top/glue/x1", "top/misc/m4"]
print("PASS: load by owner", load, "; orphans (no matching rule)", orphans)Owner | Endpoints |
|---|---|
ALU owner | 2 |
Core owner | 1 |
Memory owner | 2 |
IO owner | 1 |
Integration owner (default) | 2 (both orphans) |
Two endpoints go to the alu owner, one to the core owner, two to memory, one to IO. Two endpoints under top/ match no rule and fall to the integration owner as orphans. The longest-prefix rule lets the specific rule (core/alu) override the general one (core): core/alu/r1 and core/alu/r9 go to the alu owner while core/lsu/r7 stays with the core owner. The orphan list is short and visible: either a rule is missing, or the endpoint genuinely belongs to integration; both outcomes are decisions, not accidents.
Rules are reviewed when the hierarchy changes; stale prefixes silently send endpoints to the wrong owner.
The load per owner is shown daily, so one person is not buried while another is idle.
Orphans are reviewed first: each gets a rule or an explicit owner.
It goes to the alu owner under 'core/alu', the longest matching prefix, not the core owner.