Run ImpedenceFinder Z0 on routed signal nets during project analysis.
Pipeline samples PCB traces when stackup εr/h is present; power/ground are skipped. Named nets can be re-analyzed from the Impedance tab. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import type {
|
||||
DesignGraph,
|
||||
DeratingRow,
|
||||
ImpedanceKind,
|
||||
ImpedanceNetsReport,
|
||||
ImpedanceStackupResult,
|
||||
ImpedanceTraceResult,
|
||||
EdifSubDesign,
|
||||
@@ -609,6 +610,43 @@ export async function computeImpedance(body: {
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function fetchImpedanceNets(
|
||||
projectId: string,
|
||||
): Promise<ImpedanceNetsReport> {
|
||||
const res = await authFetch(
|
||||
`${BASE}/api/projects/${projectId}/impedance/nets`,
|
||||
);
|
||||
if (!res.ok) {
|
||||
const detail = await res.json().catch(() => ({ detail: res.statusText }));
|
||||
throw new Error(
|
||||
typeof detail.detail === "string" ? detail.detail : "Impedance nets failed",
|
||||
);
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function analyzeImpedanceNets(
|
||||
projectId: string,
|
||||
nets: string[],
|
||||
pitch_mm?: number,
|
||||
): Promise<ImpedanceNetsReport> {
|
||||
const res = await authFetch(
|
||||
`${BASE}/api/projects/${projectId}/impedance/nets`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ nets, pitch_mm }),
|
||||
},
|
||||
);
|
||||
if (!res.ok) {
|
||||
const detail = await res.json().catch(() => ({ detail: res.statusText }));
|
||||
throw new Error(
|
||||
typeof detail.detail === "string" ? detail.detail : "Impedance nets failed",
|
||||
);
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export async function fetchReport(
|
||||
projectId: string,
|
||||
): Promise<ValidationReport> {
|
||||
|
||||
@@ -364,6 +364,27 @@ export interface ImpedanceStackupResult {
|
||||
kicad_dru: string;
|
||||
}
|
||||
|
||||
export interface ImpedanceNetRow {
|
||||
net_name: string;
|
||||
length_mm?: number;
|
||||
branch_count?: number;
|
||||
is_differential?: boolean;
|
||||
partner_net_name?: string | null;
|
||||
topologies?: string[];
|
||||
z0_min_ohms?: number | null;
|
||||
z0_max_ohms?: number | null;
|
||||
z0_avg_ohms?: number | null;
|
||||
flags?: string[];
|
||||
sample_count?: number;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface ImpedanceNetsReport {
|
||||
pitch_mm: number;
|
||||
nets: ImpedanceNetRow[];
|
||||
skipped: string | null;
|
||||
}
|
||||
|
||||
export interface NetlistPreviewDesignator {
|
||||
ref: string;
|
||||
pins: { number: string; net_name: string }[];
|
||||
|
||||
Reference in New Issue
Block a user