diff options
-rw-r--r-- | Examples/BJT_amplifier/BJT_amplifier.cir | 5 | ||||
-rw-r--r-- | Examples/BJT_amplifier/BJT_amplifier.cir.out | 6 | ||||
-rw-r--r-- | Examples/BJT_amplifier/BJT_amplifier_Previous_Values.xml | 2 | ||||
-rw-r--r-- | Examples/BJT_amplifier/plot_data_i.txt | 4 | ||||
-rw-r--r-- | Examples/BJT_amplifier/plot_data_v.txt | 14 | ||||
-rw-r--r-- | kicadSchematicLibrary/eSim_Plot.lib | 8 | ||||
-rw-r--r-- | src/kicadtoNgspice/Processing.py | 7 |
7 files changed, 28 insertions, 18 deletions
diff --git a/Examples/BJT_amplifier/BJT_amplifier.cir b/Examples/BJT_amplifier/BJT_amplifier.cir index cf6ac11c..70555b1d 100644 --- a/Examples/BJT_amplifier/BJT_amplifier.cir +++ b/Examples/BJT_amplifier/BJT_amplifier.cir @@ -17,6 +17,9 @@ C2 GND Net-_C2-Pad2_ 100u C3 out Net-_C3-Pad2_ 40u R5 Net-_R2-Pad1_ Net-_C3-Pad2_ 2k R4 Net-_C2-Pad2_ GND 1.5k -Q1 Net-_C3-Pad2_ Net-_C1-Pad2_ Net-_C2-Pad2_ NPN +Q1 Net-_C3-Pad2_ Net-_C1-Pad2_ Net-_C2-Pad2_ NPN + +U1 out plot_phase +U2 out plot_log .end diff --git a/Examples/BJT_amplifier/BJT_amplifier.cir.out b/Examples/BJT_amplifier/BJT_amplifier.cir.out index 899d6a09..ee87daae 100644 --- a/Examples/BJT_amplifier/BJT_amplifier.cir.out +++ b/Examples/BJT_amplifier/BJT_amplifier.cir.out @@ -2,7 +2,7 @@ .include NPN.lib v1 net-_r2-pad1_ gnd dc 10 -v2 net-_r1-pad2_ gnd ac 0.5 +v2 net-_r1-pad2_ gnd ac 0.5 0 r1 net-_c1-pad1_ net-_r1-pad2_ 50 r2 net-_r2-pad1_ net-_c1-pad2_ 200k c1 net-_c1-pad1_ net-_c1-pad2_ 40u @@ -13,6 +13,8 @@ c3 out net-_c3-pad2_ 40u r5 net-_r2-pad1_ net-_c3-pad2_ 2k r4 net-_c2-pad2_ gnd 1.5k q1 net-_c3-pad2_ net-_c1-pad2_ net-_c2-pad2_ Q2N2222 +* u1 out plot_phase +* u2 out plot_log .ac dec 100 100Hz 10KHz * Control Statements @@ -20,5 +22,7 @@ q1 net-_c3-pad2_ net-_c1-pad2_ net-_c2-pad2_ Q2N2222 run print allv > plot_data_v.txt print alli > plot_data_i.txt +plot phase(out) +plot log(out) .endc .end diff --git a/Examples/BJT_amplifier/BJT_amplifier_Previous_Values.xml b/Examples/BJT_amplifier/BJT_amplifier_Previous_Values.xml index 98eb245e..0db3966c 100644 --- a/Examples/BJT_amplifier/BJT_amplifier_Previous_Values.xml +++ b/Examples/BJT_amplifier/BJT_amplifier_Previous_Values.xml @@ -1 +1 @@ -<KicadtoNgspice><analysis><ac><field1 name="Lin">false</field1><field2 name="Dec">true</field2><field3 name="Oct">false</field3><field4 name="Start Frequency">100</field4><field5 name="Stop Frequency">10</field5><field6 name="No. of points">100</field6><field7 name="Start Fre Combo">Hz</field7><field8 name="Stop Fre Combo">KHz</field8></ac><dc><field1 name="Source Name" /><field2 name="Start" /><field3 name="Increment" /><field4 name="Stop" /><field5 name="Operating Point">False</field5><field6 name="Start Combo">Volts or Amperes</field6><field7 name="Increment Combo">Volts or Amperes</field7><field8 name="Stop Combo">Volts or Amperes</field8></dc><tran><field1 name="Start Time" /><field2 name="Step Time" /><field3 name="Stop Time" /><field4 name="Start Combo">Sec</field4><field5 name="Step Combo">Sec</field5><field6 name="Stop Combo">Sec</field6></tran></analysis><source><v1 name="Source type">dc<field1 name="Value">10</field1></v1><v2 name="Source type">ac<field1 name="Amplitude">0.5</field1></v2></source><model /><devicemodel><q1><field>/opt/eSim/src/deviceModelLibrary/Transistor/NPN.lib</field></q1></devicemodel><subcircuit /></KicadtoNgspice>
\ No newline at end of file +<KicadtoNgspice><source><v1 name="Source type">dc<field1 name="Value">10</field1></v1><v2 name="Source type">ac<field1 name="Amplitude">0.5</field1></v2></source><model /><devicemodel><q1><field>/home/phantom/Workspace/eSim/src/deviceModelLibrary/Transistor/NPN.lib</field></q1></devicemodel><subcircuit /><analysis><ac><field1 name="Lin">false</field1><field2 name="Dec">true</field2><field3 name="Oct">false</field3><field4 name="Start Frequency">100</field4><field5 name="Stop Frequency">10</field5><field6 name="No. of points">100</field6><field7 name="Start Fre Combo">Hz</field7><field8 name="Stop Fre Combo">KHz</field8></ac><dc><field1 name="Source Name" /><field2 name="Start" /><field3 name="Increment" /><field4 name="Stop" /><field5 name="Operating Point">0</field5><field6 name="Start Combo">Volts or Amperes</field6><field7 name="Increment Combo">Volts or Amperes</field7><field8 name="Stop Combo">Volts or Amperes</field8></dc><tran><field1 name="Start Time" /><field2 name="Step Time" /><field3 name="Stop Time" /><field4 name="Start Combo">Sec</field4><field5 name="Step Combo">Sec</field5><field6 name="Stop Combo">Sec</field6></tran></analysis></KicadtoNgspice>
\ No newline at end of file diff --git a/Examples/BJT_amplifier/plot_data_i.txt b/Examples/BJT_amplifier/plot_data_i.txt index b20147de..68e5fea9 100644 --- a/Examples/BJT_amplifier/plot_data_i.txt +++ b/Examples/BJT_amplifier/plot_data_i.txt @@ -1,5 +1,5 @@ * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency v1#branch -------------------------------------------------------------------------------- @@ -215,7 +215,7 @@ Index frequency v1#branch 200 1.000000e+04 -5.02835e-03, -2.03142e-05 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency v2#branch -------------------------------------------------------------------------------- diff --git a/Examples/BJT_amplifier/plot_data_v.txt b/Examples/BJT_amplifier/plot_data_v.txt index 983c00f7..e54c7fe7 100644 --- a/Examples/BJT_amplifier/plot_data_v.txt +++ b/Examples/BJT_amplifier/plot_data_v.txt @@ -1,5 +1,5 @@ * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency net-_c1-pad1_ -------------------------------------------------------------------------------- @@ -215,7 +215,7 @@ Index frequency net-_c1-pad1_ 200 1.000000e+04 4.959885e-01, -2.02010e-04 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency net-_c1-pad2_ -------------------------------------------------------------------------------- @@ -431,7 +431,7 @@ Index frequency net-_c1-pad2_ 200 1.000000e+04 4.959869e-01, -1.70087e-04 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency net-_c2-pad2_ -------------------------------------------------------------------------------- @@ -647,7 +647,7 @@ Index frequency net-_c2-pad2_ 200 1.000000e+04 1.123580e-05, -2.41284e-03 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency net-_c3-pad2_ -------------------------------------------------------------------------------- @@ -863,7 +863,7 @@ Index frequency net-_c3-pad2_ 200 1.000000e+04 -1.00617e+01, -4.06268e-02 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency net-_r1-pad2_ -------------------------------------------------------------------------------- @@ -1079,7 +1079,7 @@ Index frequency net-_r1-pad2_ 200 1.000000e+04 5.000000e-01, 0.000000e+00 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency net-_r2-pad1_ -------------------------------------------------------------------------------- @@ -1295,7 +1295,7 @@ Index frequency net-_r2-pad1_ 200 1.000000e+04 0.000000e+00, 0.000000e+00 * /home/fossee/downloads/esim-master/examples/bjt_amplifier/bjt_amplifier.cir - AC Analysis Thu Feb 4 15:28:47 2016 + AC Analysis Fri Feb 12 15:10:17 2016 -------------------------------------------------------------------------------- Index frequency out -------------------------------------------------------------------------------- diff --git a/kicadSchematicLibrary/eSim_Plot.lib b/kicadSchematicLibrary/eSim_Plot.lib index b11a2dc9..5654a3d2 100644 --- a/kicadSchematicLibrary/eSim_Plot.lib +++ b/kicadSchematicLibrary/eSim_Plot.lib @@ -23,8 +23,8 @@ F2 "" 0 0 60 H V C CNN F3 "" 0 0 60 H V C CNN DRAW C 0 250 100 0 1 0 N -X + ~ -300 250 200 R 50 50 1 1 I -X - ~ 300 250 200 L 50 50 1 1 I +X + 1 -300 250 200 R 50 50 1 1 I +X - 2 300 250 200 L 50 50 1 1 I ENDDRAW ENDDEF # @@ -76,8 +76,8 @@ F2 "" 0 0 60 H V C CNN F3 "" 0 0 60 H V C CNN DRAW C 0 250 100 0 1 0 N -X + ~ -300 250 200 R 50 50 1 1 I -X - ~ 300 250 200 L 50 50 1 1 I +X + 1 -300 250 200 R 50 50 1 1 I +X - 2 300 250 200 L 50 50 1 1 I ENDDRAW ENDDEF # diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py index 123dce1e..0eaf6d2f 100644 --- a/src/kicadtoNgspice/Processing.py +++ b/src/kicadtoNgspice/Processing.py @@ -156,7 +156,7 @@ class PrcocessNetlist: #Insert details of Ngspice model unknownModelList = [] multipleModelList = [] - plotList = ['plot_v1','plot_v2','plot_i2','plot_log','plot_db'] + plotList = ['plot_v1','plot_v2','plot_i2','plot_log','plot_db','plot_phase'] k = 1 for compline in schematicInfo: @@ -327,6 +327,9 @@ class PrcocessNetlist: elif compType == 'plot_db': words = compline.split() plotText.append("plot db("+words[1]+")") + elif compType == 'plot_phase': + words = compline.split() + plotText.append("plot phase("+words[1]+")") else: schematicInfo.insert(index,"* "+compline) @@ -340,4 +343,4 @@ class PrcocessNetlist: return schematicInfo,outputOption,modelList,unknownModelList,multipleModelList,plotText -
\ No newline at end of file + |