LSI Layout Optimization

Minimizing Wire Length and Delay

LSI (Large-Scale Integration) layout optimization is one of the core challenges in VLSI design. The goal is to determine the placement of circuit components and the routing of interconnects such that total wire length and signal delay are minimized. In this post, we walk through a concrete example problem, solve it in Python, and visualize the results — including a 3D view.


Problem Setup

We have 10 logic cells that need to be placed on a 2D grid. Each cell has connectivity to other cells (a netlist). We want to minimize:

1. Total wire length (HPWL — Half-Perimeter Wire Length):

$$HPWL = \sum_{n \in \text{nets}} \left[ \left(\max_i x_i - \min_i x_i\right) + \left(\max_i y_i - \min_i y_i\right) \right]$$

2. Signal delay (modeled as RC delay proportional to wire length):

$$t_{delay} = \sum_{n \in \text{nets}} r \cdot c \cdot L_n^2$$

where $L_n$ is the wire length of net $n$, and $r$, $c$ are resistance and capacitance per unit length.

We solve this using Simulated Annealing (SA) — a metaheuristic well-suited for this combinatorial placement problem.


Full Source Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# ============================================================
# LSI Layout Optimization: Wire Length & Delay Minimization
# Simulated Annealing Approach
# ============================================================

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from mpl_toolkits.mplot3d import Axes3D
import random
import math
from copy import deepcopy
import warnings
warnings.filterwarnings('ignore')

# ─────────────────────────────────────────────
# 1. Problem Definition
# ─────────────────────────────────────────────
np.random.seed(42)
random.seed(42)

NUM_CELLS = 10
GRID_SIZE = 5 # 5x5 grid → 25 slots, 10 cells placed

# Cell names
cell_names = [f"C{i}" for i in range(NUM_CELLS)]

# Netlist: list of nets, each net is a list of connected cell indices
netlist = [
[0, 1, 2], # Net 0: C0-C1-C2
[1, 3], # Net 1: C1-C3
[2, 4, 5], # Net 2: C2-C4-C5
[3, 4, 6], # Net 3: C3-C4-C6
[5, 7], # Net 4: C5-C7
[6, 7, 8], # Net 5: C6-C7-C8
[7, 9], # Net 6: C7-C9
[8, 9, 0], # Net 7: C8-C9-C0
[0, 5, 9], # Net 8: C0-C5-C9
[1, 6], # Net 9: C1-C6
]

# RC parameters (normalized)
R_PER_UNIT = 0.1 # Ω/unit
C_PER_UNIT = 0.1 # F/unit

# ─────────────────────────────────────────────
# 2. Cost Functions
# ─────────────────────────────────────────────
def compute_hpwl(placement, netlist):
"""Half-Perimeter Wire Length (HPWL)"""
total = 0.0
for net in netlist:
xs = [placement[c][0] for c in net]
ys = [placement[c][1] for c in net]
total += (max(xs) - min(xs)) + (max(ys) - min(ys))
return total

def compute_delay(placement, netlist, r=R_PER_UNIT, c=C_PER_UNIT):
"""
Elmore delay model (simplified):
t_delay = r * c * L^2 summed over all nets
"""
total = 0.0
for net in netlist:
xs = [placement[c_idx][0] for c_idx in net]
ys = [placement[c_idx][1] for c_idx in net]
L = (max(xs) - min(xs)) + (max(ys) - min(ys))
total += r * c * (L ** 2)
return total

def cost(placement, netlist, alpha=0.6, beta=0.4):
"""
Combined cost: weighted sum of HPWL and delay
alpha * HPWL + beta * delay
"""
hpwl = compute_hpwl(placement, netlist)
delay = compute_delay(placement, netlist)
return alpha * hpwl + beta * delay, hpwl, delay

# ─────────────────────────────────────────────
# 3. Placement Representation & Initialization
# ─────────────────────────────────────────────
def random_placement(num_cells, grid_size):
"""Assign each cell a unique grid position (x, y)"""
all_positions = [(x, y) for x in range(grid_size) for y in range(grid_size)]
chosen = random.sample(all_positions, num_cells)
return {i: chosen[i] for i in range(num_cells)}

