Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ export class SingleInnerPartitionPackingSolver extends BaseSolver {
}

override _step() {
// Decoupling cap partitions: place all caps in a neat single column
if (this.partitionInputProblem.partitionType === "decoupling_caps") {
this.layout = this.createDecouplingCapColumnLayout()
this.solved = true
return
}

// Initialize PackSolver2 if not already created
if (!this.activeSubSolver) {
const pinToNetworkMap = createFilteredNetworkMapping({
Expand Down Expand Up @@ -66,6 +73,33 @@ export class SingleInnerPartitionPackingSolver extends BaseSolver {
}
}

private createDecouplingCapColumnLayout(): OutputLayout {
const gap =
this.partitionInputProblem.decouplingCapsGap ??
this.partitionInputProblem.chipGap
const chips = Object.entries(this.partitionInputProblem.chipMap).sort(
([a], [b]) => a.localeCompare(b),
)

const chipPlacements: Record<string, Placement> = {}
let y = 0
for (const [chipId, chip] of chips) {
chipPlacements[chipId] = {
x: 0,
y,
ccwRotationDegrees: chip.availableRotations?.[0] ?? 0,
}
y += chip.size.y + gap
}

const totalHeight = y - gap
for (const id of Object.keys(chipPlacements)) {
chipPlacements[id]!.y -= totalHeight / 2
}

return { chipPlacements, groupPlacements: {} }
}

private createPackInput(pinToNetworkMap: Map<PinId, string>): PackInput {
const packComponents = Object.entries(
this.partitionInputProblem.chipMap,
Expand Down
Loading
Loading