Try to fix Ngspice QA by resampling and cutting off value digits

`linearize` command resamples the data. Fourth and further digits from
decimal point are cut off by using `wrdata` command instead of `write`.
Oddly, "sources" unit test is not working (so it's still uncommented) --
some substantially different values are generated when generating the
reference with standalone Ngspice.
This commit is contained in:
Mikolaj Wielgus 2022-08-03 14:19:28 +02:00
parent 96f01d33c8
commit 37209bb496
17 changed files with 54066 additions and 830185 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
.title KiCad schematic .title KiCad schematic
.include "cmos.lib.spice" .include "cmos_not.lib.spice"
.model nmos nmos( .model nmos nmos(
+ vto=500m kp=36u gamma=900m pb=950m + vto=500m kp=36u gamma=900m pb=950m
+ cgso=200p cgdo=200p cj=450u cjsw=215p tox=50n ld=300n ) + cgso=200p cgdo=200p cj=450u cjsw=215p tox=50n ld=300n )

File diff suppressed because it is too large Load Diff

View File

@ -1,193 +1,62 @@
Title: KiCad schematic frequency v(/lowpass) v(/lowpass)
Date: Sat Jul 9 14:52:19 2022 1.000e+00 1.000e+00 -1.257e-03
Plotname: AC Analysis 1.259e+00 1.000e+00 -1.582e-03
Flags: complex 1.585e+00 1.000e+00 -1.992e-03
No. Variables: 2 1.995e+00 1.000e+00 -2.507e-03
No. Points: 61 2.512e+00 1.000e+00 -3.157e-03
Variables: 3.162e+00 1.000e+00 -3.974e-03
0 frequency frequency grid=3 3.981e+00 1.000e+00 -5.003e-03
1 v(/lowpass) voltage 5.012e+00 1.000e+00 -6.298e-03
Values: 6.310e+00 9.999e-01 -7.929e-03
0 1.000000000000000e+00,0.000000000000000e+00 7.943e+00 9.999e-01 -9.981e-03
9.999821327264018e-01,-1.256639837651397e-03 1.000e+01 9.999e-01 -1.257e-02
1.259e+01 9.998e-01 -1.582e-02
1 1.258925411794167e+00,0.000000000000000e+00 1.585e+01 9.997e-01 -1.991e-02
9.999814399975895e-01,-1.582015094491011e-03 1.995e+01 9.995e-01 -2.507e-02
2.512e+01 9.992e-01 -3.155e-02
2 1.584893192461114e+00,0.000000000000000e+00 3.162e+01 9.988e-01 -3.971e-02
9.999803420975024e-01,-1.991637546556900e-03 3.981e+01 9.981e-01 -4.997e-02
5.012e+01 9.970e-01 -6.286e-02
3 1.995262314968880e+00,0.000000000000000e+00 6.310e+01 9.953e-01 -7.904e-02
9.999786020458721e-01,-2.507320209874727e-03 7.943e+01 9.925e-01 -9.932e-02
1.000e+02 9.882e-01 -1.247e-01
4 2.511886431509581e+00,0.000000000000000e+00 1.259e+02 9.814e-01 -1.562e-01
9.999758442567773e-01,-3.156523324371035e-03 1.585e+02 9.707e-01 -1.953e-01
1.995e+02 9.540e-01 -2.430e-01
5 3.162277660168380e+00,0.000000000000000e+00 2.512e+02 9.283e-01 -3.005e-01
9.999714734729277e-01,-3.973815846816723e-03 3.162e+02 8.889e-01 -3.678e-01
3.981e+02 8.303e-01 -4.431e-01
6 3.981071705534974e+00,0.000000000000000e+00 5.012e+02 7.456e-01 -5.213e-01
9.999645462908388e-01,-5.002714648026853e-03 6.310e+02 6.294e-01 -5.921e-01
7.943e+02 4.813e-01 -6.398e-01
7 5.011872336272725e+00,0.000000000000000e+00 1.000e+03 3.111e-01 -6.459e-01
9.999535675563084e-01,-6.297998501582684e-03 1.259e+03 1.416e-01 -5.986e-01
1.585e+03 2.083e-03 -5.021e-01
8 6.309573444801935e+00,0.000000000000000e+00 1.995e+03 -8.645e-02 -3.791e-01
9.999361677090162e-01,-7.928618383234581e-03 2.512e+03 -1.223e-01 -2.590e-01
3.162e+03 -1.204e-01 -1.623e-01
9 7.943282347242818e+00,0.000000000000000e+00 3.981e+03 -9.981e-02 -9.497e-02
9.999085914985462e-01,-9.981355655243315e-03 5.012e+03 -7.481e-02 -5.283e-02
6.310e+03 -5.265e-02 -2.836e-02
10 1.000000000000001e+01,0.000000000000000e+00 7.943e+03 -3.560e-02 -1.486e-02
9.998648878810480e-01,-1.256541614533464e-02 1.000e+04 -2.347e-02 -7.659e-03
1.259e+04 -1.522e-02 -3.906e-03
11 1.258925411794168e+01,0.000000000000000e+00 1.585e+04 -9.766e-03 -1.976e-03
9.997956266623522e-01,-1.581819120460387e-02 1.995e+04 -6.224e-03 -9.936e-04
2.512e+04 -3.948e-03 -4.956e-04
12 1.584893192461115e+01,0.000000000000000e+00 3.162e+04 -2.496e-03 -2.436e-04
9.996858659467851e-01,-1.991246548634702e-02 3.981e+04 -1.572e-03 -1.158e-04
5.012e+04 -9.870e-04 -5.014e-05
13 1.995262314968881e+01,0.000000000000000e+00 6.310e+04 -6.167e-04 -1.539e-05
9.995119343572447e-01,-2.506540134991636e-02 7.943e+04 -3.827e-04 4.367e-06
1.000e+05 -2.348e-04 1.725e-05
14 2.511886431509582e+01,0.000000000000000e+00 1.259e+05 -1.414e-04 2.748e-05
9.992363402264104e-01,-3.154967087041477e-02 1.585e+05 -8.246e-05 3.739e-05
1.995e+05 -4.525e-05 4.839e-05
15 3.162277660168382e+01,0.000000000000000e+00 2.512e+05 -2.174e-05 6.152e-05
9.987997258649952e-01,-3.970711430129006e-02 3.162e+05 -6.878e-06 7.770e-05
3.981e+05 2.550e-06 9.791e-05
16 3.981071705534977e+01,0.000000000000000e+00 5.012e+05 8.575e-06 1.233e-04
9.981081727574295e-01,-4.996522687501986e-02 6.310e+05 1.250e-05 1.552e-04
7.943e+05 1.517e-05 1.953e-04
17 5.011872336272729e+01,0.000000000000000e+00 1.000e+06 1.716e-05 2.459e-04
9.970132240259019e-01,-6.285650757303191e-02
18 6.309573444801940e+01,0.000000000000000e+00
9.952805783837332e-01,-7.904003000972226e-02
19 7.943282347242825e+01,0.000000000000000e+00
9.925413625728052e-01,-9.932309700439729e-02
20 1.000000000000001e+02,0.000000000000000e+00
9.882171147847175e-01,-1.246777155501021e-01
21 1.258925411794169e+02,0.000000000000000e+00
9.814063591128188e-01,-1.562404099208532e-01
22 1.584893192461116e+02,0.000000000000000e+00
9.707182316756220e-01,-1.952720689103021e-01
23 1.995262314968883e+02,0.000000000000000e+00
9.540411183220165e-01,-2.430333665191511e-01
24 2.511886431509584e+02,0.000000000000000e+00
9.282521246648185e-01,-3.004970200080216e-01
25 3.162277660168385e+02,0.000000000000000e+00
8.889291770784464e-01,-3.677729975271011e-01
26 3.981071705534980e+02,0.000000000000000e+00
8.302612199639399e-01,-4.430942926898474e-01
27 5.011872336272732e+02,0.000000000000000e+00
7.456016692398652e-01,-5.212954390415596e-01
28 6.309573444801945e+02,0.000000000000000e+00
6.294109522125436e-01,-5.921302438317938e-01
29 7.943282347242831e+02,0.000000000000000e+00
4.812546899527393e-01,-6.397614080166355e-01
30 1.000000000000002e+03,0.000000000000000e+00
3.110702520312468e-01,-6.459356165806209e-01
31 1.258925411794170e+03,0.000000000000000e+00
1.416037236240634e-01,-5.985787699243560e-01
32 1.584893192461117e+03,0.000000000000000e+00
2.083424544118806e-03,-5.020656524441667e-01
33 1.995262314968884e+03,0.000000000000000e+00
-8.645125782066965e-02,-3.790934701812748e-01
34 2.511886431509586e+03,0.000000000000000e+00
-1.223431281709580e-01,-2.589868688185197e-01
35 3.162277660168386e+03,0.000000000000000e+00
-1.204056324704392e-01,-1.622942291648999e-01
36 3.981071705534981e+03,0.000000000000000e+00
-9.980942412766491e-02,-9.497297972494526e-02
37 5.011872336272734e+03,0.000000000000000e+00
-7.480565270380091e-02,-5.283081641423451e-02
38 6.309573444801948e+03,0.000000000000000e+00
-5.264623534860169e-02,-2.835854400215732e-02
39 7.943282347242834e+03,0.000000000000000e+00
-3.559896176002031e-02,-1.485754709523146e-02
40 1.000000000000003e+04,0.000000000000000e+00
-2.346563667037593e-02,-7.659129844158452e-03
41 1.258925411794171e+04,0.000000000000000e+00
-1.521765887443810e-02,-3.905706683938401e-03
42 1.584893192461118e+04,0.000000000000000e+00
-9.765804412212753e-03,-1.976428026091312e-03
43 1.995262314968885e+04,0.000000000000000e+00
-6.224160150031799e-03,-9.936333226045757e-04
44 2.511886431509587e+04,0.000000000000000e+00
-3.948213122364652e-03,-4.955632539388813e-04
45 3.162277660168388e+04,0.000000000000000e+00
-2.495529993317536e-03,-2.435906637772503e-04
46 3.981071705534984e+04,0.000000000000000e+00
-1.572264301872017e-03,-1.157578845431204e-04
47 5.011872336272738e+04,0.000000000000000e+00
-9.870479279016076e-04,-5.014127236347213e-05
48 6.309573444801952e+04,0.000000000000000e+00
-6.167320992789826e-04,-1.539395644325342e-05
49 7.943282347242841e+04,0.000000000000000e+00
-3.826506306932043e-04,4.366695000337234e-06
50 1.000000000000003e+05,0.000000000000000e+00
-2.347823187662801e-04,1.724890476122870e-05
51 1.258925411794172e+05,0.000000000000000e+00
-1.414111998584433e-04,2.748235767389279e-05
52 1.584893192461119e+05,0.000000000000000e+00
-8.246335432027241e-05,3.739038895766121e-05
53 1.995262314968887e+05,0.000000000000000e+00
-4.524683853568412e-05,4.839268175510503e-05
54 2.511886431509589e+05,0.000000000000000e+00
-2.174118344072662e-05,6.152249161746164e-05
55 3.162277660168391e+05,0.000000000000000e+00
-6.877751288991707e-06,7.770336410859065e-05
56 3.981071705534988e+05,0.000000000000000e+00
2.549720949929224e-06,9.790956462151640e-05
57 5.011872336272742e+05,0.000000000000000e+00
8.575360575358015e-06,1.232738102518519e-04
58 6.309573444801958e+05,0.000000000000000e+00
1.249950093534791e-05,1.551757091425559e-04
59 7.943282347242847e+05,0.000000000000000e+00
1.516908229881597e-05,1.953295578596449e-04
60 1.000000000000004e+06,0.000000000000000e+00
1.716038472437953e-05,2.458832795395986e-04

Can't render this file because it has a wrong number of fields in line 11.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
{ {
"board": { "board": {
"3dviewports": [],
"design_settings": { "design_settings": {
"defaults": { "defaults": {
"board_outline_line_width": 0.1, "board_outline_line_width": 0.1,

View File

@ -1,4 +1,4 @@
(kicad_sch (version 20220331) (generator eeschema) (kicad_sch (version 20220622) (generator eeschema)
(uuid 24a3b022-7ece-4686-93db-0efadfbf9409) (uuid 24a3b022-7ece-4686-93db-0efadfbf9409)
@ -320,6 +320,54 @@
) )
) )
) )
(symbol "pspice:INDUCTOR" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes)
(property "Reference" "L" (id 0) (at 0 2.54 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "INDUCTOR" (id 1) (at 0 -1.27 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_keywords" "simulation" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "ki_description" "Inductor symbol for simulation only" (id 5) (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "INDUCTOR_0_1"
(arc (start -2.54 0) (mid -3.81 1.27) (end -5.08 0)
(stroke (width 0) (type default))
(fill (type none))
)
(arc (start 0 0) (mid -1.27 1.27) (end -2.54 0)
(stroke (width 0) (type default))
(fill (type none))
)
(arc (start 2.54 0) (mid 1.27 1.27) (end 0 0)
(stroke (width 0) (type default))
(fill (type none))
)
(arc (start 5.08 0) (mid 3.81 1.27) (end 2.54 0)
(stroke (width 0) (type default))
(fill (type none))
)
)
(symbol "INDUCTOR_1_1"
(pin input line (at -6.35 0 0) (length 1.27)
(name "1" (effects (font (size 0.762 0.762))))
(number "1" (effects (font (size 0.762 0.762))))
)
(pin input line (at 6.35 0 180) (length 1.27)
(name "2" (effects (font (size 0.762 0.762))))
(number "2" (effects (font (size 0.762 0.762))))
)
)
)
) )
@ -396,10 +444,11 @@
(symbol (lib_id "power:VCC") (at 139.7 101.6 0) (unit 1) (symbol (lib_id "power:VCC") (at 139.7 101.6 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 0b5a77ca-f3ff-42b7-8572-0eefa9011bf1) (uuid 0b5a77ca-f3ff-42b7-8572-0eefa9011bf1)
(property "Reference" "#PWR05" (id 0) (at 139.7 105.41 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 139.7 105.41 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "VCC" (id 1) (at 139.7 97.79 0) (property "Value" "" (id 1) (at 139.7 97.79 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 139.7 101.6 0) (property "Footprint" "" (id 2) (at 139.7 101.6 0)
@ -414,10 +463,11 @@
(symbol (lib_id "power:GND") (at 139.7 76.2 0) (unit 1) (symbol (lib_id "power:GND") (at 139.7 76.2 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 1021faa6-6c38-4f02-a9de-cc7465312989) (uuid 1021faa6-6c38-4f02-a9de-cc7465312989)
(property "Reference" "#PWR04" (id 0) (at 139.7 82.55 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 139.7 82.55 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "GND" (id 1) (at 139.7 81.28 0) (property "Value" "" (id 1) (at 139.7 81.28 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 139.7 76.2 0) (property "Footprint" "" (id 2) (at 139.7 76.2 0)
@ -432,10 +482,11 @@
(symbol (lib_id "power:VCC") (at 163.83 101.6 0) (unit 1) (symbol (lib_id "power:VCC") (at 163.83 101.6 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 2f62470a-49dd-4c2d-89e9-a2acc60c442d) (uuid 2f62470a-49dd-4c2d-89e9-a2acc60c442d)
(property "Reference" "#PWR013" (id 0) (at 163.83 105.41 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 163.83 105.41 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "VCC" (id 1) (at 163.83 97.79 0) (property "Value" "" (id 1) (at 163.83 97.79 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 163.83 101.6 0) (property "Footprint" "" (id 2) (at 163.83 101.6 0)
@ -450,10 +501,11 @@
(symbol (lib_id "power:GND") (at 152.4 114.3 0) (unit 1) (symbol (lib_id "power:GND") (at 152.4 114.3 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 438ece8c-3eb3-4d7e-9271-8a8e8aeb6d3c) (uuid 438ece8c-3eb3-4d7e-9271-8a8e8aeb6d3c)
(property "Reference" "#PWR010" (id 0) (at 152.4 120.65 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 152.4 120.65 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "GND" (id 1) (at 152.4 119.38 0) (property "Value" "" (id 1) (at 152.4 119.38 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 152.4 114.3 0) (property "Footprint" "" (id 2) (at 152.4 114.3 0)
@ -468,10 +520,11 @@
(symbol (lib_id "power:VCC") (at 152.4 101.6 0) (unit 1) (symbol (lib_id "power:VCC") (at 152.4 101.6 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 613737e0-8030-4980-b87e-8290b8a61eaf) (uuid 613737e0-8030-4980-b87e-8290b8a61eaf)
(property "Reference" "#PWR09" (id 0) (at 152.4 105.41 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 152.4 105.41 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "VCC" (id 1) (at 152.4 97.79 0) (property "Value" "" (id 1) (at 152.4 97.79 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 152.4 101.6 0) (property "Footprint" "" (id 2) (at 152.4 101.6 0)
@ -483,13 +536,34 @@
(pin "1" (uuid 4e31b1ca-d4bc-4891-b37e-bc167f16d091)) (pin "1" (uuid 4e31b1ca-d4bc-4891-b37e-bc167f16d091))
) )
(symbol (lib_id "pspice:INDUCTOR") (at 71.12 72.39 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 6217f505-e2f0-4bd4-ab3b-0a4896367149)
(default_instance (reference "L") (unit 1) (value "INDUCTOR") (footprint ""))
(property "Reference" "L" (id 0) (at 71.12 67.31 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "INDUCTOR" (id 1) (at 71.12 69.85 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (id 2) (at 71.12 72.39 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "~" (id 3) (at 71.12 72.39 0)
(effects (font (size 1.27 1.27)) hide)
)
(pin "1" (uuid ff4cdd71-7d58-4c69-a6eb-93a6fb2f04e7))
(pin "2" (uuid 4b1b6519-e902-4f0b-9a19-0091065f9f53))
)
(symbol (lib_id "Device:C") (at 152.4 107.95 0) (unit 1) (symbol (lib_id "Device:C") (at 152.4 107.95 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 6566e118-05df-4951-a19e-df5ca72becf1) (uuid 6566e118-05df-4951-a19e-df5ca72becf1)
(property "Reference" "C1" (id 0) (at 156.21 107.315 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 156.21 107.315 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Value" "100u" (id 1) (at 156.21 109.855 0) (property "Value" "" (id 1) (at 156.21 109.855 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Footprint" "" (id 2) (at 153.3652 111.76 0) (property "Footprint" "" (id 2) (at 153.3652 111.76 0)
@ -517,10 +591,11 @@
(symbol (lib_id "Device:L") (at 163.83 107.95 0) (unit 1) (symbol (lib_id "Device:L") (at 163.83 107.95 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 65be26d9-e694-445c-9a01-797abd973f29) (uuid 65be26d9-e694-445c-9a01-797abd973f29)
(property "Reference" "L1" (id 0) (at 165.1 107.315 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 165.1 107.315 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Value" "220n" (id 1) (at 165.1 109.855 0) (property "Value" "" (id 1) (at 165.1 109.855 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Footprint" "" (id 2) (at 163.83 107.95 0) (property "Footprint" "" (id 2) (at 163.83 107.95 0)
@ -548,10 +623,11 @@
(symbol (lib_id "Device:R") (at 139.7 107.95 0) (unit 1) (symbol (lib_id "Device:R") (at 139.7 107.95 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 698024ab-bd78-4be5-8cb1-c09eef71c67f) (uuid 698024ab-bd78-4be5-8cb1-c09eef71c67f)
(property "Reference" "R1" (id 0) (at 142.24 107.315 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 142.24 107.315 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Value" "10M" (id 1) (at 142.24 109.855 0) (property "Value" "" (id 1) (at 142.24 109.855 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Footprint" "" (id 2) (at 137.922 107.95 90) (property "Footprint" "" (id 2) (at 137.922 107.95 90)
@ -582,10 +658,11 @@
(symbol (lib_id "Simulation_SPICE:VDC") (at 114.3 107.95 0) (unit 1) (symbol (lib_id "Simulation_SPICE:VDC") (at 114.3 107.95 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid 83608f1c-11c0-46f8-ae54-fcb488541f6a) (uuid 83608f1c-11c0-46f8-ae54-fcb488541f6a)
(property "Reference" "VDC1" (id 0) (at 118.11 106.045 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 118.11 106.045 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Value" "1" (id 1) (at 118.11 108.585 0) (property "Value" "" (id 1) (at 118.11 108.585 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Footprint" "" (id 2) (at 114.3 107.95 0) (property "Footprint" "" (id 2) (at 114.3 107.95 0)
@ -613,10 +690,11 @@
(symbol (lib_id "power:GND") (at 163.83 114.3 0) (unit 1) (symbol (lib_id "power:GND") (at 163.83 114.3 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid aa1c725b-e908-4ffe-a8e1-dbe74874ec0b) (uuid aa1c725b-e908-4ffe-a8e1-dbe74874ec0b)
(property "Reference" "#PWR014" (id 0) (at 163.83 120.65 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 163.83 120.65 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "GND" (id 1) (at 163.83 119.38 0) (property "Value" "" (id 1) (at 163.83 119.38 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 163.83 114.3 0) (property "Footprint" "" (id 2) (at 163.83 114.3 0)
@ -631,10 +709,11 @@
(symbol (lib_id "power:VCC") (at 163.83 63.5 0) (unit 1) (symbol (lib_id "power:VCC") (at 163.83 63.5 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid af8afa4e-4235-475c-9551-2d7ded7072b6) (uuid af8afa4e-4235-475c-9551-2d7ded7072b6)
(property "Reference" "#PWR011" (id 0) (at 163.83 67.31 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 163.83 67.31 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "VCC" (id 1) (at 163.83 59.69 0) (property "Value" "" (id 1) (at 163.83 59.69 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 163.83 63.5 0) (property "Footprint" "" (id 2) (at 163.83 63.5 0)
@ -649,10 +728,11 @@
(symbol (lib_id "power:VCC") (at 114.3 101.6 0) (unit 1) (symbol (lib_id "power:VCC") (at 114.3 101.6 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid b60fd0ca-97bd-4e20-9a27-3046f059d2b9) (uuid b60fd0ca-97bd-4e20-9a27-3046f059d2b9)
(property "Reference" "#PWR01" (id 0) (at 114.3 105.41 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 114.3 105.41 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "VCC" (id 1) (at 114.3 97.79 0) (property "Value" "" (id 1) (at 114.3 97.79 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 114.3 101.6 0) (property "Footprint" "" (id 2) (at 114.3 101.6 0)
@ -667,10 +747,11 @@
(symbol (lib_id "Device:C") (at 152.4 69.85 0) (unit 1) (symbol (lib_id "Device:C") (at 152.4 69.85 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid ba938e19-1c33-428c-a122-b75b8be63133) (uuid ba938e19-1c33-428c-a122-b75b8be63133)
(property "Reference" "C2" (id 0) (at 156.21 69.215 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 156.21 69.215 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Value" "100u" (id 1) (at 156.21 71.755 0) (property "Value" "" (id 1) (at 156.21 71.755 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Footprint" "" (id 2) (at 153.3652 73.66 0) (property "Footprint" "" (id 2) (at 153.3652 73.66 0)
@ -695,10 +776,11 @@
(symbol (lib_id "Device:L") (at 163.83 69.85 0) (unit 1) (symbol (lib_id "Device:L") (at 163.83 69.85 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid c38b2288-cfde-4d06-b96a-fb8e8c8154c6) (uuid c38b2288-cfde-4d06-b96a-fb8e8c8154c6)
(property "Reference" "L2" (id 0) (at 165.1 69.215 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 165.1 69.215 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Value" "220n" (id 1) (at 165.1 71.755 0) (property "Value" "" (id 1) (at 165.1 71.755 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Footprint" "" (id 2) (at 163.83 69.85 0) (property "Footprint" "" (id 2) (at 163.83 69.85 0)
@ -723,10 +805,11 @@
(symbol (lib_id "power:GND") (at 152.4 76.2 0) (unit 1) (symbol (lib_id "power:GND") (at 152.4 76.2 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid c6e7e2c3-9808-4e24-b9f8-b0bec1fd8ac2) (uuid c6e7e2c3-9808-4e24-b9f8-b0bec1fd8ac2)
(property "Reference" "#PWR08" (id 0) (at 152.4 82.55 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 152.4 82.55 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "GND" (id 1) (at 152.4 81.28 0) (property "Value" "" (id 1) (at 152.4 81.28 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 152.4 76.2 0) (property "Footprint" "" (id 2) (at 152.4 76.2 0)
@ -741,10 +824,11 @@
(symbol (lib_id "power:GND") (at 114.3 114.3 0) (unit 1) (symbol (lib_id "power:GND") (at 114.3 114.3 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid cae1a2a0-561b-4729-802f-81c375ac4c1e) (uuid cae1a2a0-561b-4729-802f-81c375ac4c1e)
(property "Reference" "#PWR02" (id 0) (at 114.3 120.65 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 114.3 120.65 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "GND" (id 1) (at 114.3 119.38 0) (property "Value" "" (id 1) (at 114.3 119.38 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 114.3 114.3 0) (property "Footprint" "" (id 2) (at 114.3 114.3 0)
@ -759,10 +843,11 @@
(symbol (lib_id "power:VCC") (at 139.7 63.5 0) (unit 1) (symbol (lib_id "power:VCC") (at 139.7 63.5 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid cb427ace-dc8b-439f-b07d-a8c28be3b1a1) (uuid cb427ace-dc8b-439f-b07d-a8c28be3b1a1)
(property "Reference" "#PWR03" (id 0) (at 139.7 67.31 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 139.7 67.31 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "VCC" (id 1) (at 139.7 59.69 0) (property "Value" "" (id 1) (at 139.7 59.69 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 139.7 63.5 0) (property "Footprint" "" (id 2) (at 139.7 63.5 0)
@ -777,10 +862,11 @@
(symbol (lib_id "power:GND") (at 139.7 114.3 0) (unit 1) (symbol (lib_id "power:GND") (at 139.7 114.3 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid d829b2e0-05c9-40a0-815e-35a8d1f6cecd) (uuid d829b2e0-05c9-40a0-815e-35a8d1f6cecd)
(property "Reference" "#PWR06" (id 0) (at 139.7 120.65 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 139.7 120.65 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "GND" (id 1) (at 139.7 119.38 0) (property "Value" "" (id 1) (at 139.7 119.38 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 139.7 114.3 0) (property "Footprint" "" (id 2) (at 139.7 114.3 0)
@ -795,10 +881,11 @@
(symbol (lib_id "Device:R") (at 139.7 69.85 0) (unit 1) (symbol (lib_id "Device:R") (at 139.7 69.85 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid d9242e06-77b6-413a-988e-016305303690) (uuid d9242e06-77b6-413a-988e-016305303690)
(property "Reference" "R2" (id 0) (at 142.24 69.215 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 142.24 69.215 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Value" "10M" (id 1) (at 142.24 71.755 0) (property "Value" "" (id 1) (at 142.24 71.755 0)
(effects (font (size 1.27 1.27)) (justify left)) (effects (font (size 1.27 1.27)) (justify left))
) )
(property "Footprint" "" (id 2) (at 137.922 69.85 90) (property "Footprint" "" (id 2) (at 137.922 69.85 90)
@ -823,10 +910,11 @@
(symbol (lib_id "power:VCC") (at 152.4 63.5 0) (unit 1) (symbol (lib_id "power:VCC") (at 152.4 63.5 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid e5d82f4f-4a4d-49d2-aad6-37bf5437c82b) (uuid e5d82f4f-4a4d-49d2-aad6-37bf5437c82b)
(property "Reference" "#PWR07" (id 0) (at 152.4 67.31 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 152.4 67.31 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "VCC" (id 1) (at 152.4 59.69 0) (property "Value" "" (id 1) (at 152.4 59.69 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 152.4 63.5 0) (property "Footprint" "" (id 2) (at 152.4 63.5 0)
@ -841,10 +929,11 @@
(symbol (lib_id "power:GND") (at 163.83 76.2 0) (unit 1) (symbol (lib_id "power:GND") (at 163.83 76.2 0) (unit 1)
(in_bom yes) (on_board yes) (fields_autoplaced) (in_bom yes) (on_board yes) (fields_autoplaced)
(uuid f5956c68-9906-48b7-b8fa-babd31da28d9) (uuid f5956c68-9906-48b7-b8fa-babd31da28d9)
(property "Reference" "#PWR012" (id 0) (at 163.83 82.55 0) (default_instance (reference "U") (unit 1) (value "") (footprint ""))
(property "Reference" "U" (id 0) (at 163.83 82.55 0)
(effects (font (size 1.27 1.27)) hide) (effects (font (size 1.27 1.27)) hide)
) )
(property "Value" "GND" (id 1) (at 163.83 81.28 0) (property "Value" "" (id 1) (at 163.83 81.28 0)
(effects (font (size 1.27 1.27))) (effects (font (size 1.27 1.27)))
) )
(property "Footprint" "" (id 2) (at 163.83 76.2 0) (property "Footprint" "" (id 2) (at 163.83 76.2 0)
@ -913,7 +1002,10 @@
(reference "L1") (unit 1) (value "220n") (footprint "") (reference "L1") (unit 1) (value "220n") (footprint "")
) )
(path "/c38b2288-cfde-4d06-b96a-fb8e8c8154c6" (path "/c38b2288-cfde-4d06-b96a-fb8e8c8154c6"
(reference "L2") (unit 1) (value "220n") (footprint "") (reference "L2") (unit 1) (value "220nH") (footprint "")
)
(path "/6217f505-e2f0-4bd4-ab3b-0a4896367149"
(reference "L3") (unit 1) (value "100uH") (footprint "")
) )
(path "/698024ab-bd78-4be5-8cb1-c09eef71c67f" (path "/698024ab-bd78-4be5-8cb1-c09eef71c67f"
(reference "R1") (unit 1) (value "10M") (footprint "") (reference "R1") (unit 1) (value "10M") (footprint "")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,52 +3,52 @@
.probe alli .probe alli
.tran 1u 10m .tran 1u 10m
IRANDNORMAL1 /irandnormal GND TRRANDOM( 2 1u 0 1m 1 ) BI1 /ibehavioral GND I=sin(2*pi*10000*time)
IRANDEXP1 /irandexp GND TRRANDOM( 3 1u 0 1m 1 )
IBURSTNOISE1 /iburstnoise GND TRNOISE( 0 0 0 0 1 1m 1m )
IRANDUNIFORM1 /iranduniform GND TRRANDOM( 1 1u 1m -2 0 )
R23 /irandexp GND 100 R23 /irandexp GND 100
R22 /irandnormal GND 100 R22 /irandnormal GND 100
R20 /iburstnoise GND 100
R21 /iranduniform GND 100 R21 /iranduniform GND 100
R20 /iburstnoise GND 100
R24 /ibehavioral GND 100 R24 /ibehavioral GND 100
BI1 /ibehavioral GND I=sin(2*pi*10000*time) IBURSTNOISE1 /iburstnoise GND TRNOISE( 0 0 0 0 1 1m 1m )
IRANDUNIFORM1 /iranduniform GND TRRANDOM( 1 1u 1m -2 0 )
IRANDNORMAL1 /irandnormal GND TRRANDOM( 2 1u 0 1m 1 )
IRANDEXP1 /irandexp GND TRRANDOM( 3 1u 0 1m 1 )
VPINKNOISE1 /vpinknoise GND TRNOISE( 0 1u 1 1m 0 0 0 ) VPINKNOISE1 /vpinknoise GND TRNOISE( 0 1u 1 1m 0 0 0 )
VWHITENOISE1 /vwhitenoise GND TRNOISE( 1m 1u 0 0 0 0 0 ) VWHITENOISE1 /vwhitenoise GND TRNOISE( 1m 1u 0 0 0 0 0 )
R6 /vwhitenoise GND 100 R6 /vwhitenoise GND 100
R4 /vexp GND 100
R7 /vpinknoise GND 100
R5 /vpwl GND 100
VPWL1 /vpwl GND PWL( 0 0 1m 1 2m 0 3m 500m 4m 0 ) VPWL1 /vpwl GND PWL( 0 0 1m 1 2m 0 3m 500m 4m 0 )
VEXP1 /vexp GND EXP( 0 1 1m 500u 2m 500u ) VEXP1 /vexp GND EXP( 0 1 1m 500u 2m 500u )
R7 /vpinknoise GND 100
R5 /vpwl GND 100
R4 /vexp GND 100
R13 /iwhitenoise GND 100 R13 /iwhitenoise GND 100
R12 /ipwl GND 100 R12 /ipwl GND 100
IPWL1 /ipwl GND PWL( 0 0 1m 1 2m 0 3m 500m 4m 0 ) IPWL1 /ipwl GND PWL( 0 0 1m 1 2m 0 3m 500m 4m 0 )
IWHITENOISE1 /iwhitenoise GND TRNOISE( 1m 1u 0 0 0 0 0 )
R11 /iexp GND 100 R11 /iexp GND 100
IEXP1 /iexp GND EXP( 0 1 1m 500u 2m 500u ) IEXP1 /iexp GND EXP( 0 1 1m 500u 2m 500u )
R14 /ipinknoise GND 100 R14 /ipinknoise GND 100
IPINKNOISE1 /ipinknoise GND TRNOISE( 0 1u 1 1m 0 0 0 ) IPINKNOISE1 /ipinknoise GND TRNOISE( 0 1u 1 1m 0 0 0 )
IWHITENOISE1 /iwhitenoise GND TRNOISE( 1m 1u 0 0 0 0 0 )
R18 /vrandexp GND 100 R18 /vrandexp GND 100
R19 /vbehavioral GND 100
R15 /vburstnoise GND 100 R15 /vburstnoise GND 100
R16 /vranduniform GND 100 R16 /vranduniform GND 100
VRANDUNIFORM1 /vranduniform GND TRRANDOM( 1 1u 1m -2 0 ) VRANDUNIFORM1 /vranduniform GND TRRANDOM( 1 1u 1m -2 0 )
R19 /vbehavioral GND 100 BV1 /vbehavioral GND V=sin(2*pi*10000*time)
R17 /vrandnormal GND 100 R17 /vrandnormal GND 100
VRANDNORMAL1 /vrandnormal GND TRRANDOM( 2 1u 0 1m 1 ) VRANDNORMAL1 /vrandnormal GND TRRANDOM( 2 1u 0 1m 1 )
VBURSTNOISE1 /vburstnoise GND TRNOISE( 0 0 0 0 1 1m 1m ) VBURSTNOISE1 /vburstnoise GND TRNOISE( 0 0 0 0 1 1m 1m )
VRANDEXP1 /vrandexp GND TRRANDOM( 3 1u 0 1m 1 ) VRANDEXP1 /vrandexp GND TRRANDOM( 3 1u 0 1m 1 )
BV1 /vbehavioral GND V=sin(2*pi*10000*time)
IDC1 /idc GND 1
R8 /idc GND 100 R8 /idc GND 100
IPULSE1 /ipulse GND PULSE( 0 1 1m 1u 1u 1m 2m )
ISIN1 /isin GND SIN( 0 1 1k 1m )
R9 /isin GND 100 R9 /isin GND 100
IPULSE1 /ipulse GND PULSE( 0 1 1m 1u 1u 1m 2m )
R10 /ipulse GND 100 R10 /ipulse GND 100
IDC1 /idc GND 1
ISIN1 /isin GND SIN( 0 1 1k 1m )
VPULSE1 /vpulse GND PULSE( 0 1 1m 1u 1u 1m 2m ) VPULSE1 /vpulse GND PULSE( 0 1 1m 1u 1u 1m 2m )
VSIN1 /vsin GND SIN( 0 1 1k 1m )
R3 /vpulse GND 100 R3 /vpulse GND 100
R2 /vsin GND 100 R2 /vsin GND 100
R1 /vdc GND 100 VSIN1 /vsin GND SIN( 0 1 1k 1m )
VDC1 /vdc GND 1 VDC1 /vdc GND 1
R1 /vdc GND 100
.end .end

File diff suppressed because it is too large Load Diff

View File

@ -137,6 +137,10 @@ wxString TEST_NETLIST_EXPORTER_FIXTURE<Exporter>::GetNetlistPath( bool aTest )
template <typename Exporter> template <typename Exporter>
void TEST_NETLIST_EXPORTER_FIXTURE<Exporter>::WriteNetlist() void TEST_NETLIST_EXPORTER_FIXTURE<Exporter>::WriteNetlist()
{ {
// In case of a crash the file may not have been deleted.
if( wxFileExists( GetNetlistPath( true ) ) )
wxRemoveFile( GetNetlistPath( true ) );
auto exporter = std::make_unique<Exporter>( &m_schematic ); auto exporter = std::make_unique<Exporter>( &m_schematic );
BOOST_REQUIRE_EQUAL( exporter->WriteNetlist( GetNetlistPath( true ), GetNetlistOptions() ), BOOST_REQUIRE_EQUAL( exporter->WriteNetlist( GetNetlistPath( true ), GetNetlistOptions() ),
true ); true );

View File

@ -95,16 +95,22 @@ public:
ngspice->Command( "set ngbehavior=ps" ); ngspice->Command( "set ngbehavior=ps" );
ngspice->Command( "setseed 1" ); ngspice->Command( "setseed 1" );
ngspice->Command( "set filetype=ascii" ); ngspice->Command( "set filetype=ascii" );
ngspice->Command( "set numdgt=3" );
ngspice->Command( "set wr_singlescale" );
ngspice->Command( "set wr_vecnames" );
ngspice->LoadNetlist( netlist.ToStdString() ); ngspice->LoadNetlist( netlist.ToStdString() );
ngspice->Run(); ngspice->Run();
wxString vectors; wxString vectors;
for( const wxString& vector : m_plottedVectors ) for( const wxString& vector : m_testedVectors )
vectors << vector << " "; vectors << vector << " ";
ngspice->Command( wxString::Format( "write %s %s", GetResultsPath( true ), // We need to make sure that the number of points always the same.
vectors ).ToStdString() ); ngspice->Command( wxString::Format( "linearize %s", vectors ).ToStdString() );
ngspice->Command(
wxString::Format( "wrdata %s %s", GetResultsPath( true ), vectors ).ToStdString() );
FILE_LINE_READER refReader( GetResultsPath() ); FILE_LINE_READER refReader( GetResultsPath() );
@ -134,7 +140,7 @@ public:
void TestNetlist( const wxString& aBaseName, const std::vector<wxString> aPlottedVectors ) void TestNetlist( const wxString& aBaseName, const std::vector<wxString> aPlottedVectors )
{ {
m_plottedVectors = aPlottedVectors; m_testedVectors = aPlottedVectors;
TEST_NETLIST_EXPORTER_FIXTURE<NETLIST_EXPORTER_SPICE>::TestNetlist( aBaseName ); TEST_NETLIST_EXPORTER_FIXTURE<NETLIST_EXPORTER_SPICE>::TestNetlist( aBaseName );
} }
@ -155,20 +161,20 @@ public:
std::unique_ptr<SPICE_TEST_REPORTER> m_reporter; std::unique_ptr<SPICE_TEST_REPORTER> m_reporter;
std::shared_ptr<SPICE_SIMULATOR> m_simulator; std::shared_ptr<SPICE_SIMULATOR> m_simulator;
std::vector<wxString> m_plottedVectors; std::vector<wxString> m_testedVectors;
}; };
BOOST_FIXTURE_TEST_SUITE( NetlistExporterSpice, TEST_NETLIST_EXPORTER_SPICE_FIXTURE ) BOOST_FIXTURE_TEST_SUITE( NetlistExporterSpice, TEST_NETLIST_EXPORTER_SPICE_FIXTURE )
/*BOOST_AUTO_TEST_CASE( Rectifier ) BOOST_AUTO_TEST_CASE( Rectifier )
{ {
const MOCK_PGM_BASE& program = static_cast<MOCK_PGM_BASE&>( Pgm() ); const MOCK_PGM_BASE& program = static_cast<MOCK_PGM_BASE&>( Pgm() );
MOCK_EXPECT( program.GetLocalEnvVariables ).returns( ENV_VAR_MAP() ); MOCK_EXPECT( program.GetLocalEnvVariables ).returns( ENV_VAR_MAP() );
TestNetlist( "rectifier", { "V(/in)", "V(/out)" } ); TestNetlist( "rectifier", { "V(/in)", "V(/out)" } );
}*/ }
// FIXME: Fails due to some nondeterminism, seems related to convergence problems. // FIXME: Fails due to some nondeterminism, seems related to convergence problems.
@ -187,10 +193,10 @@ BOOST_AUTO_TEST_CASE( Opamp )
} }
/*BOOST_AUTO_TEST_CASE( NpnCeAmp ) BOOST_AUTO_TEST_CASE( NpnCeAmp )
{ {
TestNetlist( "npn_ce_amp", { "V(/in)", "V(/out)" } ); TestNetlist( "npn_ce_amp", { "V(/in)", "V(/out)" } );
}*/ }
// Incomplete. TODO. // Incomplete. TODO.
@ -206,6 +212,7 @@ BOOST_AUTO_TEST_CASE( Tlines )
} }
// FIXME.
/*BOOST_AUTO_TEST_CASE( Sources ) /*BOOST_AUTO_TEST_CASE( Sources )
{ {
TestNetlist( "sources", { "V(/vdc)", "V(/idc)", TestNetlist( "sources", { "V(/vdc)", "V(/idc)",
@ -225,10 +232,10 @@ BOOST_AUTO_TEST_CASE( Tlines )
}*/ }*/
/*BOOST_AUTO_TEST_CASE( CmosNot ) BOOST_AUTO_TEST_CASE( CmosNot )
{ {
TestNetlist( "cmos_not", { "V(/in)", "V(/out)" } ); TestNetlist( "cmos_not", { "V(/in)", "V(/out)" } );
}*/ }
/*BOOST_AUTO_TEST_CASE( InstanceParams ) /*BOOST_AUTO_TEST_CASE( InstanceParams )
@ -238,7 +245,7 @@ BOOST_AUTO_TEST_CASE( Tlines )
}*/ }*/
/*BOOST_AUTO_TEST_CASE( LegacyLaserDriver ) BOOST_AUTO_TEST_CASE( LegacyLaserDriver )
{ {
TestNetlist( "legacy_laser_driver", { "V(/out)" } ); TestNetlist( "legacy_laser_driver", { "V(/out)" } );
} }
@ -247,19 +254,19 @@ BOOST_AUTO_TEST_CASE( Tlines )
BOOST_AUTO_TEST_CASE( LegacyPspice ) BOOST_AUTO_TEST_CASE( LegacyPspice )
{ {
TestNetlist( "legacy_pspice", { "V(/VIN)", "V(VOUT)" } ); TestNetlist( "legacy_pspice", { "V(/VIN)", "V(VOUT)" } );
}*/ }
/*BOOST_AUTO_TEST_CASE( LegacyRectifier ) BOOST_AUTO_TEST_CASE( LegacyRectifier )
{ {
TestNetlist( "legacy_rectifier", { "V(/signal_in)", "V(/rect_out)" } ); TestNetlist( "legacy_rectifier", { "V(/signal_in)", "V(/rect_out)" } );
}*/ }
/*BOOST_AUTO_TEST_CASE( LegacySallenKey ) BOOST_AUTO_TEST_CASE( LegacySallenKey )
{ {
TestNetlist( "legacy_sallen_key", { "V(/lowpass)" } ); TestNetlist( "legacy_sallen_key", { "V(/lowpass)" } );
}*/ }
BOOST_AUTO_TEST_CASE( LegacySources ) BOOST_AUTO_TEST_CASE( LegacySources )