def swap_cells(placement, num_cells, grid_size):
"""
Neighbor move: swap two cells (or move one to empty slot).
Returns a new placement dict.
"""
new_pl = dict(placement)
# Pick two distinct random cells
a, b = random.sample(range(num_cells), 2)
new_pl[a], new_pl[b] = new_pl[b], new_pl[a]
return new_pl

# ─────────────────────────────────────────────
# 4. Simulated Annealing
# ─────────────────────────────────────────────
def simulated_annealing(netlist, num_cells, grid_size,
T_init=5.0, T_min=1e-4,
cooling_rate=0.995, max_iter=50000,
alpha=0.6, beta=0.4):
"""
Simulated Annealing for placement optimization.
Returns best placement and history.
"""
current_pl = random_placement(num_cells, grid_size)
c_val, c_hpwl, c_delay = cost(current_pl, netlist, alpha, beta)

best_pl = dict(current_pl)
best_cost = c_val
best_hpwl = c_hpwl
best_delay = c_delay

T = T_init
history = {
'cost': [c_val],
'hpwl': [c_hpwl],
'delay': [c_delay],
'temp': [T],
'iter': [0]
}

log_interval = max_iter // 200 # record ~200 data points

for it in range(1, max_iter + 1):
# Generate neighbor
new_pl = swap_cells(current_pl, num_cells, grid_size)
n_val, n_hpwl, n_delay = cost(new_pl, netlist, alpha, beta)

delta = n_val - c_val

# Acceptance criterion
if delta < 0 or random.random() < math.exp(-delta / T):
current_pl = new_pl
c_val, c_hpwl, c_delay = n_val, n_hpwl, n_delay

if c_val < best_cost:
best_pl = dict(current_pl)
best_cost = c_val
best_hpwl = c_hpwl
best_delay = c_delay

T *= cooling_rate

if it % log_interval == 0:
history['cost'].append(c_val)
history['hpwl'].append(c_hpwl)
history['delay'].append(c_delay)
history['temp'].append(T)
history['iter'].append(it)

if T < T_min:
break

return best_pl, best_cost, best_hpwl, best_delay, history

# ─────────────────────────────────────────────
# 5. Run Optimization
# ─────────────────────────────────────────────
print("=" * 50)
print(" LSI Layout Optimization via Simulated Annealing")
print("=" * 50)

# Initial random placement (for comparison)
init_pl = random_placement(NUM_CELLS, GRID_SIZE)
init_cost, init_hpwl, init_delay = cost(init_pl, netlist)
print(f"\n[Initial Random Placement]")
print(f" HPWL : {init_hpwl:.4f}")
print(f" Delay : {init_delay:.4f}")
print(f" Cost : {init_cost:.4f}")

# Run SA
best_pl, best_cost, best_hpwl, best_delay, history = simulated_annealing(
netlist, NUM_CELLS, GRID_SIZE,
T_init=5.0, T_min=1e-4, cooling_rate=0.995,
max_iter=50000, alpha=0.6, beta=0.4
)

print(f"\n[Optimized Placement (SA)]")
print(f" HPWL : {best_hpwl:.4f}")
print(f" Delay : {best_delay:.4f}")
print(f" Cost : {best_cost:.4f}")

improvement_hpwl = (init_hpwl - best_hpwl) / init_hpwl * 100
improvement_delay = (init_delay - best_delay) / init_delay * 100
print(f"\n[Improvement]")
print(f" HPWL reduction : {improvement_hpwl:.1f}%")
print(f" Delay reduction : {improvement_delay:.1f}%")
print(f"\n[Final Cell Positions]")
for cell_id, pos in best_pl.items():
print(f" {cell_names[cell_id]}: grid({pos[0]}, {pos[1]})")

# ─────────────────────────────────────────────
# 6. Visualization
# ─────────────────────────────────────────────
fig = plt.figure(figsize=(20, 16))
fig.patch.set_facecolor('#0f0f1a')

# Color palette
COLORS = {
'bg': '#0f0f1a',
'panel': '#1a1a2e',
'cell': '#00d4ff',
'net': '#ff6b35',
'net2': '#ffd700',
'text': '#e0e0e0',
'grid': '#2a2a4a',
'good': '#39ff14',
'bad': '#ff4444',
'accent': '#bf5fff',
}

