Cube-view: M_CPU north, 45° stub-straight-stub connector pattern
- M_CPU placed north (above) its router - All connectors: 45° stub from router → straight → 45° stub to component - Consistent 4-point polyline pattern for PE, M_CPU, SRAM, HBM, UCIe Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+38
-38
@@ -135,12 +135,12 @@
|
||||
<text x="135" y="138" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r0c0</text>
|
||||
<rect x="119" y="107" width="32" height="16" rx="3" fill="#2d1f3d" stroke="#a855f7" stroke-width="1"/>
|
||||
<text x="135" y="118" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#a855f7">PE0</text>
|
||||
<polyline points="135,127 135,127 135,123" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="135,127 141,121 141,129 135,123" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<circle cx="285" cy="135" r="8" fill="#475569" stroke="#64748b" stroke-width="1"/>
|
||||
<text x="285" y="138" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r0c1</text>
|
||||
<rect x="269" y="107" width="32" height="16" rx="3" fill="#2d1f3d" stroke="#a855f7" stroke-width="1"/>
|
||||
<text x="285" y="118" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#a855f7">PE1</text>
|
||||
<polyline points="285,127 285,127 285,123" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="285,127 291,121 291,129 285,123" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<circle cx="435" cy="135" r="8" fill="#334155" stroke="#475569" stroke-width="1"/>
|
||||
<text x="435" y="138" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r0c2</text>
|
||||
<circle cx="585" cy="135" r="8" fill="#334155" stroke="#475569" stroke-width="1"/>
|
||||
@@ -161,17 +161,17 @@
|
||||
<text x="685" y="263" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r1c4</text>
|
||||
<rect x="669" y="232" width="32" height="16" rx="3" fill="#2d1f3d" stroke="#a855f7" stroke-width="1"/>
|
||||
<text x="685" y="243" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#a855f7">PE2</text>
|
||||
<polyline points="685,252 685,252 685,248" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="685,252 691,246 691,254 685,248" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<circle cx="835" cy="260" r="8" fill="#475569" stroke="#64748b" stroke-width="1"/>
|
||||
<text x="835" y="263" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r1c5</text>
|
||||
<rect x="819" y="232" width="32" height="16" rx="3" fill="#2d1f3d" stroke="#a855f7" stroke-width="1"/>
|
||||
<text x="835" y="243" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#a855f7">PE3</text>
|
||||
<polyline points="835,252 835,252 835,248" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="835,252 841,246 841,254 835,248" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<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="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>
|
||||
<polyline points="127,335 127,335 121,335" fill="none" stroke="#f59e0b" stroke-width="1" opacity="0.6"/>
|
||||
<rect x="119" y="303" width="32" height="16" rx="3" fill="#451a03" stroke="#f59e0b" stroke-width="1"/>
|
||||
<text x="135" y="314" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#f59e0b">M_CPU</text>
|
||||
<polyline points="135,327 129,321 129,325 135,319" fill="none" 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"/>
|
||||
@@ -180,9 +180,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="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>
|
||||
<polyline points="127,485 127,485 121,485" fill="none" stroke="#d97706" stroke-width="1" opacity="0.6"/>
|
||||
<rect x="119" y="501" width="32" height="16" rx="3" fill="#1c1917" stroke="#d97706" stroke-width="1"/>
|
||||
<text x="135" y="512" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#d97706">SRAM</text>
|
||||
<polyline points="135,493 129,499 129,495 135,501" fill="none" 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"/>
|
||||
@@ -193,12 +193,12 @@
|
||||
<text x="135" y="563" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r4c0</text>
|
||||
<rect x="119" y="572" width="32" height="16" rx="3" fill="#2d1f3d" stroke="#a855f7" stroke-width="1"/>
|
||||
<text x="135" y="583" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#a855f7">PE4</text>
|
||||
<polyline points="135,568 135,568 135,572" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="135,568 141,574 141,566 135,572" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<circle cx="285" cy="560" r="8" fill="#475569" stroke="#64748b" stroke-width="1"/>
|
||||
<text x="285" y="563" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r4c1</text>
|
||||
<rect x="269" y="572" width="32" height="16" rx="3" fill="#2d1f3d" stroke="#a855f7" stroke-width="1"/>
|
||||
<text x="285" y="583" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#a855f7">PE5</text>
|
||||
<polyline points="285,568 285,568 285,572" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="285,568 291,574 291,566 285,572" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<circle cx="435" cy="560" r="8" fill="#334155" stroke="#475569" stroke-width="1"/>
|
||||
<text x="435" y="563" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r4c2</text>
|
||||
<circle cx="585" cy="560" r="8" fill="#334155" stroke="#475569" stroke-width="1"/>
|
||||
@@ -219,84 +219,84 @@
|
||||
<text x="685" y="688" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r5c4</text>
|
||||
<rect x="669" y="697" width="32" height="16" rx="3" fill="#2d1f3d" stroke="#a855f7" stroke-width="1"/>
|
||||
<text x="685" y="708" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#a855f7">PE6</text>
|
||||
<polyline points="685,693 685,693 685,697" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="685,693 691,699 691,691 685,697" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<circle cx="835" cy="685" r="8" fill="#475569" stroke="#64748b" stroke-width="1"/>
|
||||
<text x="835" y="688" text-anchor="middle" font-family="monospace" font-size="6" fill="white">r5c5</text>
|
||||
<rect x="819" y="697" width="32" height="16" rx="3" fill="#2d1f3d" stroke="#a855f7" stroke-width="1"/>
|
||||
<text x="835" y="708" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#a855f7">PE7</text>
|
||||
<polyline points="835,693 835,693 835,697" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="135,143 324,289 324,289" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<polyline points="835,693 841,699 841,691 835,697" fill="none" stroke="#a855f7" stroke-width="1" opacity="0.6"/>
|
||||
<polyline points="135,143 143,151 143,281 324,289" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<text x="239" y="216" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
|
||||
<polyline points="285,143 431,289 431,289" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<polyline points="285,143 293,151 293,281 431,289" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<text x="368" y="216" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
|
||||
<polyline points="685,268 539,289 539,289" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<polyline points="685,268 677,276 677,281 539,289" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<text x="622" y="278" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
|
||||
<polyline points="835,268 646,289 646,289" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<polyline points="835,268 827,276 827,281 646,289" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<text x="751" y="278" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
|
||||
<polyline points="135,552 324,531 324,531" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<polyline points="135,552 143,544 143,539 324,531" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<text x="239" y="542" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
|
||||
<polyline points="285,552 431,531 431,531" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<polyline points="285,552 293,544 293,539 431,531" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<text x="368" y="542" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
|
||||
<polyline points="685,677 539,531 539,531" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<polyline points="685,677 677,669 677,539 539,531" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<text x="622" y="604" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
|
||||
<polyline points="835,677 646,531 646,531" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<polyline points="835,677 827,669 827,539 646,531" fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" stroke-dasharray="4,3"/>
|
||||
<text x="751" y="604" font-family="monospace" font-size="6" fill="#10b98188">256GB/s</text>
|
||||
<rect x="65" y="360" width="50" height="100" rx="3" fill="#1e1b4b" stroke="#8b5cf6" stroke-width="1.5" opacity="0.9"/>
|
||||
<text x="90" y="357" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#8b5cf6">UCIe-W</text>
|
||||
<rect x="67" y="362" width="46" height="23" rx="2" fill="#818cf8" opacity="0.7"/>
|
||||
<text x="90" y="376" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c0</text>
|
||||
<polyline points="127,135 113,374 113,374" fill="none" stroke="#818cf8" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="127,135 121,141 119,141 113,374" fill="none" stroke="#818cf8" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="67" y="386" width="46" height="23" rx="2" fill="#a78bfa" opacity="0.7"/>
|
||||
<text x="90" y="400" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c1</text>
|
||||
<polyline points="127,260 113,398 113,398" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="127,260 121,266 119,266 113,398" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="67" y="410" width="46" height="23" rx="2" fill="#c084fc" opacity="0.7"/>
|
||||
<text x="90" y="424" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c2</text>
|
||||
<polyline points="127,560 113,422 113,422" fill="none" stroke="#c084fc" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="127,560 121,554 119,554 113,422" fill="none" stroke="#c084fc" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="67" y="434" width="46" height="23" rx="2" fill="#e879f9" opacity="0.7"/>
|
||||
<text x="90" y="448" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c3</text>
|
||||
<polyline points="127,685 113,446 113,446" fill="none" stroke="#e879f9" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="127,685 121,679 119,679 113,446" fill="none" stroke="#e879f9" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="435" y="65" width="100" height="50" rx="3" fill="#1e1b4b" stroke="#8b5cf6" stroke-width="1.5" opacity="0.9"/>
|
||||
<text x="485" y="62" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#8b5cf6">UCIe-N</text>
|
||||
<rect x="437" y="67" width="23" height="46" rx="2" fill="#818cf8" opacity="0.7"/>
|
||||
<text x="448" y="93" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c0</text>
|
||||
<polyline points="135,127 448,113 448,113" fill="none" stroke="#818cf8" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="135,127 141,121 141,119 448,113" fill="none" stroke="#818cf8" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="461" y="67" width="23" height="46" rx="2" fill="#a78bfa" opacity="0.7"/>
|
||||
<text x="472" y="93" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c1</text>
|
||||
<polyline points="285,127 472,113 472,113" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="285,127 291,121 291,119 472,113" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="485" y="67" width="23" height="46" rx="2" fill="#c084fc" opacity="0.7"/>
|
||||
<text x="496" y="93" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c2</text>
|
||||
<polyline points="685,127 496,113 496,113" fill="none" stroke="#c084fc" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="685,127 679,121 679,119 496,113" fill="none" stroke="#c084fc" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="509" y="67" width="23" height="46" rx="2" fill="#e879f9" opacity="0.7"/>
|
||||
<text x="520" y="93" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c3</text>
|
||||
<polyline points="835,127 520,113 520,113" fill="none" stroke="#e879f9" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="835,127 829,121 829,119 520,113" fill="none" stroke="#e879f9" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="855" y="360" width="50" height="100" rx="3" fill="#1e1b4b" stroke="#8b5cf6" stroke-width="1.5" opacity="0.9"/>
|
||||
<text x="880" y="357" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#8b5cf6">UCIe-E</text>
|
||||
<rect x="857" y="362" width="46" height="23" rx="2" fill="#818cf8" opacity="0.7"/>
|
||||
<text x="880" y="376" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c0</text>
|
||||
<polyline points="843,135 857,374 857,374" fill="none" stroke="#818cf8" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="843,135 849,141 851,141 857,374" fill="none" stroke="#818cf8" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="857" y="386" width="46" height="23" rx="2" fill="#a78bfa" opacity="0.7"/>
|
||||
<text x="880" y="400" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c1</text>
|
||||
<polyline points="843,260 857,398 857,398" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="843,260 849,266 851,266 857,398" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="857" y="410" width="46" height="23" rx="2" fill="#c084fc" opacity="0.7"/>
|
||||
<text x="880" y="424" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c2</text>
|
||||
<polyline points="843,560 857,422 857,422" fill="none" stroke="#c084fc" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="843,560 849,554 851,554 857,422" fill="none" stroke="#c084fc" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="857" y="434" width="46" height="23" rx="2" fill="#e879f9" opacity="0.7"/>
|
||||
<text x="880" y="448" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c3</text>
|
||||
<polyline points="843,685 857,446 857,446" fill="none" stroke="#e879f9" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="843,685 849,679 851,679 857,446" fill="none" stroke="#e879f9" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="435" y="705" width="100" height="50" rx="3" fill="#1e1b4b" stroke="#8b5cf6" stroke-width="1.5" opacity="0.9"/>
|
||||
<text x="485" y="702" text-anchor="middle" font-family="monospace" font-size="7" font-weight="bold" fill="#8b5cf6">UCIe-S</text>
|
||||
<rect x="437" y="707" width="23" height="46" rx="2" fill="#818cf8" opacity="0.7"/>
|
||||
<text x="448" y="733" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c0</text>
|
||||
<polyline points="135,693 448,707 448,707" fill="none" stroke="#818cf8" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="135,693 141,699 141,701 448,707" fill="none" stroke="#818cf8" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="461" y="707" width="23" height="46" rx="2" fill="#a78bfa" opacity="0.7"/>
|
||||
<text x="472" y="733" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c1</text>
|
||||
<polyline points="285,693 472,707 472,707" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="285,693 291,699 291,701 472,707" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="485" y="707" width="23" height="46" rx="2" fill="#c084fc" opacity="0.7"/>
|
||||
<text x="496" y="733" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c2</text>
|
||||
<polyline points="685,693 496,707 496,707" fill="none" stroke="#c084fc" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="685,693 679,699 679,701 496,707" fill="none" stroke="#c084fc" stroke-width="1" opacity="0.5"/>
|
||||
<rect x="509" y="707" width="23" height="46" rx="2" fill="#e879f9" opacity="0.7"/>
|
||||
<text x="520" y="733" text-anchor="middle" font-family="monospace" font-size="5" fill="white">c3</text>
|
||||
<polyline points="835,693 520,707 520,707" fill="none" stroke="#e879f9" stroke-width="1" opacity="0.5"/>
|
||||
<polyline points="835,693 829,699 829,701 520,707" fill="none" stroke="#e879f9" stroke-width="1" opacity="0.5"/>
|
||||
<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: 30 KiB After Width: | Height: | Size: 30 KiB |
@@ -607,10 +607,14 @@ 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)
|
||||
|
||||
if 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)
|
||||
if kind == "mcpu":
|
||||
# M_CPU: place above (north of) router
|
||||
bx = px - blk_w / 2
|
||||
by = py - r_size - blk_h - 8
|
||||
elif kind == "sram":
|
||||
# SRAM: place below (south of) router
|
||||
bx = px - blk_w / 2
|
||||
by = py + r_size + 8
|
||||
else:
|
||||
# PE: place above (top half) or below (bottom half)
|
||||
bx = px + offset_x - blk_w / 2
|
||||
@@ -632,50 +636,53 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
|
||||
f'text-anchor="middle" font-family="monospace" font-size="{font_sz}" '
|
||||
f'font-weight="bold" fill="{style["text"]}">{_escape(label)}</text>'
|
||||
)
|
||||
# Connector line: router → component (diagonal out from router, then straight)
|
||||
# Connector: router ─45°─ straight ─45°─ component
|
||||
sc = style["stroke"]
|
||||
if kind in ("mcpu", "sram"):
|
||||
# Router → 45° diagonal → horizontal to block
|
||||
x1 = bx + blk_w # block right edge
|
||||
y1 = by + blk_h / 2
|
||||
x2 = px - r_size # router left edge
|
||||
y2 = py
|
||||
dy = abs(y2 - y1)
|
||||
# From router: diagonal 45° toward block, then horizontal
|
||||
mid_x = x2 - dy # 45° means dx == dy
|
||||
if mid_x < x1:
|
||||
mid_x = x1
|
||||
d = 6 # 45° stub length (px)
|
||||
if kind == "mcpu":
|
||||
# Router top → 45° NW stub → vertical → 45° into block bottom
|
||||
rx2, ry2 = px, py - r_size
|
||||
bxc, byc = bx + blk_w / 2, by + blk_h
|
||||
parts.append(
|
||||
f' <polyline points="{x2:.0f},{y2:.0f} {mid_x:.0f},{y1:.0f} {x1:.0f},{y1:.0f}" '
|
||||
f' <polyline points="'
|
||||
f'{rx2:.0f},{ry2:.0f} {rx2 - d:.0f},{ry2 - d:.0f} '
|
||||
f'{rx2 - d:.0f},{byc + d:.0f} {bxc:.0f},{byc:.0f}" '
|
||||
f'fill="none" stroke="{sc}" stroke-width="1" opacity="0.6"/>'
|
||||
)
|
||||
elif kind == "sram":
|
||||
# Router bottom → 45° SW stub → vertical → 45° into block top
|
||||
rx2, ry2 = px, py + r_size
|
||||
bxc, byc = bx + blk_w / 2, by
|
||||
parts.append(
|
||||
f' <polyline points="'
|
||||
f'{rx2:.0f},{ry2:.0f} {rx2 - d:.0f},{ry2 + d:.0f} '
|
||||
f'{rx2 - d:.0f},{byc - d:.0f} {bxc:.0f},{byc:.0f}" '
|
||||
f'fill="none" stroke="{sc}" stroke-width="1" opacity="0.6"/>'
|
||||
)
|
||||
else:
|
||||
# PE: Router → 45° diagonal → vertical to block
|
||||
# PE: vertical direction
|
||||
bxc = bx + blk_w / 2 + offset_x
|
||||
if is_top:
|
||||
x1 = bx + blk_w / 2 + offset_x # block center
|
||||
y1 = by + blk_h # block bottom
|
||||
x2 = px # router center
|
||||
y2 = py - r_size # router top
|
||||
dx = abs(x2 - x1)
|
||||
# From router: 45° diagonal, then vertical to block
|
||||
mid_y = y2 - dx
|
||||
if mid_y < y1:
|
||||
mid_y = y1
|
||||
rx2, ry2 = px, py - r_size # router top
|
||||
byc = by + blk_h # block bottom
|
||||
# 45° stub from router, vertical, 45° into block
|
||||
sx = bxc - px # horizontal shift direction
|
||||
sd = d if sx >= 0 else -d
|
||||
parts.append(
|
||||
f' <polyline points="{x2:.0f},{y2:.0f} {x1:.0f},{mid_y:.0f} {x1:.0f},{y1:.0f}" '
|
||||
f' <polyline points="'
|
||||
f'{rx2:.0f},{ry2:.0f} {rx2 + sd:.0f},{ry2 - d:.0f} '
|
||||
f'{rx2 + sd:.0f},{byc + d:.0f} {bxc:.0f},{byc:.0f}" '
|
||||
f'fill="none" stroke="{sc}" stroke-width="1" opacity="0.6"/>'
|
||||
)
|
||||
else:
|
||||
x1 = bx + blk_w / 2 + offset_x
|
||||
y1 = by # block top
|
||||
x2 = px
|
||||
y2 = py + r_size # router bottom
|
||||
dx = abs(x2 - x1)
|
||||
mid_y = y2 + dx
|
||||
if mid_y > y1:
|
||||
mid_y = y1
|
||||
rx2, ry2 = px, py + r_size # router bottom
|
||||
byc = by # block top
|
||||
sx = bxc - px
|
||||
sd = d if sx >= 0 else -d
|
||||
parts.append(
|
||||
f' <polyline points="{x2:.0f},{y2:.0f} {x1:.0f},{mid_y:.0f} {x1:.0f},{y1:.0f}" '
|
||||
f' <polyline points="'
|
||||
f'{rx2:.0f},{ry2:.0f} {rx2 + sd:.0f},{ry2 + d:.0f} '
|
||||
f'{rx2 + sd:.0f},{byc - d:.0f} {bxc:.0f},{byc:.0f}" '
|
||||
f'fill="none" stroke="{sc}" stroke-width="1" opacity="0.6"/>'
|
||||
)
|
||||
|
||||
@@ -697,23 +704,26 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
|
||||
rpx, rpy = mm2px(rx, ry)
|
||||
tgx, tgy = _pe_hbm_targets[pe_id]
|
||||
r_edge_y = rpy + r_size if rpy < hbm_y else rpy - r_size
|
||||
# From router: 45° diagonal toward HBM port, then vertical to port
|
||||
dx = abs(tgx - rpx)
|
||||
# 45° stub from router → vertical → 45° into HBM port
|
||||
d = 8 # stub length
|
||||
sx = tgx - rpx
|
||||
sd = d if sx >= 0 else -d
|
||||
if rpy < hbm_y:
|
||||
# Top half: router bottom → 45° diagonal → vertical down to HBM top
|
||||
mid_y = r_edge_y + dx
|
||||
if mid_y > tgy:
|
||||
mid_y = tgy
|
||||
parts.append(
|
||||
f' <polyline points="'
|
||||
f'{rpx:.0f},{r_edge_y:.0f} {rpx + sd:.0f},{r_edge_y + d:.0f} '
|
||||
f'{rpx + sd:.0f},{tgy - d:.0f} {tgx:.0f},{tgy:.0f}" '
|
||||
f'fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" '
|
||||
f'stroke-dasharray="4,3"/>'
|
||||
)
|
||||
else:
|
||||
# Bottom half: router top → 45° diagonal → vertical up to HBM bottom
|
||||
mid_y = r_edge_y - dx
|
||||
if mid_y < tgy:
|
||||
mid_y = tgy
|
||||
parts.append(
|
||||
f' <polyline points="{rpx:.0f},{r_edge_y:.0f} {tgx:.0f},{mid_y:.0f} {tgx:.0f},{tgy:.0f}" '
|
||||
f'fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" '
|
||||
f'stroke-dasharray="4,3"/>'
|
||||
)
|
||||
parts.append(
|
||||
f' <polyline points="'
|
||||
f'{rpx:.0f},{r_edge_y:.0f} {rpx + sd:.0f},{r_edge_y - d:.0f} '
|
||||
f'{rpx + sd:.0f},{tgy + d:.0f} {tgx:.0f},{tgy:.0f}" '
|
||||
f'fill="none" stroke="#10b981" stroke-width="1.5" opacity="0.6" '
|
||||
f'stroke-dasharray="4,3"/>'
|
||||
)
|
||||
# BW annotation at midpoint
|
||||
mx = (rpx + tgx) / 2 + 10
|
||||
my = (r_edge_y + tgy) / 2
|
||||
@@ -807,51 +817,51 @@ def _render_cube_view_svg(view: ViewGraph, spec: dict) -> str:
|
||||
f'{conn}</text>'
|
||||
)
|
||||
|
||||
# Connector line: router → UCIe port (diagonal from router, then straight)
|
||||
# Connector: router ─45°stub─ straight ─45°stub─ UCIe port
|
||||
rpx, rpy = mm2px(crx, cry)
|
||||
d = 6
|
||||
if direction == "N":
|
||||
# Router top → 45° diagonal → vertical to UCIe port
|
||||
x2, y2 = rpx, rpy - r_size # router top
|
||||
x1, y1 = lx, cy_box + ch # port bottom
|
||||
dx = abs(x1 - x2)
|
||||
mid_y = y2 - dx
|
||||
if mid_y < y1:
|
||||
mid_y = y1
|
||||
rx, ry = rpx, rpy - r_size
|
||||
tx, ty = lx, cy_box + ch
|
||||
sx = tx - rx
|
||||
sd = d if sx >= 0 else -d
|
||||
parts.append(
|
||||
f' <polyline points="{x2:.0f},{y2:.0f} {x1:.0f},{mid_y:.0f} {x1:.0f},{y1:.0f}" '
|
||||
f' <polyline points="'
|
||||
f'{rx:.0f},{ry:.0f} {rx + sd:.0f},{ry - d:.0f} '
|
||||
f'{rx + sd:.0f},{ty + d:.0f} {tx:.0f},{ty:.0f}" '
|
||||
f'fill="none" stroke="{c_color}" stroke-width="1" opacity="0.5"/>'
|
||||
)
|
||||
elif direction == "S":
|
||||
x2, y2 = rpx, rpy + r_size
|
||||
x1, y1 = lx, cy_box
|
||||
dx = abs(x1 - x2)
|
||||
mid_y = y2 + dx
|
||||
if mid_y > y1:
|
||||
mid_y = y1
|
||||
rx, ry = rpx, rpy + r_size
|
||||
tx, ty = lx, cy_box
|
||||
sx = tx - rx
|
||||
sd = d if sx >= 0 else -d
|
||||
parts.append(
|
||||
f' <polyline points="{x2:.0f},{y2:.0f} {x1:.0f},{mid_y:.0f} {x1:.0f},{y1:.0f}" '
|
||||
f' <polyline points="'
|
||||
f'{rx:.0f},{ry:.0f} {rx + sd:.0f},{ry + d:.0f} '
|
||||
f'{rx + sd:.0f},{ty - d:.0f} {tx:.0f},{ty:.0f}" '
|
||||
f'fill="none" stroke="{c_color}" stroke-width="1" opacity="0.5"/>'
|
||||
)
|
||||
elif direction == "W":
|
||||
x2, y2 = rpx - r_size, rpy
|
||||
x1, y1 = cx + cw, cy_box + ch / 2
|
||||
dy = abs(y1 - y2)
|
||||
mid_x = x2 - dy
|
||||
if mid_x < x1:
|
||||
mid_x = x1
|
||||
rx, ry = rpx - r_size, rpy
|
||||
tx, ty = cx + cw, cy_box + ch / 2
|
||||
sy = ty - ry
|
||||
sd = d if sy >= 0 else -d
|
||||
parts.append(
|
||||
f' <polyline points="{x2:.0f},{y2:.0f} {mid_x:.0f},{y1:.0f} {x1:.0f},{y1:.0f}" '
|
||||
f' <polyline points="'
|
||||
f'{rx:.0f},{ry:.0f} {rx - d:.0f},{ry + sd:.0f} '
|
||||
f'{tx + d:.0f},{ry + sd:.0f} {tx:.0f},{ty:.0f}" '
|
||||
f'fill="none" stroke="{c_color}" stroke-width="1" opacity="0.5"/>'
|
||||
)
|
||||
elif direction == "E":
|
||||
x2, y2 = rpx + r_size, rpy
|
||||
x1, y1 = cx, cy_box + ch / 2
|
||||
dy = abs(y1 - y2)
|
||||
mid_x = x2 + dy
|
||||
if mid_x > x1:
|
||||
mid_x = x1
|
||||
rx, ry = rpx + r_size, rpy
|
||||
tx, ty = cx, cy_box + ch / 2
|
||||
sy = ty - ry
|
||||
sd = d if sy >= 0 else -d
|
||||
parts.append(
|
||||
f' <polyline points="{x2:.0f},{y2:.0f} {mid_x:.0f},{y1:.0f} {x1:.0f},{y1:.0f}" '
|
||||
f' <polyline points="'
|
||||
f'{rx:.0f},{ry:.0f} {rx + d:.0f},{ry + sd:.0f} '
|
||||
f'{tx - d:.0f},{ry + sd:.0f} {tx:.0f},{ty:.0f}" '
|
||||
f'fill="none" stroke="{c_color}" stroke-width="1" opacity="0.5"/>'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user