Cube-view: angle HBM lines, offset M_CPU/SRAM blocks

- HBM connection lines angled 30% toward HBM center (not vertical)
  to distinguish from mesh links
- M_CPU/SRAM blocks placed to the left of their router
  with horizontal connector lines (avoid mesh overlap)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 22:30:56 -07:00
parent 7cd30e106e
commit 24faf2e1d4
2 changed files with 57 additions and 43 deletions
+38 -38
View File
@@ -190,9 +190,9 @@
<text x="849" y="276" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
<circle cx="135" cy="335" r="8" fill="#475569" stroke="#64748b" stroke-width="1"/>
<text x="135" y="338" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r2c0</text>
<rect x="119" y="307" width="32" height="16" rx="3" fill="#451a03" stroke="#f59e0b" stroke-width="1"/>
<text x="135" y="318" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#f59e0b">M_CPU</text>
<line x1="135" y1="323" x2="135" y2="327" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
<rect x="89" y="327" width="32" height="16" rx="3" fill="#451a03" stroke="#f59e0b" stroke-width="1"/>
<text x="105" y="338" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#f59e0b">M_CPU</text>
<line x1="121" y1="335" x2="127" y2="335" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
<circle cx="285" cy="335" r="8" fill="#334155" stroke="#475569" stroke-width="1"/>
<text x="285" y="338" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r2c1</text>
<circle cx="685" cy="335" r="8" fill="#334155" stroke="#475569" stroke-width="1"/>
@@ -201,9 +201,9 @@
<text x="835" y="338" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r2c5</text>
<circle cx="135" cy="485" r="8" fill="#475569" stroke="#64748b" stroke-width="1"/>
<text x="135" y="488" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r3c0</text>
<rect x="119" y="497" width="32" height="16" rx="3" fill="#1c1917" stroke="#d97706" stroke-width="1"/>
<text x="135" y="508" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#d97706">SRAM</text>
<line x1="135" y1="497" x2="135" y2="493" stroke="#d97706" stroke-width="1" opacity="0.6"/>
<rect x="89" y="477" width="32" height="16" rx="3" fill="#1c1917" stroke="#d97706" stroke-width="1"/>
<text x="105" y="488" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#d97706">SRAM</text>
<line x1="121" y1="485" x2="127" y2="485" stroke="#d97706" stroke-width="1" opacity="0.6"/>
<circle cx="285" cy="485" r="8" fill="#334155" stroke="#475569" stroke-width="1"/>
<text x="285" y="488" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r3c1</text>
<circle cx="685" cy="485" r="8" fill="#334155" stroke="#475569" stroke-width="1"/>
@@ -274,38 +274,38 @@
<text x="871" y="775" text-anchor="middle" font-family="monospace" font-size="6" font-weight="bold" fill="#8b5cf6">UCIe-S.c3</text>
<line x1="871" y1="764" x2="835" y2="693" stroke="#8b5cf6" stroke-width="1" opacity="0.6"/>
<text x="849" y="606" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
<line x1="135" y1="143" x2="135" y2="285" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="285" y1="143" x2="285" y2="285" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="435" y1="143" x2="435" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="585" y1="143" x2="585" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="685" y1="143" x2="685" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="835" y1="143" x2="835" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="135" y1="268" x2="135" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="285" y1="268" x2="285" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="435" y1="268" x2="435" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="585" y1="268" x2="585" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="685" y1="268" x2="685" y2="285" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="835" y1="268" x2="835" y2="285" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="135" y1="327" x2="135" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="285" y1="327" x2="285" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="685" y1="327" x2="685" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="835" y1="327" x2="835" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="135" y1="477" x2="135" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="285" y1="477" x2="285" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="685" y1="477" x2="685" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="835" y1="477" x2="835" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="135" y1="552" x2="135" y2="535" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="285" y1="552" x2="285" y2="535" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="435" y1="552" x2="435" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="585" y1="552" x2="585" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="685" y1="552" x2="685" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="835" y1="552" x2="835" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="135" y1="677" x2="135" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="285" y1="677" x2="285" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="435" y1="677" x2="435" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="585" y1="677" x2="585" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.2" stroke-dasharray="4,3"/>
<line x1="685" y1="677" x2="685" y2="535" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="835" y1="677" x2="835" y2="535" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="135" y1="143" x2="240" y2="285" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="285" y1="143" x2="345" y2="285" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="435" y1="143" x2="450" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="585" y1="143" x2="555" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="685" y1="143" x2="625" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="835" y1="143" x2="730" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="135" y1="268" x2="240" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="285" y1="268" x2="345" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="435" y1="268" x2="450" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="585" y1="268" x2="555" y2="285" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="685" y1="268" x2="625" y2="285" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="835" y1="268" x2="730" y2="285" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="135" y1="327" x2="240" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="285" y1="327" x2="345" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="685" y1="327" x2="625" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="835" y1="327" x2="730" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="135" y1="477" x2="240" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="285" y1="477" x2="345" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="685" y1="477" x2="625" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="835" y1="477" x2="730" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="135" y1="552" x2="240" y2="535" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="285" y1="552" x2="345" y2="535" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="435" y1="552" x2="450" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="585" y1="552" x2="555" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="685" y1="552" x2="625" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="835" y1="552" x2="730" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="135" y1="677" x2="240" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="285" y1="677" x2="345" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="435" y1="677" x2="450" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="585" y1="677" x2="555" y2="535" stroke="#10b981" stroke-width="0.7" opacity="0.15" stroke-dasharray="4,3"/>
<line x1="685" y1="677" x2="625" y2="535" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<line x1="835" y1="677" x2="730" y2="535" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
<rect x="60" y="865" width="10" height="10" rx="2" fill="#3b82f6" stroke="#475569" stroke-width="0.5"/>
<text x="74" y="874" font-family="monospace" font-size="8" fill="#94a3b8">PE Router</text>
<rect x="147" y="865" width="10" height="10" rx="2" fill="#f59e0b" stroke="#475569" stroke-width="0.5"/>

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