cell_colors = plt.cm.plasma(np.linspace(0.1, 0.9, NUM_CELLS))

# ── Plot 1: Initial Placement ──────────────────
ax1 = fig.add_subplot(3, 3, 1)
ax1.set_facecolor(COLORS['panel'])

def draw_placement(ax, placement, netlist, title, color_cells):
ax.set_xlim(-0.5, GRID_SIZE - 0.5)
ax.set_ylim(-0.5, GRID_SIZE - 0.5)
ax.set_xticks(range(GRID_SIZE))
ax.set_yticks(range(GRID_SIZE))
ax.grid(True, color=COLORS['grid'], linewidth=0.5, alpha=0.5)
ax.set_title(title, color=COLORS['text'], fontsize=11, fontweight='bold', pad=8)
ax.tick_params(colors=COLORS['text'], labelsize=8)
for spine in ax.spines.values():
spine.set_edgecolor(COLORS['grid'])

# Draw nets
net_colors_local = plt.cm.Set2(np.linspace(0, 1, len(netlist)))
for ni, net in enumerate(netlist):
xs = [placement[c][0] for c in net]
ys = [placement[c][1] for c in net]
for j in range(len(net)):
for k in range(j+1, len(net)):
ax.plot([placement[net[j]][0], placement[net[k]][0]],
[placement[net[j]][1], placement[net[k]][1]],
color=net_colors_local[ni], alpha=0.4, linewidth=1.2)

# Draw cells
for cell_id, (cx, cy) in placement.items():
circle = plt.Circle((cx, cy), 0.3, color=color_cells[cell_id],
zorder=5, linewidth=1.5, edgecolor='white')
ax.add_patch(circle)
ax.text(cx, cy, cell_names[cell_id], ha='center', va='center',
fontsize=7, fontweight='bold', color='black', zorder=6)

draw_placement(ax1, init_pl, netlist, f'Initial Placement\nHPWL={init_hpwl:.2f}', cell_colors)

# ── Plot 2: Optimized Placement ────────────────
ax2 = fig.add_subplot(3, 3, 2)
ax2.set_facecolor(COLORS['panel'])
draw_placement(ax2, best_pl, netlist, f'Optimized Placement (SA)\nHPWL={best_hpwl:.2f}', cell_colors)

# ── Plot 3: HPWL convergence ───────────────────
ax3 = fig.add_subplot(3, 3, 3)
ax3.set_facecolor(COLORS['panel'])
ax3.plot(history['iter'], history['hpwl'], color=COLORS['cell'],
linewidth=1.5, label='HPWL')
ax3.axhline(best_hpwl, color=COLORS['good'], linestyle='--', linewidth=1, label=f'Best={best_hpwl:.2f}')
ax3.set_title('HPWL Convergence', color=COLORS['text'], fontsize=11, fontweight='bold')
ax3.set_xlabel('Iteration', color=COLORS['text'], fontsize=9)
ax3.set_ylabel('HPWL', color=COLORS['text'], fontsize=9)
ax3.tick_params(colors=COLORS['text'], labelsize=8)
ax3.legend(fontsize=8, facecolor=COLORS['panel'], labelcolor=COLORS['text'])
for spine in ax3.spines.values():
spine.set_edgecolor(COLORS['grid'])

# ── Plot 4: Delay convergence ──────────────────
ax4 = fig.add_subplot(3, 3, 4)
ax4.set_facecolor(COLORS['panel'])
ax4.plot(history['iter'], history['delay'], color=COLORS['net'],
linewidth=1.5, label='Delay')
ax4.axhline(best_delay, color=COLORS['good'], linestyle='--', linewidth=1, label=f'Best={best_delay:.3f}')
ax4.set_title('Signal Delay Convergence', color=COLORS['text'], fontsize=11, fontweight='bold')
ax4.set_xlabel('Iteration', color=COLORS['text'], fontsize=9)
ax4.set_ylabel('Delay (RC units)', color=COLORS['text'], fontsize=9)
ax4.tick_params(colors=COLORS['text'], labelsize=8)
ax4.legend(fontsize=8, facecolor=COLORS['panel'], labelcolor=COLORS['text'])
for spine in ax4.spines.values():
spine.set_edgecolor(COLORS['grid'])

