-
Couldn't load subscription status.
- Fork 13
Description
I think that the Ngspice netlister has some errors for DC analysis.
The param value is created but not used in (because of missing brackets).
Vlsir/VlsirTools/vlsirtools/netlist/spice.py
Lines 631 to 638 in 3515c43
| param = an.indep_name | |
| ## Interpret the sweep | |
| sweep_type = an.sweep.WhichOneof("tp") | |
| if sweep_type == "linear": | |
| sweep = an.sweep.linear | |
| line = ( | |
| f".dc param start={sweep.start} stop={sweep.stop} step={sweep.step}\n\n" | |
| ) |
I was able to get the simulation to run by updating the line to:
line = (
f".dc {param} {sweep.start} {sweep.stop} {sweep.step}\n\n"
)
Because I believe Ngspice does not use the start,step, and stop keywords.
I also had issues afterwords with the reading of the results:
File "/ic_tools/miniconda3/envs/Grimoire/lib/python3.10/site-packages/vlsirtools/spice/ngspice.py", line 119, in parse_results
raise RuntimeError(msg)
RuntimeError: Cannot read results for analysis dc {
analysis_name: "op"
indep_name: "v.xtop.vvdc"
sweep {
linear {
stop: 1
step: 2
}
}
}
It cannot find the following dc enum value in the data:
Vlsir/VlsirTools/vlsirtools/spice/ngspice.py
Lines 95 to 101 in 3515c43
| an_name_dispatch = dict( | |
| op="Plotname: Operating Point\n", | |
| dc="Plotname: DC Analysis\n", | |
| ac="Plotname: AC Analysis\n", | |
| tran="Plotname: Transient Analysis\n", | |
| noise="FIXME! do we still want this setup?", | |
| ) |
Vlsir/VlsirTools/vlsirtools/spice/ngspice.py
Line 117 in 3515c43
| if analysis_name not in data: |
I plan to finish debugging the data output.
Here is my DC testcase that I based on the existing mos test:
https://github.com/Jetsama/VLSI_Grimoire/blob/48ff1236e710a27c04ce9a3bf745fdc536ebaeae/MOS/hdl21_test.py