Cube-view: increase 45° stub length and component gap for visibility

Stub length increased to 12px (PE/HBM) and 10px (UCIe).
Gap between router and component increased to 30px so both
45° stubs (router end + component end) are clearly visible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 00:38:27 -07:00
parent 5125d92c17
commit 3ea4fa90f8
2 changed files with 62 additions and 61 deletions
+8 -7
View File
@@ -607,21 +607,22 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
# Use left/right offset for multiple blocks on same router
offset_x = (bi - (len(blocks) - 1) / 2) * (blk_w + 4)
gap = 30 # px gap between router and component (room for 2 × 45° stubs)
if kind == "mcpu":
# M_CPU: place above (north of) router
bx = px - blk_w / 2
by = py - r_size - blk_h - 8
by = py - r_size - blk_h - gap
elif kind == "sram":
# SRAM: place below (south of) router
bx = px - blk_w / 2
by = py + r_size + 8
by = py + r_size + gap
else:
# 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)
by = py - r_size - blk_h - gap - bi * (blk_h + 2)
else:
by = py + r_size + 4 + bi * (blk_h + 2)
by = py + r_size + gap + bi * (blk_h + 2)
# Block rect
parts.append(
@@ -638,7 +639,7 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
)
# Connector: router ─45°─ straight ─45°─ component
sc = style["stroke"]
d = 6 # 45° stub length (px)
d = 12 # 45° stub length (px)
if kind == "mcpu":
# Router top → 45° NW stub → vertical → 45° into block bottom
rx2, ry2 = px, py - r_size
@@ -705,7 +706,7 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
tgx, tgy = _pe_hbm_targets[pe_id]
r_edge_y = rpy + r_size if rpy < hbm_y else rpy - r_size
# 45° stub from router → vertical → 45° into HBM port
d = 8 # stub length
d = 12 # stub length
sx = tgx - rpx
sd = d if sx >= 0 else -d
if rpy < hbm_y:
@@ -819,7 +820,7 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
# Connector: router ─45°stub─ straight ─45°stub─ UCIe port
rpx, rpy = mm2px(crx, cry)
d = 6
d = 10
if direction == "N":
rx, ry = rpx, rpy - r_size
tx, ty = lx, cy_box + ch