207 Commits

Author SHA1 Message Date
Jeff Young
c5bb59468d Get rid of assumptions about field order. 2025-02-24 11:08:29 +00:00
Seth Hillbrand
157c7422b0 Allow sim models to reference embedded files
Fixes https://gitlab.com/kicad/code/kicad/-/issues/20024
2025-02-22 14:53:59 -08:00
Jeff Young
5edae8250d Finish eradication of visibility flag on text items.
Import/read previously-hidden symbol/footprint
text items as hidden fields.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19875
2025-02-19 23:43:52 +00:00
Jeff Young
e19bce2f93 Reduce reliance on MANDATORY_FIELDS and their implied order. 2025-01-22 17:51:57 +00:00
Jeff Young
a0dd0485e9 Pull a little harder on the MANDATORY_FIELDs string.
We still conflate the fieldID, the position in the
array of fields, and whether or not that means the
field is mandatory.  But this attempts to clean up
*some* of that, without introducing too much risk.
2025-01-21 16:48:13 +00:00
Jeff Young
d50b69f1ae Reconcile divergence of MANDATORY_FIELDS between symbols and footprints.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19697
2025-01-21 13:28:28 +00:00
JamesJCode
bf17300949 Ensure newly added Sim.* fields are not visible
Existing fields will retain their current visibility settings

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19466
2025-01-02 21:13:48 +00:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Jeff Young
7da8b42206 Push more functionality to SYMBOL.
(This will allow us to run the fields autoplacer on SYMBOLs,
including LIB_SYMBOLs.)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19247
2024-12-22 20:21:24 +00:00
John Beard
3d6d8b9946 Strip richio.h from headers that don't need them
Like the DSNLEXER header, this has visibility in over 700
files, whereas well under half actually use any of it
(quite a bit, but not all, of it actually via DSNLEXER)

Many places already forward-declare the OUTPUTFORMATTER type,
by doing that for the others, it still possible to use the
non-IO methods without having to see richio.h.
2024-10-04 18:06:18 +01:00
Seth Hillbrand
e01246a9d3 Limit where type overrides can happen
IBIS requires the ability to override types but this is explicitly
forbidden to SPICE subcircuits.
2024-09-10 15:55:56 -07:00
Seth Hillbrand
b175c0fc39 Handle field types missing
If we do not have both a device and type for the sim model, return none
because we cannot parse it.  This is handled by the calling routines.
Otherwise, we would return raw spice type erroneously.

(cherry picked from commit 76e50881fb933a6d06b1e63a46e7e7980db08fa5)
2024-09-10 12:26:30 -07:00
Jeff Young
a573ecc20e Try plainNumber detection without regEx. 2024-09-05 14:54:46 +01:00
Jeff Young
58954afc41 Fix dumb-ass error in regex. 2024-09-05 12:01:27 +01:00
Jeff Young
8178469182 Fix slightly over-zealous optimisation.
(Also prunes double-matching against plainNumber regex.)
2024-09-05 10:42:56 +01:00
Alex Shvartzkop
36019314e9 Make simulation reporter warnings non-fatal.
Adds REPORTER::HasMessageOfSeverity for WX_STRING_REPORTER,
which allows us to show simulation warnings and fail only if there's errors.

Also fixes a crash when SPICE_GENERATOR_KIBIS throws an IO_ERROR.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18143
2024-09-05 05:59:35 +03:00
Jeff Young
c7859e7ed7 Clean up (and better comment) referential model handling. 2024-09-02 09:50:31 +01:00
Jeff Young
33efd9e0ef Revert single parsing because we use different parsers
for different model types.

Alos fix AKO & SUBCKT model handling, which can't be done
in parallel because they refer to other models.
2024-09-01 10:56:05 +01:00
Jeff Young
1959bacf08 Performance.
Don't parse PEGTL twice, once for modelType and once for
model itself.

Also don't do O(n^2) searches on parameter names when
reading libraries.