+19 -5
View File
@@ -603,8 +603,12 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
bx, by = bx_base + 4, py + offset_x - blk_h / 2
else:
bx, by = px + offset_x - blk_w / 2, py - r_size - blk_h - 4
elif kind in ("mcpu", "sram"):
# M_CPU/SRAM: place to the left of router (avoid mesh overlap)
bx = px - r_size - blk_w - 6
by = py - blk_h / 2 + bi * (blk_h + 2)
else:
# PE/M_CPU/SRAM: place above (top half) or below (bottom half)
# PE: place above (top half) or below (bottom half)
bx = px + offset_x - blk_w / 2
if is_top:
by = py - r_size - blk_h - 4 - bi * (blk_h + 2)
@@ -651,8 +655,15 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
f'x2="{px + r_size:.0f}" y2="{py:.0f}" '
f'stroke="{style["stroke"]}" stroke-width="1" opacity="0.6"/>'
)
elif kind in ("mcpu", "sram"):
# Horizontal connector (block right edge → router left edge)
parts.append(
f' <line x1="{bx + blk_w:.0f}" y1="{by + blk_h / 2:.0f}" '
f'x2="{px - r_size:.0f}" y2="{py:.0f}" '
f'stroke="{style["stroke"]}" stroke-width="1" opacity="0.6"/>'
)
else:
# Vertical connector
# Vertical connector (PE above/below router)
ly1 = by + blk_h if is_top else by
ly2 = py - r_size if is_top else py + r_size
parts.append(
@@ -674,6 +685,8 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
)
# ── Router → HBM_CTRL lines (drawn last, on top of everything) ──
# Lines go from router to the HBM zone edge, angled toward HBM center
# to visually distinguish from vertical mesh links
for rkey, rval in routers.items():
if rval is None:
continue
@@ -683,12 +696,13 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
r_edge_y = py + r_size if py < hbm_y else py - r_size
if abs(r_edge_y - hbm_edge_y) > 10:
has_pe = any(a.endswith(".dma") for a in rval.get("attach", []))
# PE routers: thicker, more visible
sw = "1.5" if has_pe else "0.7"
op = "0.6" if has_pe else "0.2"
op = "0.6" if has_pe else "0.15"
# Angle toward HBM center x (hcx) — slight offset, not fully straight
dx = (hcx - px) * 0.3 # 30% pull toward center
parts.append(
f' <line x1="{px:.0f}" y1="{r_edge_y:.0f}" '
f'x2="{px:.0f}" y2="{hbm_edge_y:.0f}" '
f'x2="{px + dx:.0f}" y2="{hbm_edge_y:.0f}" '
f'stroke="#10b981" stroke-width="{sw}" opacity="{op}" '
f'stroke-dasharray="4,3"/>'
)