- generate .model lines in spice netlist for all device types that need
one
- add "level=<n>" to .model line for non-default model levels. This is
necessary to allow more sophisticated models to be used, and some
devices *always* need a level specified (e.g. JFETs)
- add "version=<n>" to .model line for models that have multiple
versions available (AFAIK only affects HiSIM_HV MOSFET models)
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/13775
1) Reduce API surface.
2) Prefer for(int) loops when what we're looking for is the index of
the item to be found
3) Move "_" escape processing to SIM_MODEL_NGSPICE (which is the only
model which uses the escape mechanism)
Don't serialize parameters in certain models for default values. Infer
models from Value field for some kinds of models. Resolve synonyms when
loading models from Spice libraries.
Rewrite the spice exporter to work with the new simulation model
architecture and data model, with many bugfixes related to the latter
two along the way.
Implement parsing and loading Spice libraries into KiCad. This is done
without any involvement of Ngspice -- we create our own in-tree parser
using PEGTL -- because Ngspice doesn't offer any intermediate output we
could plug ourselves into. We don't parse everything -- just the library
content, so this won't be that much effort.
We implement some basic Spice code preview to give the user a hint what
Spice code eir model will correspond to.
Implemented serialization and deserialization of models in symbol fields
through the SIM_VALUE class. We don't carry the Spice legacy of
case-insensitive suffixes, instead we conform to the SI standard (i.e. M
is Mega, not milli, P is peta, p is pico).
Parameter grid value validation is implemented by simply not allowing
any characters that will make the value invalid (instead of highlighting
the field in a red color). This will likely be changed at some point in
the future.
This commit adds parameter display functionality, via a wxPropertyGrid
widget, to the Sim Model Editor. To faciliate that, a SIM_VALUE class is
created to serialize, deserialize, and validate numeric values in the
new parameter grid.
SPICE_MODEL is renamed to SIM_MODEL and split into several subclasses
that correspond to different model kinds.