# ── Plot 5: Temperature schedule ──────────────
ax5 = fig.add_subplot(3, 3, 5)
ax5.set_facecolor(COLORS['panel'])
ax5.semilogy(history['iter'], history['temp'], color=COLORS['accent'], linewidth=1.5)
ax5.set_title('Annealing Temperature Schedule', color=COLORS['text'], fontsize=11, fontweight='bold')
ax5.set_xlabel('Iteration', color=COLORS['text'], fontsize=9)
ax5.set_ylabel('Temperature (log)', color=COLORS['text'], fontsize=9)
ax5.tick_params(colors=COLORS['text'], labelsize=8)
for spine in ax5.spines.values():
spine.set_edgecolor(COLORS['grid'])

# ── Plot 6: Per-net wire length comparison ─────
ax6 = fig.add_subplot(3, 3, 6)
ax6.set_facecolor(COLORS['panel'])

init_net_wl = []
best_net_wl = []
for net in netlist:
xs_i = [init_pl[c][0] for c in net]; ys_i = [init_pl[c][1] for c in net]
xs_b = [best_pl[c][0] for c in net]; ys_b = [best_pl[c][1] for c in net]
init_net_wl.append((max(xs_i)-min(xs_i)) + (max(ys_i)-min(ys_i)))
best_net_wl.append((max(xs_b)-min(xs_b)) + (max(ys_b)-min(ys_b)))

x_idx = np.arange(len(netlist))
bars1 = ax6.bar(x_idx - 0.2, init_net_wl, 0.35, label='Initial',
color=COLORS['bad'], alpha=0.8, edgecolor='white', linewidth=0.5)
bars2 = ax6.bar(x_idx + 0.2, best_net_wl, 0.35, label='Optimized',
color=COLORS['good'], alpha=0.8, edgecolor='white', linewidth=0.5)
ax6.set_title('Per-Net Wire Length', color=COLORS['text'], fontsize=11, fontweight='bold')
ax6.set_xlabel('Net ID', color=COLORS['text'], fontsize=9)
ax6.set_ylabel('Wire Length', color=COLORS['text'], fontsize=9)
ax6.set_xticks(x_idx)
ax6.set_xticklabels([f'N{i}' for i in range(len(netlist))], fontsize=8)
ax6.tick_params(colors=COLORS['text'], labelsize=8)
ax6.legend(fontsize=8, facecolor=COLORS['panel'], labelcolor=COLORS['text'])
for spine in ax6.spines.values():
spine.set_edgecolor(COLORS['grid'])

# ── Plot 7: 3D Cost Landscape ──────────────────
ax7 = fig.add_subplot(3, 3, 7, projection='3d')
ax7.set_facecolor(COLORS['bg'])

# Compute cost over a 2D sweep of cell-0's position
grid_range = np.arange(GRID_SIZE)
Z_hpwl = np.zeros((GRID_SIZE, GRID_SIZE))
Z_delay = np.zeros((GRID_SIZE, GRID_SIZE))

base_pl = dict(best_pl)
for xi, gx in enumerate(grid_range):
for yi, gy in enumerate(grid_range):
test_pl = dict(base_pl)
test_pl[0] = (gx, gy) # move only cell-0
h = compute_hpwl(test_pl, netlist)
d = compute_delay(test_pl, netlist)
Z_hpwl[yi, xi] = h
Z_delay[yi, xi] = d

X3, Y3 = np.meshgrid(grid_range, grid_range)
surf = ax7.plot_surface(X3, Y3, Z_hpwl, cmap='plasma',
edgecolor='none', alpha=0.85)
ax7.scatter([best_pl[0][0]], [best_pl[0][1]], [compute_hpwl(best_pl, netlist)],
color=COLORS['good'], s=100, zorder=10, label='Optimal pos')
ax7.set_title('3D HPWL Landscape\n(C0 position sweep)', color=COLORS['text'],
fontsize=10, fontweight='bold')
ax7.set_xlabel('Grid X', color=COLORS['text'], fontsize=8)
ax7.set_ylabel('Grid Y', color=COLORS['text'], fontsize=8)
ax7.set_zlabel('HPWL', color=COLORS['text'], fontsize=8)
ax7.tick_params(colors=COLORS['text'], labelsize=7)
ax7.xaxis.pane.fill = False; ax7.yaxis.pane.fill = False; ax7.zaxis.pane.fill = False
ax7.xaxis.pane.set_edgecolor(COLORS['grid'])
ax7.yaxis.pane.set_edgecolor(COLORS['grid'])
ax7.zaxis.pane.set_edgecolor(COLORS['grid'])
plt.colorbar(surf, ax=ax7, shrink=0.5, aspect=10, pad=0.1).ax.yaxis.set_tick_params(color=COLORS['text'])

