Offset PE nodes in cube_view to avoid overlapping routers
PE nodes are shifted 1.2mm above (top half) or below (bottom half) their assigned router position. PE size reduced to 1.4x0.7mm. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+32
-32
@@ -109,8 +109,8 @@
|
||||
<text x="362.0" y="386.0" text-anchor="middle" font-family="monospace" font-size="7" fill="#64748b">2.0mm</text>
|
||||
<line x1="390.0" y1="390.0" x2="474.0" y2="390.0" stroke="#a78bfa" stroke-width="1" opacity="0.8"/>
|
||||
<text x="432.0" y="386.0" text-anchor="middle" font-family="monospace" font-size="7" fill="#64748b">3.0mm</text>
|
||||
<polyline points="82.0,82.0 82.0,67.0 82.0,67.0 82.0,82.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="82.0,82.0 82.0,67.0 82.0,67.0 82.0,82.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="82.0,48.4 82.0,50.2 82.0,50.2 82.0,82.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="82.0,82.0 82.0,50.2 82.0,50.2 82.0,48.4" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="82.0,82.0 222.0,82.0 222.0,236.0" fill="none" stroke="#10b981" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="82.0,82.0 82.0,144.0 68.0,144.0 68.0,236.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="68.0,236.0 68.0,144.0 82.0,144.0 82.0,82.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
@@ -120,8 +120,8 @@
|
||||
<polyline points="278.0,56.8 278.0,64.4 82.0,64.4 82.0,82.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="278.0" y1="56.8" x2="278.0" y2="56.8" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="278.0" y1="56.8" x2="278.0" y2="56.8" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="166.0,82.0 166.0,67.0 166.0,67.0 166.0,82.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="166.0,82.0 166.0,67.0 166.0,67.0 166.0,82.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="166.0,48.4 166.0,50.2 166.0,50.2 166.0,82.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="166.0,82.0 166.0,50.2 166.0,50.2 166.0,48.4" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="166.0,82.0 222.0,82.0 222.0,236.0" fill="none" stroke="#10b981" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="166.0,82.0 166.0,54.4 278.0,54.4 278.0,56.8" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="278.0,56.8 278.0,54.4 166.0,54.4 166.0,82.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
@@ -143,11 +143,11 @@
|
||||
<polyline points="68.0,236.0 68.0,179.0 82.0,179.0 82.0,152.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="68.0" y1="236.0" x2="68.0" y2="236.0" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="68.0" y1="236.0" x2="68.0" y2="236.0" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="390.0,82.0 390.0,102.0 390.0,102.0 390.0,152.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="390.0,152.0 390.0,102.0 390.0,102.0 390.0,82.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="390.0,48.4 390.0,85.2 390.0,85.2 390.0,152.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="390.0,152.0 390.0,85.2 390.0,85.2 390.0,48.4" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="390.0,152.0 222.0,152.0 222.0,236.0" fill="none" stroke="#10b981" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,82.0 474.0,102.0 474.0,102.0 474.0,152.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,152.0 474.0,102.0 474.0,102.0 474.0,82.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="474.0,48.4 474.0,85.2 474.0,85.2 474.0,152.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,152.0 474.0,85.2 474.0,85.2 474.0,48.4" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="474.0,152.0 222.0,152.0 222.0,236.0" fill="none" stroke="#10b981" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,152.0 474.0,179.0 488.0,179.0 488.0,236.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="488.0,236.0 488.0,179.0 474.0,179.0 474.0,152.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
@@ -156,15 +156,15 @@
|
||||
<polyline points="446.0,194.0 446.0,179.0 82.0,179.0 82.0,194.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="82.0,194.0 82.0,179.0 446.0,179.0 446.0,194.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="110.0,194.0 82.0,194.0 82.0,278.0" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="82.0,390.0 82.0,340.0 82.0,340.0 82.0,320.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="82.0,320.0 82.0,340.0 82.0,340.0 82.0,390.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="82.0,423.6 82.0,356.8 82.0,356.8 82.0,320.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="82.0,320.0 82.0,356.8 82.0,356.8 82.0,423.6" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="82.0,320.0 222.0,320.0 222.0,236.0" fill="none" stroke="#10b981" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="82.0,320.0 82.0,263.0 68.0,263.0 68.0,236.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="68.0,236.0 68.0,263.0 82.0,263.0 82.0,320.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="68.0" y1="236.0" x2="68.0" y2="236.0" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="68.0" y1="236.0" x2="68.0" y2="236.0" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="166.0,390.0 166.0,340.0 166.0,340.0 166.0,320.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="166.0,320.0 166.0,340.0 166.0,340.0 166.0,390.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="166.0,423.6 166.0,356.8 166.0,356.8 166.0,320.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="166.0,320.0 166.0,356.8 166.0,356.8 166.0,423.6" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="166.0,320.0 222.0,320.0 222.0,236.0" fill="none" stroke="#10b981" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,320.0 474.0,263.0 488.0,263.0 488.0,236.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="488.0,236.0 488.0,263.0 474.0,263.0 474.0,320.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
@@ -182,15 +182,15 @@
|
||||
<polyline points="278.0,415.2 278.0,387.6 166.0,387.6 166.0,390.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="278.0" y1="415.2" x2="278.0" y2="415.2" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="278.0" y1="415.2" x2="278.0" y2="415.2" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="390.0,390.0 390.0,375.0 390.0,375.0 390.0,390.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="390.0,390.0 390.0,375.0 390.0,375.0 390.0,390.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="390.0,423.6 390.0,391.8 390.0,391.8 390.0,390.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="390.0,390.0 390.0,391.8 390.0,391.8 390.0,423.6" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="390.0,390.0 222.0,390.0 222.0,236.0" fill="none" stroke="#10b981" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="390.0,390.0 390.0,387.6 278.0,387.6 278.0,415.2" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="278.0,415.2 278.0,387.6 390.0,387.6 390.0,390.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="278.0" y1="415.2" x2="278.0" y2="415.2" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<line x1="278.0" y1="415.2" x2="278.0" y2="415.2" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,390.0 474.0,375.0 474.0,375.0 474.0,390.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,390.0 474.0,375.0 474.0,375.0 474.0,390.0" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="474.0,423.6 474.0,391.8 474.0,391.8 474.0,390.0" fill="none" stroke="#f97316" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,390.0 474.0,391.8 474.0,391.8 474.0,423.6" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="474.0,390.0 222.0,390.0 222.0,236.0" fill="none" stroke="#10b981" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="474.0,390.0 474.0,298.0 488.0,298.0 488.0,236.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
<polyline points="488.0,236.0 488.0,298.0 474.0,298.0 474.0,390.0" fill="none" stroke="#94a3b8" stroke-width="1" opacity="0.8"/>
|
||||
@@ -310,20 +310,20 @@
|
||||
<text x="390.0" y="394.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">R5C4</text>
|
||||
<rect x="457.2" y="378.8" width="33.6" height="22.4" rx="4" fill="#f97316" stroke="#475569" stroke-width="1"/>
|
||||
<text x="474.0" y="394.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">R5C5</text>
|
||||
<rect x="56.8" y="68.0" width="50.4" height="28.0" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="82.0" y="86.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE0</text>
|
||||
<rect x="140.8" y="68.0" width="50.4" height="28.0" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="166.0" y="86.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE1</text>
|
||||
<rect x="364.8" y="68.0" width="50.4" height="28.0" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="390.0" y="86.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE2</text>
|
||||
<rect x="448.8" y="68.0" width="50.4" height="28.0" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="474.0" y="86.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE3</text>
|
||||
<rect x="56.8" y="376.0" width="50.4" height="28.0" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="82.0" y="394.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE4</text>
|
||||
<rect x="140.8" y="376.0" width="50.4" height="28.0" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="166.0" y="394.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE5</text>
|
||||
<rect x="364.8" y="376.0" width="50.4" height="28.0" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="390.0" y="394.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE6</text>
|
||||
<rect x="448.8" y="376.0" width="50.4" height="28.0" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="474.0" y="394.0" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE7</text>
|
||||
<rect x="62.4" y="38.6" width="39.2" height="19.6" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="82.0" y="52.4" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE0</text>
|
||||
<rect x="146.4" y="38.6" width="39.2" height="19.6" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="166.0" y="52.4" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE1</text>
|
||||
<rect x="370.4" y="38.6" width="39.2" height="19.6" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="390.0" y="52.4" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE2</text>
|
||||
<rect x="454.4" y="38.6" width="39.2" height="19.6" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="474.0" y="52.4" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE3</text>
|
||||
<rect x="62.4" y="413.8" width="39.2" height="19.6" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="82.0" y="427.6" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE4</text>
|
||||
<rect x="146.4" y="413.8" width="39.2" height="19.6" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="166.0" y="427.6" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE5</text>
|
||||
<rect x="370.4" y="413.8" width="39.2" height="19.6" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="390.0" y="427.6" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE6</text>
|
||||
<rect x="454.4" y="413.8" width="39.2" height="19.6" rx="4" fill="#94a3b8" stroke="#475569" stroke-width="1"/>
|
||||
<text x="474.0" y="427.6" text-anchor="middle" font-family="monospace" font-size="10" fill="#1e293b">PE7</text>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
@@ -946,13 +946,17 @@ def _build_cube_view(spec: dict) -> ViewGraph:
|
||||
) if mesh_data else {}
|
||||
|
||||
pe_idx = 0
|
||||
pe_offset_y = 1.2 # mm offset to avoid overlapping router node
|
||||
for corner in corners:
|
||||
is_top = corner in ("NW", "NE")
|
||||
for ci in range(pe_per_corner):
|
||||
pid = f"pe{pe_idx}"
|
||||
px, py = corner_pos[corner][ci]
|
||||
# Offset PE above (top) or below (bottom) its router
|
||||
py_view = py - pe_offset_y if is_top else py + pe_offset_y
|
||||
nodes[pid] = Node(
|
||||
id=pid, kind="pe", impl="",
|
||||
attrs={"corner": corner}, pos_mm=(px, py),
|
||||
attrs={"corner": corner}, pos_mm=(px, py_view),
|
||||
label=f"PE{pe_idx}",
|
||||
)
|
||||
pe_idx += 1
|
||||
|
||||
@@ -157,7 +157,7 @@ def _compute_node_sizes(
|
||||
w_mm, h_mm = _KIND_SIZE.get(node.kind, (_DEFAULT_NODE_W, _DEFAULT_NODE_H))
|
||||
# For cube view, use smaller PE nodes
|
||||
if view.name == "cube" and node.kind == "pe":
|
||||
w_mm, h_mm = 1.8, 1.0
|
||||
w_mm, h_mm = 1.4, 0.7
|
||||
if view.name == "pe":
|
||||
w_mm, h_mm = 2.5, 1.4
|
||||
sizes[nid] = (w_mm * scale, h_mm * scale)
|
||||
|
||||
Reference in New Issue
Block a user