Extract circuit topology
The DUT netlist is reduced to the device and node information required to formulate topology-dependent equations and gm/Id constraints.
Modeling example · archived results
This example documents nine iterations of analytical model refinement for a five-transistor OTA. Model predictions are compared with HSPICE measurements at each iteration, and the converged scalar model is converted to a vectorized evaluator.
Modeling procedure
The driver normally writes to 5t_ota/. This snapshot is stored as 5t_ota_example_run/ so publishing it does not confuse it with a live workspace. The driver deletes an existing WORK_DIR before every run.
The DUT netlist is reduced to the device and node information required to formulate topology-dependent equations and gm/Id constraints.
Each iteration produces a structured set of performance equations. The equations are recorded and compiled into an executable Python model.
The scalar model and gm/Id lookup table generate device dimensions and the iteration's .1 prediction report.
The selected device parameters are applied to the testbenches. Extracted measurements are stored in the corresponding HSPICE report.
HSPICE operating-point parameters are supplied to the analytical equations to produce the model values used in the comparison.
Model predictions are compared with HSPICE measurements. Equations exceeding the tolerance are revised in the next iteration; iteration 9 meets the convergence criterion.
Archived data structure
Each directory in the published snapshot has a local README. The table below shows its place in the dataflow.
netlist/The compact six-transistor DUT used by initial and feedback prompt generation.
Directory guidespecs/Topology analysis, primitive groups, current budget, and device guidance consumed by the sizer.
Directory guideprompts/The gm/Id, initial-equation, error-correction, and vectorization instructions. The iteration N prompt produces the iteration N response.
Directory guidellm_outputs/Nine structured responses plus the iteration-9 vectorization response; these compile into executable models.
Directory guideota_models/Nine scalar candidates and the final vectorized evaluator. Earlier stages remain useful for auditing.
Directory guideota_model_performance/The model values produced during sizing and operating-point verification.
Directory guidespice_performance/Nine HSPICE characterization summaries used for the Model vs HSPICE comparison.
Directory guidetestbenches/The full DUT, universal measurement decks, baseline and updated parameters, wrapper, and run workspace.
Directory guide__pycache__/Python bytecode only. It affects import speed, not equations, sizing, simulation, or convergence.
Directory guideIteration by iteration
Each cell below is the absolute relative error between the analytical model and HSPICE for that metric and iteration. Green cells pass the 5% accuracy limit; red cells fail it. DC gain remains at 1.46% because it passed in Iteration 1 and the refinement flow preserves equations that already pass while correcting only failed metrics.
| Metric | Iteration 1 | Iteration 2 | Iteration 3 | Iteration 4 | Iteration 5 | Iteration 6 | Iteration 7 | Iteration 8 | Iteration 9 |
|---|---|---|---|---|---|---|---|---|---|
| DC gain | 1.46% | 1.46% | 1.46% | 1.46% | 1.46% | 1.46% | 1.46% | 1.46% | 1.46% |
| 3 dB bandwidth | 4.85% | 4.85% | 4.85% | 4.85% | 4.85% | 4.85% | 4.85% | 4.85% | 4.85% |
| UGB | 1.53% | 1.53% | 1.53% | 1.53% | 1.53% | 1.53% | 1.53% | 1.53% | 1.53% |
| Phase margin | 0.25% | 0.01% | 0.01% | 0.01% | 0.01% | 0.01% | 0.01% | 0.01% | 0.01% |
| ICMR min | 6.74% | 11.62% | 6.02% | 5.15% | 2.86% | 2.86% | 2.86% | 2.86% | 2.86% |
| ICMR max | 4.37% | 4.37% | 4.37% | 4.37% | 4.37% | 4.37% | 4.37% | 4.37% | 4.37% |
| Output swing min | 141.34% | 3.73% | 3.73% | 3.73% | 3.73% | 3.73% | 3.73% | 3.73% | 3.73% |
| Output swing max | 8.08% | 8.08% | 8.08% | 8.08% | 8.08% | 8.08% | 1.62% | 1.62% | 1.62% |
| Positive slew | 37.59% | 24.82% | 17.71% | 21.89% | 18.91% | 17.73% | 44.70% | 21.89% | 0.72% |
| Negative slew | 32.90% | 101.30% | 32.90% | 4.12% | 4.12% | 4.12% | 4.12% | 4.12% | 4.12% |
| PSRR+ | 15.21% | 10.57% | 8.40% | 9.33% | 5.88% | 1.75% | 1.75% | 1.75% | 1.75% |
| PSRR− | 15.14% | 3.71% | 3.71% | 3.71% | 3.71% | 3.71% | 3.71% | 3.71% | 3.71% |
| CMRR | 63.43% | 16.45% | 19.12% | 5.62% | 57.62% | 10.40% | 5.62% | 3.12% | 3.12% |
Correct (5): DC gain, bandwidth, UGB, phase margin, ICMR max.
Needs work (8): ICMR min, both output swings, both slew rates, PSRR+, PSRR−, CMRR.
Largest error: output swing min, 141.3%. The next model corrects output swing and the large CMRR/slew mismatches.
Correct (7): DC gain, bandwidth, UGB, phase margin, ICMR max, output swing min, PSRR−.
Needs work (6): ICMR min, output swing max, both slew rates, PSRR+, CMRR.
Output swing min is fixed. Negative slew is now the largest error at 101.3%, so slew modeling becomes the main target.
Full Iteration 3 comparison: prompt_stage4.txt (feedback used to create Iteration 4).
Correct (7): DC gain, bandwidth, UGB, phase margin, ICMR max, output swing min, PSRR−.
Needs work (6): ICMR min, output swing max, both slew rates, PSRR+, CMRR.
The gain model is already accurate. This revision targets slew: modeled negative slew is 7.723 V/µs versus 11.510 V/µs in HSPICE, so its error falls from 101.3% to 32.9%. The same six specs still miss the limit.
Correct (8): DC gain, bandwidth, UGB, phase margin, ICMR max, output swing min, negative slew, PSRR−.
Needs work (5): ICMR min, output swing max, positive slew, PSRR+, CMRR.
Negative slew passes. Positive slew is the largest remaining error at 21.9%.
Correct (9): DC gain, bandwidth, UGB, phase margin, both ICMR limits, output swing min, negative slew, PSRR−.
Needs work (4): output swing max, positive slew, PSRR+, CMRR.
ICMR min passes, but the CMRR change overshoots to 57.6% error. The next iteration repairs CMRR without losing the nine correct specs.
Correct (10): DC gain, bandwidth, UGB, phase margin, both ICMR limits, output swing min, negative slew, PSRR+, PSRR−.
Needs work (3): output swing max, positive slew, CMRR.
CMRR error drops to 10.4% and PSRR+ passes. Positive slew remains worst at 17.7%.
Correct (11): all specs except positive slew and CMRR.
Needs work (2): positive slew and CMRR.
Output swing max passes. CMRR is close at 5.6%, while positive slew regresses to 44.7%.
Correct (12): all specs except positive slew.
Needs work (1): positive slew, 21.9% error.
CMRR now passes. The final refinement is isolated to the positive-slew equation.
Correct (13 of 13): DC gain, bandwidth, UGB, phase margin, both ICMR limits, both output swings, both slew rates, PSRR+, PSRR−, and CMRR.
Needs work: none.
The largest remaining difference is only 4.9% (3 dB bandwidth), below the 5% limit. The scalar model is accepted and vectorized.
Final result
Iteration 9 brings all 13 modeled specs within the 5% error limit. The complete comparison is shown below.
Iteration 9 comparison
Percent differences use the HSPICE magnitude as the reference.
Reproduce and extend
# The configured driver creates and owns 5t_ota/
bash llm_aided_modelling.sh
# Compare the fresh workspace with the preserved example
diff -ru 5t_ota_example_run 5t_otaA byte-for-byte match is not expected: LLM responses, timestamps, simulator products, and optimization results can vary. Compare schemas, stage lineage, convergence behavior, and performance trends. A real run also requires API configuration, HSPICE on PATH, and accessible foundry models.