# ── Plot 8: 3D Delay Landscape ─────────────────
ax8 = fig.add_subplot(3, 3, 8, projection='3d')
ax8.set_facecolor(COLORS['bg'])

surf2 = ax8.plot_surface(X3, Y3, Z_delay, cmap='inferno',
edgecolor='none', alpha=0.85)
ax8.scatter([best_pl[0][0]], [best_pl[0][1]], [compute_delay(best_pl, netlist)],
color=COLORS['cell'], s=100, zorder=10, label='Optimal pos')
ax8.set_title('3D Delay Landscape\n(C0 position sweep)', color=COLORS['text'],
fontsize=10, fontweight='bold')
ax8.set_xlabel('Grid X', color=COLORS['text'], fontsize=8)
ax8.set_ylabel('Grid Y', color=COLORS['text'], fontsize=8)
ax8.set_zlabel('Delay (RC)', color=COLORS['text'], fontsize=8)
ax8.tick_params(colors=COLORS['text'], labelsize=7)
ax8.xaxis.pane.fill = False; ax8.yaxis.pane.fill = False; ax8.zaxis.pane.fill = False
ax8.xaxis.pane.set_edgecolor(COLORS['grid'])
ax8.yaxis.pane.set_edgecolor(COLORS['grid'])
ax8.zaxis.pane.set_edgecolor(COLORS['grid'])
plt.colorbar(surf2, ax=ax8, shrink=0.5, aspect=10, pad=0.1)

# ── Plot 9: Summary bar chart ──────────────────
ax9 = fig.add_subplot(3, 3, 9)
ax9.set_facecolor(COLORS['panel'])

metrics = ['HPWL', 'Delay (×10)', 'Total Cost']
init_vals = [init_hpwl, init_delay * 10, init_cost]
best_vals = [best_hpwl, best_delay * 10, best_cost]

xm = np.arange(len(metrics))
ax9.bar(xm - 0.2, init_vals, 0.35, label='Initial',
color=COLORS['bad'], alpha=0.85, edgecolor='white', linewidth=0.5)
ax9.bar(xm + 0.2, best_vals, 0.35, label='Optimized',
color=COLORS['good'], alpha=0.85, edgecolor='white', linewidth=0.5)

for i, (iv, bv) in enumerate(zip(init_vals, best_vals)):
pct = (iv - bv) / iv * 100 if iv > 0 else 0
ax9.text(i, max(iv, bv) + 0.05, f'−{pct:.0f}%',
ha='center', va='bottom', fontsize=8, color=COLORS['good'], fontweight='bold')

ax9.set_title('Optimization Summary', color=COLORS['text'], fontsize=11, fontweight='bold')
ax9.set_xticks(xm)
ax9.set_xticklabels(metrics, fontsize=9)
ax9.tick_params(colors=COLORS['text'], labelsize=8)
ax9.legend(fontsize=8, facecolor=COLORS['panel'], labelcolor=COLORS['text'])
for spine in ax9.spines.values():
spine.set_edgecolor(COLORS['grid'])

plt.suptitle('LSI Layout Optimization — Simulated Annealing',
color=COLORS['text'], fontsize=15, fontweight='bold', y=1.01)
plt.tight_layout()
plt.savefig('lsi_layout_optimization.png', dpi=150, bbox_inches='tight',
facecolor=COLORS['bg'])
plt.show()
print("\nFigure saved: lsi_layout_optimization.png")

Code Walkthrough

Section 1 — Problem Definition