And, because it's still too slow, multi-thread it.
2024-08-31 18:51:28 +01:00
Jeff Young
c22eac2fbf Performance.
Saves about 30% of the time to open the sim model
dialog.  Pretty much all the remaining time is in PEGTL,
and that's even with short-circuiting it for most param
values.
2024-08-30 22:49:29 +01:00
Jeff Young
9fcbd4e6d0 Slight reduction in asserts. 2024-07-18 18:01:05 +01:00
Jeff Young
0f8d543172 Consistent capitalization. 2024-06-14 22:02:08 +01:00
Jeff Young
4e133ae83b Cleanup. 2024-06-10 20:23:36 +01:00
Jeff Young
29360b1aef Raw spice models don't have pin names. 2024-05-10 20:58:13 +01:00
Jeff Young
d9f0c8e1f3 Remove accidentally committed lines. 2024-05-10 15:58:48 +01:00
Jeff Young
a20a6e0787 Don't add duplicate SIM fields.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17970
2024-05-10 11:35:49 +01:00
Jeff Young
95136494b3 RIP LIB_PIN. 2024-04-20 12:10:31 +01:00
Jeff Young
d77eae3e7e Collapse LIB_FIELD into SCH_FIELD. 2024-04-13 15:42:13 +01:00
Jeff Young
73f94175de Formatting. 2024-03-11 17:46:09 +00:00
Jeff Young
9281561938 Fix include paths and merge conflicts. 2024-03-11 12:11:00 +00:00
Michal Grzegorzek
25abba7432 Add XSPICE node/port modifiers: %d [ ~ ] etc. 2024-03-11 12:03:37 +00:00
Alex Shvartzkop
cb25c8620e Performance optimizations for database libraries.
(cherry picked from commit e68df8e1d1261547fe14222386e518a2b77282d5)
2024-02-23 20:29:18 +03:00
Jeff Young
340d1b7fad Guard against nullptr access. 2024-01-25 15:30:25 +00:00
Jeff Young
1bd8da41a7 Mutual Inductor isn't an inductor.
It's a statement about two other inductors.
2024-01-23 15:07:29 +00:00
Jeff Young
7c5eaed69e Un-comment and repair TRRANDOM sources.
Also adds new parameters to AM sources for ngspice-43.

Also fixes a bug in the spice parameter parser (which would
puke on any parameter name starting with one of the flag
parameter strings).

Also fixes a bug where the skipped source parameters would
get set to "0" instead of their default values.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16393
2024-01-06 20:34:36 +00:00
Jeff Young
bbdefa05eb Un-comment and repair AM and SFFM sources.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16529
2024-01-06 14:49:05 +00:00
Jeff Young
47e07f507e nullptr safety
(Can't actually happen as the 4 base fields are mandatory,
but it'll keep Coverity happy.)
2023-12-18 17:01:55 +00:00
Jeff Young
196e05bc51 Borrow parts of simulator's separator-detection algorithm.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15248
2023-11-20 13:47:24 +00:00
Jeff Young
7a2a2e2df0 Remove error-prone SetReporter() API. 2023-09-06 11:37:50 +01:00
Jeff Young
30a6d33177 Better fix for primary param in value field with other params in params field.
(Replaces 2c8178829982c6e15e443b5a7868b8c953d5126f.)
2023-08-30 00:53:01 +01:00
Mike Williams
bdecdce1b4 Exclude from Sim: move from field to attribute 2023-08-08 12:36:36 -04:00
jean-pierre charras
3a82374719 sim/sim_model: fix an annoying issue when adding new fields: their ID was
set in undefined, that create an issue (the canonical name was returned as
"Field-1", breaking the schematic file).
Now, new field IDs are not set to -1, and the saved file uses the field name
(if exist) when saving fields with undefined ID.
2023-08-01 13:37:53 +02:00
Jeff Young
30c2049977 Handle inference of V7 symbol lib DC voltage/current sources.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15127
2023-07-07 16:25:05 +01:00
Jeff Young
80340c607c ADDED noise simulation GUI. 2023-07-03 16:26:20 +01:00
Jeff Young
7138e8a62e Don't double-create pins when migrating old models. 2023-06-21 16:34:35 +01:00
Jeff Young
03486443c7 Fix more SPICE case-insensitivity bugs.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793
2023-05-22 11:46:28 +01:00
Mark Visser
0d235ac64b fix bug whereby spice params with capital letters no longer cause an error and data loss
Spice parameters were converted to lower-case before comparison. This is incorrect, as it
is legal and common for spice parameters to contain capital letters (e.g. potentiometers
typically use Rt and SET as their parameters).
Spice parameters are not case sensitive, so the correct behaviour is to instead do a
case-insensitive comparison on the parameter name.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14793
2023-05-21 17:50:35 -04:00
Jeff Young
58f4943597 ADDED voltage- & current-controlled voltage & current sources
Added GUI support for ngspice VCVS, VCCS, CCVS and CCCS.
2023-05-20 21:04:39 +01:00
Jeff Young
b41d446f58 Fix a bunch more issues with sheetpaths and allowExtraText.
A sheetpath is required to correctly resolve text variables.
Depending on currentSheet is rife with bugs.

There are many places where we do *not* want to be prepending
field names to the field values, such as netlisting,
building PDF hypertext menus, etc.

Also, Find/Replace needs to work on unresolved text, as
that's what we're going to display (and if replace nuked
your variable references you wouldn't be happy).
2023-05-05 17:23:52 +01:00
Jeff Young
60b019591d Simulator fixes.
1) Don't read libraries multiple times
2) VDMOS default is nchan if not specified
3) In the absence of a workbook default to LTSpice compatability
4) Don't attempt to write out a model line for a subckt; it never has
a baseModel
2023-04-24 13:52:52 +01:00