Designer — Models¶
Data models for the Designer module (Layer 4).
Plain dataclasses — they carry no logic and serialize straight into the
report.json the designer writes next to the exported netlists.
- class circuitgenome.designer.models.DesignSolution(name, topology, variants, metrics, margins, worst_margin, netlist_path, notes=<factory>)[source]¶
Bases:
objectOne accepted design: a synthesized circuit whose sized, SPICE-measured performance meets every measurable spec.
- Parameters:
name (str) – enumeration name (
circuit_0007), matching the index the synthesizer CLI would assign, so solutions cross-referencecg synthesizeoutput.topology (str) – the
TopologyTemplatename.variants (dict[str, str]) – slot name → chosen module-variant name.
metrics (dict[str, float | None]) – ngspice-measured metrics (
gain_db,gbw_hz,phase_margin_deg,slew_rate_vps,power_w,cmrr_db,psrr_db,output_swing_max_v,output_swing_min_v);Nonewhen a measurement could not be extracted.margins (dict[str, float]) – normalized margin per constrained+measured spec (
(meas − min)/minfor min-specs,(max − meas)/maxfor max-specs); every value is ≥ 0 by construction.worst_margin (float) – the smallest margin (
infwhen no measured spec constrains this design) — the robustness ranking key.netlist_path (str) – the sized flat SPICE netlist written for this design.
notes (list[str]) – advisory lines from the measurement rig (e.g. why an unconstrained metric could not be extracted).
- class circuitgenome.designer.models.TemplateStats(template, enumerated=0, sizing_failed=0, bias_infeasible=0, spec_failed=0, unverified=0, errors=0, accepted=0, runtime_s=0.0, rejection_reasons=<factory>)[source]¶
Bases:
objectCounts for one template’s enumerate→size→verify run.
enumeratedcounts the candidates actually evaluated (afterlimit); the rejection counters partitionenumerated − acceptedby the pipeline stage that rejected the circuit.rejection_reasonshistograms the per-candidate rejection details (numerals collapsed to#so identical failure classes aggregate), ordered most-common first.- Parameters:
- class circuitgenome.designer.models.DesignReport(spec, tech, solutions=<factory>, stats=<factory>, best_points=<factory>, unverified_specs=<factory>, runtime_s=0.0)[source]¶
Bases:
objectOutput of
design().- Parameters:
spec (dict) – echo of the target
SizingSpecfields.tech (str) – technology name the run sized and simulated against.
solutions (list[DesignSolution]) – every accepted design, in enumeration order.
stats (dict[str, TemplateStats]) – per-template counters, keyed by topology name.
best_points (dict[str, DesignSolution]) – criterion → the winning solution among
solutions(highest_gain,highest_gbw,highest_phase_margin,lowest_power,most_robust).unverified_specs (list[str]) – constrained spec fields whose measurement came back
Nonefor at least one candidate (e.g. swing/slew on fully-differential topologies) — such candidates are rejected asunverified; acceptance requires every constrained spec to be SPICE-measured and met.runtime_s (float) – wall-clock time for the whole run.
- solutions: list[DesignSolution]¶
- stats: dict[str, TemplateStats]¶
- best_points: dict[str, DesignSolution]¶