The netlist defines connectivity between 10 cells across 10 nets. For example, Net 0 connects cells C0, C1, and C2. The placement is done on a $5 \times 5$ grid (25 slots), of which only 10 are occupied. This mimics a sparse floorplan typical in real chip design.

Section 2 — Cost Functions

compute_hpwl iterates over each net and computes the bounding box of all connected cells:

$$HPWL_n = (x_{max} - x_{min}) + (y_{max} - y_{min})$$

This is the standard industry approximation for wire length — cheap to compute and tightly correlated with actual routed length.

compute_delay applies the simplified Elmore delay model. For a net of wire length $L$:

$$t_{delay} = r \cdot c \cdot L^2$$

The quadratic dependence on $L$ means long wires are disproportionately penalized — exactly the behavior real delay models exhibit.

cost is a weighted combination:

$$\mathcal{C} = \alpha \cdot HPWL + \beta \cdot t_{delay}, \quad \alpha=0.6,\ \beta=0.4$$

Section 3 — Placement Representation

Each placement is a dictionary {cell_id: (x, y)}. The move operator swaps two randomly chosen cells — this ensures we always remain in a valid state (no two cells on the same slot, all cells placed).

Section 4 — Simulated Annealing

SA is a probabilistic optimization algorithm inspired by the annealing process in metallurgy. At each step:

  1. Generate a neighbor by swapping two cells.
  2. Compute $\Delta \mathcal{C} = \mathcal{C}{new} - \mathcal{C}{current}$.
  3. Accept if $\Delta \mathcal{C} < 0$ (improvement), or with probability $e^{-\Delta \mathcal{C} / T}$ (escape local minima).
  4. Cool the temperature: $T \leftarrow T \times \alpha_{cool}$ (here $\alpha_{cool} = 0.995$).

The acceptance probability decays with temperature, so early iterations explore broadly and later iterations converge. 50,000 iterations run in just a few seconds.

Sections 5–6 — Results & Visualization

Nine subplots are produced:

Plot Description
1 Initial random placement with net connections
2 SA-optimized placement
3 HPWL convergence over iterations
4 Signal delay convergence
5 Temperature cooling schedule (log scale)
6 Per-net wire length before/after
7 3D HPWL landscape as C0 sweeps all grid positions
8 3D Delay landscape (same sweep)
9 Summary comparison bar chart with % improvements

Key Insights from the Results

3D Landscape (Plots 7 & 8): By sweeping cell C0 across all 25 grid positions while holding other cells fixed, we get a cost surface. The peaks represent positions where C0 is far from its neighbors (high bounding box), and the valleys represent positions close to connected cells. The SA optimizer lands near a valley — confirming the algorithm’s effectiveness.

Convergence (Plots 3 & 4): HPWL and delay drop sharply in the early high-temperature phase (broad exploration), then plateau as the temperature drops and moves become increasingly selective.

Per-Net Comparison (Plot 6): Some nets improve dramatically; others are already near-optimal in the initial placement. Nets with many connections (e.g., Net 0, Net 8) benefit the most from placement optimization.

Temperature Schedule (Plot 5): The exponential decay on a log scale is linear — confirming the geometric cooling $T_k = T_0 \cdot \alpha^k$ is working as intended. This is critical: too fast a decay causes premature convergence; too slow wastes compute.


Execution Results

==================================================
  LSI Layout Optimization via Simulated Annealing
==================================================

[Initial Random Placement]
  HPWL  : 42.0000
  Delay : 2.5000
  Cost  : 26.2000

[Optimized Placement (SA)]
  HPWL  : 24.0000
  Delay : 0.7800
  Cost  : 14.7120

[Improvement]
  HPWL  reduction : 42.9%
  Delay reduction : 68.8%

[Final Cell Positions]
  C0: grid(1, 1)
  C1: grid(3, 1)
  C2: grid(2, 3)
  C3: grid(4, 1)
  C4: grid(4, 3)
  C5: grid(1, 2)
  C6: grid(3, 2)
  C7: grid(0, 2)
  C8: grid(0, 0)
  C9: grid(0, 1)

Figure saved: lsi_layout_optimization.png

The full figure will look like this across the 9 panels described above. The dark-themed visualization with plasma/inferno colormaps makes the 3D cost surfaces particularly vivid and easy to interpret.