Simple framework for physical chip design (place & route) based on KLayout.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

<?xml version="1.0" encoding="utf-8"?>
<text># === PLACEMENT ==='Start global placement.')
# Get initial positions from the layout.
fixed_circuits = set()
fixed_circuits.update({n for n in fixed_positions})
initial_positions = dict()
for inst in design.top_cell.each_inst():
pos = inst.trans.disp
inst_id ='circuit_id')
initial_positions[inst_id] = (pos.x, pos.y)
is_fixed ='fixed')
if is_fixed:
#placer = QuadraticPlacer()
placer = QuadraticDensityPlacer(density_penalty=8000)
global_positions =,
positions=fixed_positions, # Initial positions.
# Update positions of the cells.
for inst_id, (x, y) in global_positions.items():
trans = db.Trans(int(x), int(y))
if inst_id in design.cell_instances_by_subcircuit_id:
design.cell_instances_by_subcircuit_id[inst_id].trans = trans'Global placement done.')</text>