From 4182cdffb984d3908f67ad5a52a224aadd5e17d3 Mon Sep 17 00:00:00 2001 From: mohan-bee Date: Fri, 31 Jul 2026 04:51:39 +0530 Subject: [PATCH] add simple RC chain repro --- tests/assets/repro-simple-rc-chain.input.json | 148 ++++++++++++++++++ .../repro-simple-rc-chain.snap.svg | 44 ++++++ tests/repros/repro-simple-rc-chain.test.ts | 11 ++ 3 files changed, 203 insertions(+) create mode 100644 tests/assets/repro-simple-rc-chain.input.json create mode 100644 tests/repros/__snapshots__/repro-simple-rc-chain.snap.svg create mode 100644 tests/repros/repro-simple-rc-chain.test.ts diff --git a/tests/assets/repro-simple-rc-chain.input.json b/tests/assets/repro-simple-rc-chain.input.json new file mode 100644 index 0000000..98cc384 --- /dev/null +++ b/tests/assets/repro-simple-rc-chain.input.json @@ -0,0 +1,148 @@ +{ + "chipMap": { + "R1": { + "chipId": "R1", + "pins": ["R1.1", "R1.2"], + "size": { + "x": 1.1, + "y": 0.388910699999999 + }, + "availableRotations": [0, 90, 180, 270] + }, + "C1": { + "chipId": "C1", + "pins": ["C1.1", "C1.2"], + "size": { + "x": 1.1, + "y": 0.84 + }, + "availableRotations": [270] + }, + "U1": { + "chipId": "U1", + "pins": ["U1.1", "U1.2", "U1.3", "U1.4", "U1.5", "U1.6", "U1.7", "U1.8"], + "size": { + "x": 1.6, + "y": 1.7999999999999998 + }, + "availableRotations": [0] + } + }, + "chipPinMap": { + "R1.1": { + "pinId": "R1.1", + "offset": { + "x": -0.55, + "y": 0 + }, + "side": "x-" + }, + "R1.2": { + "pinId": "R1.2", + "offset": { + "x": 0.55, + "y": 0 + }, + "side": "x+" + }, + "C1.1": { + "pinId": "C1.1", + "offset": { + "x": -0.55, + "y": 0 + }, + "side": "x-" + }, + "C1.2": { + "pinId": "C1.2", + "offset": { + "x": 0.55, + "y": 0 + }, + "side": "x+" + }, + "U1.1": { + "pinId": "U1.1", + "offset": { + "x": -1.2000000000000002, + "y": 0.30000000000000004 + }, + "side": "x-" + }, + "U1.2": { + "pinId": "U1.2", + "offset": { + "x": -1.2000000000000002, + "y": 0.10000000000000003 + }, + "side": "x-" + }, + "U1.3": { + "pinId": "U1.3", + "offset": { + "x": -1.2000000000000002, + "y": -0.09999999999999998 + }, + "side": "x-" + }, + "U1.4": { + "pinId": "U1.4", + "offset": { + "x": -1.2000000000000002, + "y": -0.30000000000000004 + }, + "side": "x-" + }, + "U1.5": { + "pinId": "U1.5", + "offset": { + "x": 1.2000000000000002, + "y": -0.30000000000000004 + }, + "side": "x+" + }, + "U1.6": { + "pinId": "U1.6", + "offset": { + "x": 1.2000000000000002, + "y": -0.10000000000000003 + }, + "side": "x+" + }, + "U1.7": { + "pinId": "U1.7", + "offset": { + "x": 1.2000000000000002, + "y": 0.09999999999999998 + }, + "side": "x+" + }, + "U1.8": { + "pinId": "U1.8", + "offset": { + "x": 1.2000000000000002, + "y": 0.30000000000000004 + }, + "side": "x+" + } + }, + "netMap": { + "unnamedsubcircuitsubcircuit_source_group_0_connectivity_net2": { + "netId": "unnamedsubcircuitsubcircuit_source_group_0_connectivity_net2", + "isGround": true, + "isPositiveVoltageSource": false + } + }, + "pinStrongConnMap": { + "U1.2-R1.1": true, + "R1.1-U1.2": true, + "R1.2-C1.1": true, + "C1.1-R1.2": true + }, + "netConnMap": { + "C1.2-unnamedsubcircuitsubcircuit_source_group_0_connectivity_net2": true + }, + "chipGap": 0.6, + "decouplingCapsGap": 0.4, + "partitionGap": 1.2 +} diff --git a/tests/repros/__snapshots__/repro-simple-rc-chain.snap.svg b/tests/repros/__snapshots__/repro-simple-rc-chain.snap.svg new file mode 100644 index 0000000..f08c687 --- /dev/null +++ b/tests/repros/__snapshots__/repro-simple-rc-chain.snap.svg @@ -0,0 +1,44 @@ +R1C1U1 \ No newline at end of file diff --git a/tests/repros/repro-simple-rc-chain.test.ts b/tests/repros/repro-simple-rc-chain.test.ts new file mode 100644 index 0000000..2770085 --- /dev/null +++ b/tests/repros/repro-simple-rc-chain.test.ts @@ -0,0 +1,11 @@ +import { expect, test } from "bun:test" +import { LayoutPipelineSolver } from "../../lib/solvers/LayoutPipelineSolver/LayoutPipelineSolver" +import type { InputProblem } from "../../lib/types/InputProblem" +import input from "../assets/repro-simple-rc-chain.input.json" + +test("simple RC chain", async () => { + const solver = new LayoutPipelineSolver(input as InputProblem) + solver.solve() + + await expect(solver).toMatchSolverSnapshot(import.meta.path) +})