summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/deviceModelLibrary/Templates/CORE.lib2
-rw-r--r--src/deviceModelLibrary/Templates/CORE.xml12
-rwxr-xr-xsrc/deviceModelLibrary/Templates/D.lib3
-rw-r--r--src/deviceModelLibrary/Templates/D.xml24
-rwxr-xr-xsrc/deviceModelLibrary/Templates/NIGBT.lib10
-rw-r--r--src/deviceModelLibrary/Templates/NIGBT.xml15
-rwxr-xr-xsrc/deviceModelLibrary/Templates/NJF.lib4
-rw-r--r--src/deviceModelLibrary/Templates/NJF.xml29
-rwxr-xr-xsrc/deviceModelLibrary/Templates/NMOS-0.5um.lib6
-rw-r--r--src/deviceModelLibrary/Templates/NMOS-0.5um.xml32
-rwxr-xr-xsrc/deviceModelLibrary/Templates/NMOS-180nm.lib13
-rw-r--r--src/deviceModelLibrary/Templates/NMOS-180um.xml112
-rwxr-xr-xsrc/deviceModelLibrary/Templates/NMOS-5um.lib5
-rw-r--r--src/deviceModelLibrary/Templates/NMOS-5um.xml24
-rwxr-xr-xsrc/deviceModelLibrary/Templates/NPN.lib4
-rw-r--r--src/deviceModelLibrary/Templates/NPN.xml33
-rwxr-xr-xsrc/deviceModelLibrary/Templates/PIGBT.lib10
-rw-r--r--src/deviceModelLibrary/Templates/PIGBT.xml15
-rwxr-xr-xsrc/deviceModelLibrary/Templates/PJF.lib5
-rw-r--r--src/deviceModelLibrary/Templates/PJF.xml27
-rwxr-xr-xsrc/deviceModelLibrary/Templates/PMOS-0.5um.lib6
-rw-r--r--src/deviceModelLibrary/Templates/PMOS-0.5um.xml32
-rwxr-xr-xsrc/deviceModelLibrary/Templates/PMOS-180nm.lib11
-rw-r--r--src/deviceModelLibrary/Templates/PMOS-180um.xml112
-rwxr-xr-xsrc/deviceModelLibrary/Templates/PMOS-5um.lib5
-rw-r--r--src/deviceModelLibrary/Templates/PMOS-5um.xml23
-rwxr-xr-xsrc/deviceModelLibrary/Templates/PNP.lib4
-rw-r--r--src/deviceModelLibrary/Templates/PNP.xml33
-rwxr-xr-xsrc/frontEnd/Application.py13
-rw-r--r--src/frontEnd/DockArea.py23
-rw-r--r--src/modelEditor/ModelEditor.py415
-rw-r--r--src/modelEditor/__init__.py0
32 files changed, 1061 insertions, 1 deletions
diff --git a/src/deviceModelLibrary/Templates/CORE.lib b/src/deviceModelLibrary/Templates/CORE.lib
new file mode 100755
index 00000000..c48c4b51
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/CORE.lib
@@ -0,0 +1,2 @@
+.model K3019PL_3C8 Core(MS=415.2K A=44.82 C=.4112 K=25.74
++ Area=1.38 Path=4.52)
diff --git a/src/deviceModelLibrary/Templates/CORE.xml b/src/deviceModelLibrary/Templates/CORE.xml
new file mode 100644
index 00000000..09129f74
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/CORE.xml
@@ -0,0 +1,12 @@
+<library>
+<model_name>Core</model_name>
+<refrence>K3019PL_3C8</refrence>
+<param>
+<MS>415.2K</MS>
+<A>44.82 </A>
+<C>.4112</C>
+<K>25.74</K>
+<Area>1.38</Area>
+<Path>4.52</Path>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/D.lib b/src/deviceModelLibrary/Templates/D.lib
new file mode 100755
index 00000000..890c37fe
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/D.lib
@@ -0,0 +1,3 @@
+.model D1N750 D( Is=880.5E-18 Rs=.25 Ikf=0 N=1 Xti=3 Eg=1.11 Cjo=175p M=.5516
++ Vj=.75 Fc=.5 Isr=1.859n Nr=2 Bv=8.1 Ibv=20.245m Nbv=1.6989 Ibvl=1.9556m
++ Nbvl=14.976 Tbv1=-21.277u)
diff --git a/src/deviceModelLibrary/Templates/D.xml b/src/deviceModelLibrary/Templates/D.xml
new file mode 100644
index 00000000..61312a8a
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/D.xml
@@ -0,0 +1,24 @@
+<library>
+<model_name>D</model_name>
+<refrence>D1N750</refrence>
+<param>
+ <Is>880.5E-18</Is>
+ <Rs>.25</Rs>
+ <Ikf>0</Ikf>
+ <N>1</N>
+ <Xti>3</Xti>
+ <Eg>1.11</Eg>
+ <Cjo>175p</Cjo>
+ <M>.5516</M>
+ <Vj>.75</Vj>
+ <Fc>.5</Fc>
+ <Isr>1.859n</Isr>
+ <Nr>2</Nr>
+ <Bv>8.1</Bv>
+ <Ibv>20.245m</Ibv>
+ <Nbv>1.6989</Nbv>
+ <Ibvl>1.9556m</Ibvl>
+ <Nbvl>14.976</Nbvl>
+ <Tbv1>-21.277u</Tbv1>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/NIGBT.lib b/src/deviceModelLibrary/Templates/NIGBT.lib
new file mode 100755
index 00000000..8c09dcbc
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NIGBT.lib
@@ -0,0 +1,10 @@
+.MODEL IXGH40N60 NIGBT (
++ TAU=287.56E-9
++ KP=50.034
++ AREA=37.500E-6
++ AGD=18.750E-6
++ VT=4.1822
++ KF=.36047
++ CGS=31.942E-9
++ COXD=53.188E-9
++ VTD=2.6570)
diff --git a/src/deviceModelLibrary/Templates/NIGBT.xml b/src/deviceModelLibrary/Templates/NIGBT.xml
new file mode 100644
index 00000000..a945522a
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NIGBT.xml
@@ -0,0 +1,15 @@
+<library>
+<model_name>NIGBT</model_name>
+<refrence>IXGH40N60</refrence>
+<param>
+<TAU>287.56E-9</TAU>
+<KP>50.034</KP>
+<AREA>37.500E-6</AREA>
+<AGD>18.750E-6</AGD>
+<VT>4.1822</VT>
+<KF>.36047</KF>
+<CGS>31.942E-9</CGS>
+<COXD>53.188E-9</COXD>
+<VTD>2.6570</VTD>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/NJF.lib b/src/deviceModelLibrary/Templates/NJF.lib
new file mode 100755
index 00000000..dbb2cbae
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NJF.lib
@@ -0,0 +1,4 @@
+.model J2N3819 NJF(Beta=1.304m Betatce=-.5 Rd=1 Rs=1 Lambda=2.25m Vto=-3
++ Vtotc=-2.5m Is=33.57f Isr=322.4f N=1 Nr=2 Xti=3 Alpha=311.7u
++ Vk=243.6 Cgd=1.6p M=.3622 Pb=1 Fc=.5 Cgs=2.414p Kf=9.882E-18
++ Af=1)
diff --git a/src/deviceModelLibrary/Templates/NJF.xml b/src/deviceModelLibrary/Templates/NJF.xml
new file mode 100644
index 00000000..1b73fc73
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NJF.xml
@@ -0,0 +1,29 @@
+<library>
+<model_name>NJF</model_name>
+<refrence>J2N3819</refrence>
+<param>
+<Beta>1.304m</Beta>
+<Betatce>-.5</Betatce>
+<Rd>1 </Rd>
+<Rs>1 </Rs>
+<Lambda>2.25m</Lambda>
+<Vto>-3</Vto>
+<Vtotc>-2.5m</Vtotc>
+<Is>33.57f </Is>
+<Isr>322.4f </Isr>
+<N>1</N>
+<Nr>2</Nr>
+<Xti>3</Xti>
+<Alpha>311.7u</Alpha>
+<Vk>243.6 </Vk>
+<Cgd>1.6p </Cgd>
+<M>.3622 </M>
+<Pb>1</Pb>
+<Fc>.5</Fc>
+<Cgs>2.414p</Cgs>
+<Kf>9.882E-18</Kf>
+<Af>1</Af>
+
+
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/NMOS-0.5um.lib b/src/deviceModelLibrary/Templates/NMOS-0.5um.lib
new file mode 100755
index 00000000..2e6f4635
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NMOS-0.5um.lib
@@ -0,0 +1,6 @@
+.model mos_n NMOS( TPG=1 TOX=9.5n CJ=550u ETA=0.02125 VMAX=1.8E05
++ GAMMA=0.62 CGSO=0.3n LD=50n MJSW=0.35 PB=1.1
++ CGBO=0.45n XJ=0.2U CGDO=0.3n KAPPA=0.1 LEVEL=3
++ VTO=0.6 NFS=7.20E11 THETA=0.23 CJSW=0.3n PHI=0.7
++ RSH=2.0 MJ=0.6 UO=420 KP=156u DELTA=0.88
++ NSUB=1.40E17 ) \ No newline at end of file
diff --git a/src/deviceModelLibrary/Templates/NMOS-0.5um.xml b/src/deviceModelLibrary/Templates/NMOS-0.5um.xml
new file mode 100644
index 00000000..9ee36496
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NMOS-0.5um.xml
@@ -0,0 +1,32 @@
+<library>
+<model_name>NMOS</model_name>
+<refrence>mos_n</refrence>
+<param>
+<TPG>1</TPG>
+<TOX>9.5n </TOX>
+<CJ>550u </CJ>
+<ETA>0.02125 </ETA>
+<VMAX>1.8E05</VMAX>
+<GAMMA>0.62</GAMMA>
+<CGSO>0.3n </CGSO>
+<LD>50n </LD>
+<MJSW>0.35 </MJSW>
+<PB>1.1</PB>
+<CGBO>0.45n </CGBO>
+<XJ>0.2U </XJ>
+<CGDO>0.3n </CGDO>
+<KAPPA>0.1 </KAPPA>
+<LEVEL>3 </LEVEL>
+<VTO>0.6 </VTO>
+<NFS>7.20E11 </NFS>
+<THETA>0.23 </THETA>
+<CJSW>0.3n </CJSW>
+<PHI>0.7 </PHI>
+<RSH>2.0 </RSH>
+<MJ>0.6 </MJ>
+<UO>420</UO>
+<KP>156u </KP>
+<DELTA>0.88</DELTA>
+<NSUB>1.40E17</NSUB>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/NMOS-180nm.lib b/src/deviceModelLibrary/Templates/NMOS-180nm.lib
new file mode 100755
index 00000000..51e9b119
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NMOS-180nm.lib
@@ -0,0 +1,13 @@
+.model CMOSN NMOS (LEVEL=8 VERSION=3.2 TNOM=27 TOX=4.1E-9 XJ=1E-7 NCH=2.3549E17 VTH0=0.3823463 K1=0.5810697
++ K2=4.774618E-3 K3=0.0431669 K3B=1.1498346 W0=1E-7 NLX=1.910552E-7 DVT0W=0 DVT1W=0 DVT2W=0
++ DVT0=1.2894824 DVT1=0.3622063 DVT2=0.0713729 U0=280.633249 UA=-1.208537E-9 UB=2.158625E-18
++ UC=5.342807E-11 VSAT=9.366802E4 A0=1.7593146 AGS=0.3939741 B0=-6.413949E-9 B1=-1E-7 KETA=-5.180424E-4
++ A1=0 A2=1 RDSW=105.5517558 PRWG=0.5 PRWB=-0.1998871 WR=1 WINT=7.904732E-10 LINT=1.571424E-8 XL=0
++ XW=-1E-8 DWG=1.297221E-9 DWB=1.479041E-9 VOFF=-0.0955434 NFACTOR=2.4358891 CIT=0 CDSC=2.4E-4 CDSCD=0
++ CDSCB=0 ETA0=3.104851E-3 ETAB=-2.512384E-5 DSUB=0.0167075 PCLM=0.8073191 PDIBLC1=0.1666161 PDIBLC2=3.112892E-3
++ PDIBLCB=-0.1 DROUT=0.7875618 PSCBE1=8E10 PSCBE2=9.213635E-10 PVAG=3.85243E-3 DELTA=0.01 RSH=6.7 MOBMOD=1
++ PRT=0 UTE=-1.5 KT1=-0.11 KT1L=0 KT2=0.022 UA1=4.31E-9 UB1=-7.61E-18 UC1=-5.6E-11 AT=3.3E4 WL=0 WLN=1
++ WW=0 WWN=1 WWL=0 LL=0 LLN=1 LW=0 LWN=1 LWL=0 CAPMOD=2 XPART=0.5 CGDO=7.08E-10 CGSO=7.08E-10 CGBO=1E-12
++ CJ=9.68858E-4 PB=0.8 MJ=0.3864502 CJSW=2.512138E-10 PBSW=0.809286 MJSW=0.1060414 CJSWG=3.3E-10 PBSWG=0.809286
++ MJSWG=0.1060414 CF=0 PVTH0=-1.192722E-3 PRDSW=-5 PK2=6.450505E-5 WKETA=-4.27294E-4 LKETA=-0.0104078
++ PU0=6.3268729 PUA=2.226552E-11 PUB=0 PVSAT=969.1480157 PETA0=1E-4 PKETA=-1.049509E-3)
diff --git a/src/deviceModelLibrary/Templates/NMOS-180um.xml b/src/deviceModelLibrary/Templates/NMOS-180um.xml
new file mode 100644
index 00000000..fc3b7a47
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NMOS-180um.xml
@@ -0,0 +1,112 @@
+<library>
+<model_name>NMOS</model_name>
+<refrence>CMOSN</refrence>
+<param>
+<LEVEL>8 </LEVEL>
+<VERSION>3.2 </VERSION>
+<TNOM>27 </TNOM>
+<TOX>4.1E-9 </TOX>
+<XJ>1E-7 </XJ>
+<NCH>2.3549E17 </NCH>
+<VTH0>0.3823463 </VTH0>
+<K1>0.5810697 </K1>
+<K2>4.774618E-3 </K2>
+<K3>0.0431669 </K3>
+<K3B>1.1498346</K3B>
+<W0>1E-7 </W0>
+<NLX>1.910552E-7 </NLX>
+<DVT0W>0 </DVT0W>
+<DVT1W>0 </DVT1W>
+<DVT2W>0 </DVT2W>
+<DVT0>1.2894824 </DVT0>
+<DVT1>0.3622063 </DVT1>
+<DVT2>0.0713729 </DVT2>
+<U0>280.633249 </U0>
+<UA>-1.208537E-9 </UA>
+<UB>2.158625E-18</UB>
+<UC>5.342807E-11 </UC>
+<VSAT>9.366802E4</VSAT>
+<A0>1.7593146 </A0>
+<AGS>0.3939741 </AGS>
+<B0>-6.413949E-9 </B0>
+<B1>-1E-7 </B1>
+<KETA>-5.180424E-4</KETA>
+<A1>0 </A1>
+<A2>1 </A2>
+<RDSW>105.5517558</RDSW>
+<PRWG>0.5 </PRWG>
+<PRWB>-0.1998871 </PRWB>
+<WR>1 </WR>
+<WINT>7.904732E-10 </WINT>
+<LINT>1.571424E-8 </LINT>
+<XL>0</XL>
+<XW>-1E-8 </XW>
+<DWG>1.297221E-9 </DWG>
+<DWB>1.479041E-9</DWB>
+<VOFF>-0.0955434 </VOFF>
+<NFACTOR>2.4358891 </NFACTOR>
+<CIT>0 </CIT>
+<CDSC>2.4E-4 </CDSC>
+<CDSCD>0</CDSCD>
+<CDSCB>0 </CDSCB>
+<ETA0>=3.104851E-3 </ETA0>
+<ETAB>-2.512384E-5 </ETAB>
+<DSUB>0.0167075 </DSUB>
+<PCLM>0.8073191 </PCLM>
+<PDIBLC1>0.1666161 </PDIBLC1>
+<PDIBLC2>3.112892E-3 </PDIBLC2>
+<PDIBLCB>-0.1 </PDIBLCB>
+<DROUT>0.7875618 </DROUT>
+<PSCBE1>8E10 </PSCBE1>
+<PSCBE2>9.213635E-10 </PSCBE2>
+<PVAG>3.85243E-3 </PVAG>
+<DELTA>0.01 </DELTA>
+<RSH>6.7 </RSH>
+<MOBMOD>1</MOBMOD>
+<PRT>0 </PRT>
+<UTE>-1.5 </UTE>
+<KT1>-0.11 </KT1>
+<KT1L>0 </KT1L>
+<KT2>0.022 </KT2>
+<UA1>4.31E-9 </UA1>
+<UB1>-7.61E-18 </UB1>
+<UC1>-5.6E-11 </UC1>
+<AT>3.3E4 </AT>
+<WL>0 </WL>
+<WLN>1</WLN>
+<WW>0 </WW>
+<WWN>1 </WWN>
+<WWL>0 </WWL>
+<LL>0 </LL>
+<LLN>1 </LLN>
+<LW>0 </LW>
+<LWN>1 </LWN>
+<LWL>0 </LWL>
+<CAPMOD>2 </CAPMOD>
+<XPART>0.5 </XPART>
+<CGDO>7.08E-10 </CGDO>
+<CGSO>7.08E-10 </CGSO>/
+<CGBO>1E-12</CGBO>
+<CJ>9.68858E-4 </CJ>
+<PB>0.8 </PB>
+<MJ>0.3864502 </MJ>
+<CJSW>2.512138E-10 </CJSW>
+<PBSW>0.809286 </PBSW>
+<MJSW>0.1060414 </MJSW>
+<CJSWG>3.3E-10 </CJSWG>
+<PBSWG>0.809286 </PBSWG>
+<MJSWG>0.1060414 </MJSWG>
+<CF>0 </CF>
+<PVTH0>-1.192722E-3 </PVTH0>
+<PRDSW>-5 </PRDSW>
+<PK2>6.450505E-5 </PK2>
+<WKETA>-4.27294E-4 </WKETA>
+<LKETA>-0.0104078 </LKETA>
+<PU0>6.3268729 </PU0>
+<PUA>2.226552E-11 </PUA>
+<PUB>0 </PUB>
+<PVSAT>969.1480157</PVSAT>
+<PETA0>1E-4 </PETA0>
+<PKETA>-1.049509E-3</PKETA>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/NMOS-5um.lib b/src/deviceModelLibrary/Templates/NMOS-5um.lib
new file mode 100755
index 00000000..a237e1fe
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NMOS-5um.lib
@@ -0,0 +1,5 @@
+* 5um technology
+
+.model mos_n NMOS( Cgso=0.4n Tox=85n Vto=1 phi=0.7
++ Level=1
++ Mj=.5 UO=750 Cgdo=0.4n Gamma=1.4 LAMBDA=0.01 LD=0.7u JS=1u CJ=0.4m CJSW=0.8n MJSW=0.5 PB=0.7 CGBO=0.2n )
diff --git a/src/deviceModelLibrary/Templates/NMOS-5um.xml b/src/deviceModelLibrary/Templates/NMOS-5um.xml
new file mode 100644
index 00000000..a72abbf1
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NMOS-5um.xml
@@ -0,0 +1,24 @@
+<library>
+<model_name>NMOS</model_name>
+<refrence>mos_n</refrence>
+<param>
+<Cgso>0.4n</Cgso>
+<Tox>85n</Tox>
+<Vto>1</Vto>
+<phi>0.7</phi>
+<Level>1</Level>
+<Mj>.5</Mj>
+<UO>750</UO>
+<Cgdo>0.4n</Cgdo>
+<Gamma>1.4</Gamma>
+<LAMBDA>0.01 </LAMBDA>
+<LD>0.7u </LD>
+<JS>1u </JS>
+<CJ>0.4m</CJ>
+<CJSW>0.8n</CJSW>
+<MJSW>0.5 </MJSW>
+<PB>0.7</PB>
+<CGBO>0.2n</CGBO>
+
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/NPN.lib b/src/deviceModelLibrary/Templates/NPN.lib
new file mode 100755
index 00000000..6509fe7a
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NPN.lib
@@ -0,0 +1,4 @@
+.model Q2N2222 NPN( Is=14.34f Xti=3 Eg=1.11 Vaf=74.03 Bf=400 Ne=1.307
++ Ise=14.34f Ikf=.2847 Xtb=1.5 Br=6.092 Nc=2 Isc=0 Ikr=0 Rc=1 Cjc=7.306p
++ Mjc=.3416 Vjc=.75 Fc=.5 Cje=22.01p Mje=.377 Vje=.75 Tr=46.91n Tf=411.1p
++ Itf=.6 Vtf=1.7 Xtf=3 Rb=10)
diff --git a/src/deviceModelLibrary/Templates/NPN.xml b/src/deviceModelLibrary/Templates/NPN.xml
new file mode 100644
index 00000000..f0679885
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/NPN.xml
@@ -0,0 +1,33 @@
+<library>
+<model_name>NPN</model_name>
+<refrence>Q2N2222</refrence>
+<param>
+<Is>14.34f </Is>
+<Xti>3 </Xti>
+<Eg>1.11 </Eg>
+<Vaf>74.03 </Vaf>
+<Bf>400 </Bf>
+<Ne>1.307 </Ne>
+<Ise>14.34f </Ise>
+<Ikf>.2847 </Ikf>
+<Xtb>1.5 </Xtb>
+<Br>6.092 </Br>
+<Nc>2 </Nc>
+<Isc>0 </Isc>
+<Ikr>0 </Ikr>
+<Rc>1 </Rc>
+<Cjc>7.306p </Cjc>
+<Mjc>.3416 </Mjc>
+<Vjc>.75 </Vjc>
+<Fc>.5 </Fc>
+<Cje>22.01p </Cje>
+<Mje>.377 </Mje>
+<Vje>.75 </Vje>
+<Tr>46.91n </Tr>
+<Tf>411.1p </Tf>
+<Itf>.6 </Itf>
+<Vtf>1.7 </Vtf>
+<Xtf>3 </Xtf>
+<Rb>10 </Rb>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/PIGBT.lib b/src/deviceModelLibrary/Templates/PIGBT.lib
new file mode 100755
index 00000000..d4f9e814
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PIGBT.lib
@@ -0,0 +1,10 @@
+.MODEL IXGH40N60 PIGBT (
++ TAU=287.56E-9
++ KP=50.034
++ AREA=37.500E-6
++ AGD=18.750E-6
++ VT=4.1822
++ KF=.36047
++ CGS=31.942E-9
++ COXD=53.188E-9
++ VTD=2.6570)
diff --git a/src/deviceModelLibrary/Templates/PIGBT.xml b/src/deviceModelLibrary/Templates/PIGBT.xml
new file mode 100644
index 00000000..2e316860
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PIGBT.xml
@@ -0,0 +1,15 @@
+<library>
+<model_name>PIGBT</model_name>
+<refrence>IXGH40N60</refrence>
+<param>
+<TAU>287.56E-9</TAU>
+<KP>50.034</KP>
+<AREA>37.500E-6</AREA>
+<AGD>18.750E-6</AGD>
+<VT>4.1822</VT>
+<KF>.36047</KF>
+<CGS>31.942E-9</CGS>
+<COXD>53.188E-9</COXD>
+<VTD>2.6570 </VTD>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/PJF.lib b/src/deviceModelLibrary/Templates/PJF.lib
new file mode 100755
index 00000000..5589571d
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PJF.lib
@@ -0,0 +1,5 @@
+.model J2N3820 PJF(Beta=1.304m Betatce=-.5 Rd=1 Rs=1 Lambda=2.25m Vto=-3
++ Vtotc=-2.5m Is=33.57f Isr=322.4f N=1 Nr=2 Xti=3 Alpha=311.7u
++ Vk=243.6 Cgd=1.6p M=.3622 Pb=1 Fc=.5 Cgs=2.414p Kf=9.882E-18
++ Af=1)
+
diff --git a/src/deviceModelLibrary/Templates/PJF.xml b/src/deviceModelLibrary/Templates/PJF.xml
new file mode 100644
index 00000000..05184f6f
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PJF.xml
@@ -0,0 +1,27 @@
+<library>
+<model_name>PJF</model_name>
+<refrence>J2N3820</refrence>
+<param>
+<Beta>1.304m </Beta>
+<Betatce>-.5</Betatce>
+<Rd>1 </Rd>
+<Rs>1 </Rs>
+<Lambda>2.25m</Lambda>
+<Vto>-3</Vto>
+<Vtotc>-2.5m </Vtotc>
+<Is>33.57f </Is>
+<Isr>322.4f</Isr>
+<N>1 </N>
+<Nr>2 </Nr>
+<Xti>3 </Xti>
+<Alpha>311.7u</Alpha>
+<Vk>243.6 </Vk>
+<Cgd>1.6p </Cgd>
+<M>.3622 </M>
+<Pb>1 </Pb>
+<Fc>.5 </Fc>
+<Cgs>2.414p </Cgs>
+<Kf>9.882E-18</Kf>
+<Af>1</Af>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/PMOS-0.5um.lib b/src/deviceModelLibrary/Templates/PMOS-0.5um.lib
new file mode 100755
index 00000000..848e8b05
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PMOS-0.5um.lib
@@ -0,0 +1,6 @@
+.model mos_p PMOS( TPG=-1 TOX=9.5n CJ=950u ETA=0.025 VMAX=0.3u
++ GAMMA=0.52 CGSO=0.35n LD=70n MJSW=0.25 PB=1
++ CGBO=0.45n XJ=0.2U CGDO=0.35n KAPPA=8.0 LEVEL=3
++ VTO=-0.6 NFS=6.50E11 THETA=0.2 CJSW=0.2n PHI=0.7
++ RSH=2.5 MJ=0.5 UO=130 KP=48u DELTA=0.25
++ NSUB=1.0E17 ) \ No newline at end of file
diff --git a/src/deviceModelLibrary/Templates/PMOS-0.5um.xml b/src/deviceModelLibrary/Templates/PMOS-0.5um.xml
new file mode 100644
index 00000000..a4555169
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PMOS-0.5um.xml
@@ -0,0 +1,32 @@
+<library>
+<model_name>PMOS</model_name>
+<refrence>mos_p</refrence>
+<param>
+<TPG>-1 </TPG>
+<TOX>9.5n </TOX>
+<CJ>950u </CJ>
+<ETA>0.025 </ETA>
+<VMAX>0.3u </VMAX>
+<GAMMA>0.52 </GAMMA>
+<CGSO>0.35n </CGSO>
+<LD>70n </LD>
+<MJSW>0.25 </MJSW>
+<PB>1 </PB>
+<CGBO>0.45n </CGBO>
+<XJ>0.2U </XJ>
+<CGDO>0.35n </CGDO>
+<KAPPA>8.0 </KAPPA>
+<LEVEL>3 </LEVEL>
+<VTO>-0.6 </VTO>
+<NFS>6.50E11 </NFS>
+<THETA>0.2 </THETA>
+<CJSW>0.2n </CJSW>
+<PHI>0.7 </PHI>
+<RSH>2.5 </RSH>
+<MJ>0.5</MJ>
+<UO>130 </UO>
+<KP>48u </KP>
+<DELTA>0.25 </DELTA>
+<NSUB>1.0E17</NSUB>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/PMOS-180nm.lib b/src/deviceModelLibrary/Templates/PMOS-180nm.lib
new file mode 100755
index 00000000..032b5b95
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PMOS-180nm.lib
@@ -0,0 +1,11 @@
+.model CMOSP PMOS (LEVEL=8 VERSION=3.2 TNOM=27 TOX=4.1E-9 XJ=1E-7 NCH=4.1589E17 VTH0=-0.3938813 K1=0.5479015
++ K2=0.0360586 K3=0.0993095 K3B=5.7086622 W0=1E-6 NLX=1.313191E-7 DVT0W=0 DVT1W=0 DVT2W=0 DVT0=0.4911363
++ DVT1=0.2227356 DVT2=0.1 U0=115.6852975 UA=1.505832E-9 UB=1E-21 UC=-1E-10 VSAT=1.329694E5 A0=1.7590478
++ AGS=0.3641621 B0=3.427126E-7 B1=1.062928E-6 KETA=0.0134667 A1=0.6859506 A2=0.3506788 RDSW=168.5705677
++ PRWG=0.5 PRWB=-0.4987371 WR=1 WINT=0 LINT=3.028832E-8 XL=0 XW=-1E-8 DWG=-2.349633E-8 DWB=-7.152486E-9
++ VOFF=-0.0994037 NFACTOR=1.9424315 CIT=0 CDSC=2.4E-4 CDSCD=0 CDSCB=0 ETA0=0.0608072 ETAB=-0.0426148
++ DSUB=0.7343015 PCLM=3.2579974 PDIBLC1=7.229527E-6 PDIBLC2=0.025389 PDIBLCB=-1E-3 DROUT=0 PSCBE1=1.454878E10
++ PSCBE2=4.202027E-9 PVAG=15 DELTA=0.01 RSH=7.8 MOBMOD=1 PRT=0 UTE=-1.5 KT1=-0.11 KT1L=0 KT2=0.022 UA1=4.31E-9
++ UB1=-7.61E-18 UC1=-5.6E-11 AT=3.3E4 WL=0 WLN=1 WW=0 WWN=1 WWL=0 LL=0 LLN=1 LW=0 LWN=1 LWL=0 CAPMOD=2 XPART=0.5
++ CGDO=6.32E-10 CGSO=6.32E-10 CGBO=1E-12 CJ=1.172138E-3 PB=0.8421173 MJ=0.4109788 CJSW=2.242609E-10 PBSW=0.8 + MJSW=0.3752089 CJSWG=4.22E-10 PBSWG=0.8 MJSWG=0.3752089 CF=0 PVTH0=1.888482E-3 PRDSW=11.5315407 PK2=1.559399E-3
++ WKETA=0.0319301 LKETA=2.955547E-3 PU0=-1.1105313 PUA=-4.62102E-11 PUB=1E-21 PVSAT=50 PETA0=1E-4 PKETA=-4.346368E-3)
diff --git a/src/deviceModelLibrary/Templates/PMOS-180um.xml b/src/deviceModelLibrary/Templates/PMOS-180um.xml
new file mode 100644
index 00000000..99916972
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PMOS-180um.xml
@@ -0,0 +1,112 @@
+<library>
+<model_name>PMOS</model_name>
+<refrence>CMOSP</refrence>
+<param>
+<LEVEL>8 </LEVEL>
+<VERSION>3.2 </VERSION>
+<TNOM>27 </TNOM>
+<TOX>4.1E-9 </TOX>
+<XJ>1E-7 </XJ>
+<NCH>4.1589E17 </NCH>
+<VTH0>-0.3938813 </VTH0>
+<K1>0.5479015</K1>
+<K2>0.0360586 </K2>
+<K3>0.0993095 </K3>
+<K3B>5.7086622</K3B>
+<W0>1E-6 </W0>
+<NLX>1.313191E-7 </NLX>
+<DVT0W>0 </DVT0W>
+<DVT1W>0 </DVT1W>
+<DVT2W>0 </DVT2W>
+<DVT0>0.4911363</DVT0>
+<DVT1>0.2227356</DVT1>
+<DVT2>0.1 </DVT2>
+<U0>115.6852975 </U0>
+<UA>1.505832E-9</UA>
+<UB>1E-21 </UB>
+<UC>-1E-10 </UC>
+<VSAT>1.329694E5 </VSAT>
+<A0>1.7590478 </A0>
+<AGS>0.3641621 </AGS>
+<B0>3.427126E-7 </B0>
+<B1>1.062928E-6 </B1>
+<KETA>0.0134667 </KETA>
+<A1>0.6859506 </A1>
+<A2>0.3506788 </A2>
+<RDSW>168.5705677</RDSW>
+<PRWG>0.5 </PRWG>
+<PRWB>-0.4987371 </PRWB>
+<WR>1 </WR>
+<WINT>0 </WINT>
+<LINT>3.028832E-8 </LINT>
+<XL>0 </XL>
+<XW>-1E-8 </XW>
+<DWG>-2.349633E-8 </DWG>
+<DWB>-7.152486E-9 </DWB>
+<VOFF>-0.0994037 </VOFF>
+<NFACTOR>1.9424315 </NFACTOR>
+<CIT>0 </CIT>
+<CDSC>2.4E-4 </CDSC>
+<CDSCD>0 </CDSCD>
+<CDSCB>0 </CDSCB>
+<ETA0>0.0608072 </ETA0>
+<ETAB>-0.0426148</ETAB>
+<DSUB>0.7343015 </DSUB>
+<PCLM>3.2579974 </PCLM>
+<PDIBLC1>7.229527E-6 </PDIBLC1>
+<PDIBLC2>0.025389 </PDIBLC2>
+<PDIBLCB>-1E-3 </PDIBLCB>
+<DROUT>0 </DROUT>
+<PSCBE1>1.454878E10</PSCBE1>
+<PSCBE2>4.202027E-9 </PSCBE2>
+<PVAG>15 </PVAG>
+<DELTA>0.01 </DELTA>
+<RSH>7.8 </RSH>
+<MOBMOD>1 </MOBMOD>
+<PRT>0 </PRT>
+<UTE>-1.5 </UTE>
+<KT1>-0.11 </KT1>
+<KT1L>0 </KT1L>
+<KT2>0.022 </KT2>
+<UA1>4.31E-9</UA1>
+<UB1>-7.61E-18 </UB1>
+<UC1>-5.6E-11 </UC1>
+<AT>3.3E4 </AT>
+<WL>0 </WL>
+<WLN>1 </WLN>
+<WW>0 </WW>
+<WWN>1 </WWN>
+<WWL>0 </WWL>
+<LL>0 </LL>
+<LLN>1 </LLN>
+<LW>0 </LW>
+<LWN>1 </LWN>
+<LWL>0 </LWL>
+<CAPMOD>2 </CAPMOD>
+<XPART>0.5</XPART>
+<CGDO>6.32E-10 </CGDO>
+<CGSO>6.32E-10 </CGSO>
+<CGBO>1E-12 </CGBO>
+<CJ>1.172138E-3 </CJ>
+<PB>0.8421173 </PB>
+<MJ>0.4109788 </MJ>
+<CJSW>2.242609E-10 </CJSW>
+<PBSW>0.8</PBSW>
+<MJSW>0.3752089 </MJSW>
+<CJSWG>4.22E-10 </CJSWG>
+<PBSWG>0.8 </PBSWG>
+<MJSWG>0.3752089 </MJSWG>
+<CF>0 </CF>
+<PVTH0>1.888482E-3 </PVTH0>
+<PRDSW>11.5315407 </PRDSW>
+<PK2>1.559399E-3 </PK2>
+<WKETA>0.0319301 </WKETA>
+<LKETA>2.955547E-3 </LKETA>
+<PU0>-1.1105313 </PU0>
+<PUA>-4.62102E-11</PUA>
+<PUB>1E-21 </PUB>
+<PVSAT>50 </PVSAT>
+<PETA0>1E-4 </PETA0>
+<PKETA>-4.346368E-3 </PKETA>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/PMOS-5um.lib b/src/deviceModelLibrary/Templates/PMOS-5um.lib
new file mode 100755
index 00000000..9c3ed976
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PMOS-5um.lib
@@ -0,0 +1,5 @@
+*5um technology
+
+.model mos_p PMOS( Cgso=0.4n Tox=85n Vto=-1 phi=0.65
++ Level=1
++ Mj=.5 UO=250 Cgdo=0.4n Gamma=0.65 LAMBDA=0.03 LD=0.6u JS=1u CJ=0.18m CJSW=0.6n MJSW=0.5 PB=0.7 CGBO=0.2n )
diff --git a/src/deviceModelLibrary/Templates/PMOS-5um.xml b/src/deviceModelLibrary/Templates/PMOS-5um.xml
new file mode 100644
index 00000000..b82c5ae6
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PMOS-5um.xml
@@ -0,0 +1,23 @@
+<library>
+<model_name>PMOS</model_name>
+<refrence>mos_p</refrence>
+<param>
+<Cgso>0.4n </Cgso>
+<Tox>85n </Tox>
+<Vto>-1 </Vto>
+<phi>0.65</phi>
+<Level>1</Level>
+<Mj>.5 </Mj>
+<UO>250 </UO>
+<Cgdo>0.4n </Cgdo>
+<Gamma>0.65 </Gamma>
+<LAMBDA>0.03 </LAMBDA>
+<LD>0.6u </LD>
+<JS>1u </JS>
+<CJ>0.18m </CJ>
+<CJSW>0.6n </CJSW>
+<MJSW>0.5 </MJSW>
+<PB>0.7 </PB>
+<CGBO>0.2n</CGBO>
+</param>
+</library>
diff --git a/src/deviceModelLibrary/Templates/PNP.lib b/src/deviceModelLibrary/Templates/PNP.lib
new file mode 100755
index 00000000..7edda0ea
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PNP.lib
@@ -0,0 +1,4 @@
+.model Q2N2907A PNP(Is=650.6E-18 Xti=3 Eg=1.11 Vaf=115.7 Bf=231.7 Ne=1.829
++ Ise=54.81f Ikf=1.079 Xtb=1.5 Br=3.563 Nc=2 Isc=0 Ikr=0 Rc=.715
++ Cjc=14.76p Mjc=.5383 Vjc=.75 Fc=.5 Cje=19.82p Mje=.3357 Vje=.75
++ Tr=111.3n Tf=603.7p Itf=.65 Vtf=5 Xtf=1.7 Rb=10)
diff --git a/src/deviceModelLibrary/Templates/PNP.xml b/src/deviceModelLibrary/Templates/PNP.xml
new file mode 100644
index 00000000..a25276a9
--- /dev/null
+++ b/src/deviceModelLibrary/Templates/PNP.xml
@@ -0,0 +1,33 @@
+<library>
+<model_name>PNP</model_name>
+<refrence>Q2N2907A</refrence>
+<param>
+<Is>650.6E-18</Is>
+<Xti>3 </Xti>
+<Eg>1.11 </Eg>
+<Vaf>115.7 </Vaf>
+<Bf>231.7 </Bf>
+<Ne>1.829</Ne>
+<Ise>54.81f </Ise>
+<Ikf>1.079 </Ikf>
+<Xtb>1.5 </Xtb>
+<Br>3.563 </Br>
+<Nc>2 </Nc>
+<Isc>0 </Isc>
+<Ikr>0</Ikr>
+<Rc>.715</Rc>
+<Cjc>14.76p </Cjc>
+<Mjc>.5383 </Mjc>
+<Vjc>.75 </Vjc>
+<Fc>.5 </Fc>
+<Cje>19.82p </Cje>
+<Mje>.3357 </Mje>
+<Vje>.75</Vje>
+<Tr>111.3n </Tr>
+<Tf>603.7p </Tf>
+<Itf>.65 </Itf>
+<Vtf>5 </Vtf>
+<Xtf>1.7 </Xtf>
+<Rb>10</Rb>
+</param>
+</library>
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 7f00e7a7..ca9471c6 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -26,7 +26,6 @@ from projManagement.Kicad import Kicad
from frontEnd import ProjectExplorer
import Workspace
import DockArea
-
import os
import sys
import time
@@ -106,6 +105,9 @@ class Application(QtGui.QMainWindow):
self.pcb = QtGui.QAction(QtGui.QIcon('../images/pcb.png'),'<b>PCB Layout</b>',self)
self.pcb.triggered.connect(self.obj_kicad.openLayout)
+
+ self.model = QtGui.QAction(QtGui.QIcon('../images/model.png'),'<b>Model Editor</b>',self)
+ self.model.triggered.connect(self.open_modelEditor)
#Adding Action Widget to tool bar
self.lefttoolbar = QtGui.QToolBar('Left ToolBar')
@@ -115,6 +117,7 @@ class Application(QtGui.QMainWindow):
self.lefttoolbar.addAction(self.ngspice)
self.lefttoolbar.addAction(self.footprint)
self.lefttoolbar.addAction(self.pcb)
+ self.lefttoolbar.addAction(self.model)
self.lefttoolbar.setOrientation(QtCore.Qt.Vertical)
def new_project(self):
@@ -205,6 +208,14 @@ class Application(QtGui.QMainWindow):
print "Current Project : ",self.obj_appconfig.current_project
#self.obj_Mainview.obj_dockarea.plottingEditor()
+
+ def open_modelEditor(self):
+ print "model editor is called"
+ self.obj_Mainview.obj_dockarea.modelEditor()
+
+ def testing(self):
+ print "Success hit kicad button"
+
class MainView(QtGui.QWidget):
"""
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py
index 875b3b90..76216aa6 100644
--- a/src/frontEnd/DockArea.py
+++ b/src/frontEnd/DockArea.py
@@ -2,6 +2,7 @@ from PyQt4 import QtGui,QtCore
from ngspiceSimulation.pythonPlotting import plotWindow
from ngspiceSimulation.NgspiceWidget import NgspiceWidget
from configuration.Appconfig import Appconfig
+from modelEditor.ModelEditor import ModelEditorclass
import os
dockList = ['Welcome']
@@ -107,6 +108,28 @@ class DockArea(QtGui.QMainWindow):
dock['NgSpice-'+str(count)].raise_()
count = count + 1
+
+ def modelEditor(self):
+ print"in model editor"
+ global count
+ self.modelwidget = QtGui.QWidget()
+
+ self.modellayout = QtGui.QVBoxLayout()
+ self.modellayout.addWidget(ModelEditorclass())
+
+ #Adding to main Layout
+ self.modelwidget.setLayout(self.modellayout)
+
+ dock['Model Editor-'+str(count)] = QtGui.QDockWidget('Model Editor-'+str(count))
+ dock['Model Editor-'+str(count)].setWidget(self.modelwidget)
+ self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Model Editor-'+str(count)])
+ self.tabifyDockWidget(dock['Welcome'],dock['Model Editor-'+str(count)])
+
+ dock['Model Editor-'+str(count)].setVisible(True)
+ dock['Model Editor-'+str(count)].setFocus()
+ dock['Model Editor-'+str(count)].raise_()
+
+ count = count + 1
diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py
new file mode 100644
index 00000000..0ce32a61
--- /dev/null
+++ b/src/modelEditor/ModelEditor.py
@@ -0,0 +1,415 @@
+from PyQt4 import QtGui, QtCore
+from PyQt4.Qt import QTableWidgetItem
+import xml.etree.ElementTree as ET
+import os
+
+class ModelEditorclass(QtGui.QWidget):
+ def __init__(self):
+ QtGui.QWidget.__init__(self)
+ self.savepathtest = '../deviceModelLibrary'
+ self.newflag=0
+ self.layout = QtGui.QVBoxLayout()
+ self.splitter= QtGui.QSplitter()
+ self.grid= QtGui.QGridLayout()
+ self.splitter.setOrientation(QtCore.Qt.Vertical)
+
+ self.newbtn = QtGui.QPushButton('New')
+ self.newbtn.clicked.connect(self.opennew)
+ self.editbtn = QtGui.QPushButton('Edit')
+ self.editbtn.clicked.connect(self.openedit)
+ self.savebtn = QtGui.QPushButton('Save')
+ self.savebtn.setDisabled(True)
+ self.savebtn.clicked.connect(self.savemodelfile)
+ self.removebtn = QtGui.QPushButton('Remove')
+ self.removebtn.setHidden(True)
+ self.removebtn.clicked.connect(self.removeparameter)
+ self.addbtn = QtGui.QPushButton('Add')
+ self.addbtn.setHidden(True)
+ self.addbtn.clicked.connect(self.addparameters)
+ #self.splitter.addWidget(self.newbtn)
+ self.grid.addWidget(self.newbtn, 1,2)
+ self.grid.addWidget(self.editbtn, 1,3)
+ self.grid.addWidget(self.savebtn, 1,4)
+ self.grid.addWidget(self.removebtn, 8,4)
+ self.grid.addWidget(self.addbtn, 5,4)
+
+ self.radiobtnbox = QtGui.QButtonGroup()
+ self.diode = QtGui.QRadioButton('Diode')
+ self.diode.setDisabled(True)
+ self.bjt = QtGui.QRadioButton('BJT')
+ self.bjt.setDisabled(True)
+ self.mos = QtGui.QRadioButton('MOS')
+ self.mos.setDisabled(True)
+ self.jfet = QtGui.QRadioButton('JFET')
+ self.jfet.setDisabled(True)
+ self.igbt = QtGui.QRadioButton('IGBT')
+ self.igbt.setDisabled(True)
+ self.magnetic = QtGui.QRadioButton('Magnetic Core')
+ self.magnetic.setDisabled(True)
+
+ self.radiobtnbox.addButton(self.diode)
+ self.diode.clicked.connect(self.diode_click)
+ self.radiobtnbox.addButton(self.bjt)
+ self.bjt.clicked.connect(self.bjt_click)
+ self.radiobtnbox.addButton(self.mos)
+ self.mos.clicked.connect(self.mos_click)
+ self.radiobtnbox.addButton(self.jfet)
+ self.jfet.clicked.connect(self.jfet_click)
+ self.radiobtnbox.addButton(self.igbt)
+ self.igbt.clicked.connect(self.igbt_click)
+ self.radiobtnbox.addButton(self.magnetic)
+ self.magnetic.clicked.connect(self.magnetic_click)
+
+ self.types= QtGui.QComboBox()
+ self.types.setHidden(True)
+
+ self.grid.addWidget(self.types,2,2,2,3)
+ self.grid.addWidget(self.diode, 3,1)
+ self.grid.addWidget(self.bjt,4,1)
+ self.grid.addWidget(self.mos,5,1)
+ self.grid.addWidget(self.jfet,6,1)
+ self.grid.addWidget(self.igbt,7,1)
+ self.grid.addWidget(self.magnetic,8,1)
+
+ #self.layout.addWidget(self.splitter)
+ self.setLayout(self.grid)
+ #self.setLayout(self.layout)
+ self.show()
+
+ '''To create New Model file '''
+ def opennew(self):
+ self.addbtn.setHidden(True)
+ try:
+ self.modeltable.setHidden(True)
+ except:
+ pass
+ text, ok = QtGui.QInputDialog.getText(self, 'New Model','Enter Model Name:')
+ if ok:
+ self.newflag=1
+ self.diode.setDisabled(False)
+ self.bjt.setDisabled(False)
+ self.mos.setDisabled(False)
+ self.jfet.setDisabled(False)
+ self.igbt.setDisabled(False)
+ self.magnetic.setDisabled(False)
+ self.modelname = (str(text))
+ else:
+ pass
+
+ self.validation(text)
+
+ def diode_click(self):
+ self.openfiletype('Diode')
+ self.types.setHidden(True)
+ '''
+ self.types.clear()
+ self.types.addItem('Diode')
+ filetype = str(self.types.currentText())
+ self.types.activated[str].connect(self.setfiletype)
+ '''
+ def bjt_click(self):
+ self.types.setHidden(False)
+ self.types.clear()
+ self.types.addItem('NPN')
+ self.types.addItem('PNP')
+ filetype = str(self.types.currentText())
+ self.openfiletype(filetype)
+ self.types.activated[str].connect(self.setfiletype)
+
+ def mos_click(self):
+ self.types.setHidden(False)
+ self.types.clear()
+ self.types.addItem('NMOS(Level-1 5um)')
+ self.types.addItem('NMOS(Level-3 0.5um)')
+ self.types.addItem('NMOS(Level-8 180um)')
+ self.types.addItem('PMOS(Level-1 5um)')
+ self.types.addItem('PMOS(Level-3 0.5um)')
+ self.types.addItem('PMOS(Level-8 180um)')
+ filetype = str(self.types.currentText())
+ self.openfiletype(filetype)
+ self.types.activated[str].connect(self.setfiletype)
+
+ def jfet_click(self):
+ self.types.setHidden(False)
+ self.types.clear()
+ self.types.addItem('N-JFET')
+ self.types.addItem('P-JFET')
+ filetype = str(self.types.currentText())
+ self.openfiletype(filetype)
+ self.types.activated[str].connect(self.setfiletype)
+
+ def igbt_click(self):
+ self.types.setHidden(False)
+ self.types.clear()
+ self.types.addItem('N-IGBT')
+ self.types.addItem('P-IGBT')
+ filetype = str(self.types.currentText())
+ self.openfiletype(filetype)
+ self.types.activated[str].connect(self.setfiletype)
+
+ def magnetic_click(self):
+ self.openfiletype('Magnetic Core')
+ self.types.setHidden(True)
+ '''
+ self.types.clear()
+ self.types.addItem('Magnetic Core')
+ filetype = str(self.types.currentText())
+ self.types.activated[str].connect(self.setfiletype)
+ '''
+ def setfiletype(self,text):
+ self.filetype = str(text)
+ self.openfiletype(self.filetype)
+
+ '''Select the path of the file to be opened depending upon selected file type '''
+ def openfiletype(self,filetype):
+ self.path = '../deviceModelLibrary/Templates'
+ if self.diode.isChecked():
+ if filetype == 'Diode':
+ path = os.path.join(self.path,'D.xml')
+ self.createtable(path)
+ if self.bjt.isChecked():
+ if filetype == 'NPN':
+ path = os.path.join(self.path,'NPN.xml')
+ self.createtable(path)
+ elif filetype == 'PNP':
+ path = os.path.join(self.path, 'PNP.xml')
+ self.createtable(path)
+ if self.mos.isChecked():
+ if filetype == 'NMOS(Level-1 5um)':
+ path = os.path.join(self.path, 'NMOS-5um.xml')
+ self.createtable(path)
+ elif filetype == 'NMOS(Level-3 0.5um)':
+ path = os.path.join(self.path, 'NMOS-0.5um.xml')
+ self.createtable(path)
+ elif filetype == 'NMOS(Level-8 180um)':
+ path = os.path.join(self.path, 'NMOS-180nm.xml')
+ self.createtable(path)
+ elif filetype == 'PMOS(Level-1 5um)':
+ path = os.path.join(self.path, 'PMOS-5um.xml')
+ self.createtable(path)
+ elif filetype == 'PMOS(Level-3 0.5um)':
+ path = os.path.join(self.path, 'PMOS-0.5um.xml')
+ self.createtable(path)
+ elif filetype == 'PMOS(Level-8 180um)':
+ path = os.path.join(self.path, 'PMOS-180nm.xml')
+ self.createtable(path)
+ if self.jfet.isChecked():
+ if filetype == 'N-JFET':
+ path = os.path.join(self.path, 'NJF.xml')
+ self.createtable(path)
+ elif filetype == 'P-JFET':
+ path = os.path.join(self.path, 'PJF.xml')
+ self.createtable(path)
+ if self.igbt.isChecked():
+ if filetype == 'N-IGBT':
+ path = os.path.join(self.path, 'NIGBT.xml')
+ self.createtable(path)
+ elif filetype == 'P-IGBT':
+ path = os.path.join(self.path, 'PIGBT.xml')
+ self.createtable(path)
+ if self.magnetic.isChecked():
+ if filetype == 'Magnetic Core':
+ path = os.path.join(self.path, 'CORE.xml')
+ self.createtable(path)
+ else :
+ pass
+
+ def openedit(self):
+ self.newflag=0
+ self.addbtn.setHidden(True)
+ self.types.setHidden(True)
+ self.diode.setDisabled(True)
+ self.mos.setDisabled(True)
+ self.jfet.setDisabled(True)
+ self.igbt.setDisabled(True)
+ self.bjt.setDisabled(True)
+ self.magnetic.setDisabled(True)
+ self.editfile=str(QtGui.QFileDialog.getOpenFileName(self))
+ #self.path='/home/workspace/eSim/src/deviceModelLibrary/Diode'
+ self.createtable(self.editfile)
+
+ '''Creates the model table by parsinf th .xml file '''
+ def createtable(self, modelfile):
+ self.savebtn.setDisabled(False)
+ self.addbtn.setHidden(False)
+ self.removebtn.setHidden(False)
+ self.modelfile = modelfile
+ self.modeldict = {}
+ self.modeltable = QtGui.QTableWidget()
+ self.modeltable.resizeColumnsToContents()
+ self.modeltable.setColumnCount(2)
+ self.modeltable.resizeRowsToContents()
+ self.modeltable.resize(200,200)
+ self.grid.addWidget(self.modeltable, 3,2,8,2)
+
+ self.tree = ET.parse(self.modelfile)
+ self.root= self.tree.getroot()
+ for elem in self.tree.iter(tag='refrence'):
+ self.reference = elem.text
+ for elem in self.tree.iter(tag='model_name'):
+ self.model_name = elem.text
+ row=0
+ for params in self.tree.findall('param'):
+ for paramlist in params:
+ self.modeldict[paramlist.tag]= paramlist.text
+ row= row+1
+ self.modeltable.setRowCount(row)
+ count =0
+ for tags, values in self.modeldict.items():
+ self.modeltable.setItem(count,0, QTableWidgetItem(tags))
+ try:
+ valueitem = QTableWidgetItem(values)
+ except:
+ pass
+ self.modeltable.setItem(count,1, valueitem)
+ count= count +1
+ self.modeltable.setHorizontalHeaderLabels(QtCore.QString("Parameters;Values").split(";"))
+ self.modeltable.show()
+ self.modeltable.itemChanged.connect(self.edit_modeltable)
+
+ def edit_modeltable(self):
+ self.savebtn.setDisabled(False)
+ try:
+ indexitem = self.modeltable.currentItem()
+ name = str(indexitem.data(0).toString())
+ rowno = indexitem.row()
+ para = self.modeltable.item(rowno,0)
+ val = str(para.data(0).toString())
+ self.modeldict[val]= name
+ except:
+ pass
+
+ ''' new parameters can be added in the table '''
+ def addparameters(self):
+ text1, ok = QtGui.QInputDialog.getText(self, 'Parameter','Enter Parameter')
+ if ok:
+ if text1 in self.modeldict.keys():
+ self.msg = QtGui.QErrorMessage(self)
+ self.msg.showMessage("The paramaeter " + text1 + " is already in the list")
+ self.msg.setWindowTitle("Error Message")
+ return
+ text2, ok = QtGui.QInputDialog.getText(self, 'Value','Enter Value')
+ if ok :
+ currentRowCount = self.modeltable.rowCount()
+ self.modeltable.insertRow(currentRowCount)
+ self.modeltable.setItem(currentRowCount, 0, QTableWidgetItem(text1))
+ self.modeltable.setItem(currentRowCount, 1, QTableWidgetItem(text2))
+ self.modeldict[str(text1)]= str(text2)
+ else:
+ pass
+ else:
+ pass
+
+
+ def savemodelfile(self):
+ if self.newflag== 1:
+ self.createXML(self.model_name)
+ else:
+ self.savethefile(self.editfile)
+
+ '''creates an .xml an .lib files from the model table'''
+ def createXML(self,model_name):
+ root = ET.Element("library")
+ ET.SubElement(root, "model_name").text = model_name
+ ET.SubElement(root, "refrence").text = self.modelname
+ param = ET.SubElement(root, "param")
+ for tags, text in self.modeldict.items():
+ ET.SubElement(param, tags).text = text
+ tree = ET.ElementTree(root)
+ defaultcwd = os.getcwd()
+ self.savepath = '../deviceModelLibrary'
+ if self.diode.isChecked():
+ savepath = os.path.join(self.savepath, 'Diode')
+ os.chdir(savepath)
+ txtfile = open(self.modelname+'.lib', 'w')
+ txtfile.write('.MODEL ' + self.modelname +' ' + self.model_name + '(\n' )
+ for tags, text in self.modeldict.items():
+ txtfile.write('+ ' + tags + ' = ' + text +'\n')
+ txtfile.write(')')
+ tree.write(self.modelname +".xml")
+ if self.mos.isChecked():
+ savepath = os.path.join(self.savepath, 'MOS')
+ os.chdir(savepath)
+ txtfile = open(self.modelname+'.lib', 'w')
+ txtfile.write('.MODEL ' + self.modelname +' ' + self.model_name + '(\n' )
+ for tags, text in self.modeldict.items():
+ txtfile.write('+ ' + tags + ' = ' + text +'\n')
+ txtfile.write(')')
+ tree.write(self.modelname +".xml")
+ if self.jfet.isChecked():
+ savepath = os.path.join(self.savepath, 'JFET')
+ os.chdir(savepath)
+ txtfile = open(self.modelname+'.lib', 'w')
+ txtfile.write('.MODEL ' + self.modelname +' ' + self.model_name + '(\n' )
+ for tags, text in self.modeldict.items():
+ txtfile.write('+ ' + tags + ' = ' + text +'\n')
+ txtfile.write(')')
+ tree.write(self.modelname +".xml")
+ if self.igbt.isChecked():
+ savepath = os.path.join(self.savepath, 'IGBT')
+ os.chdir(savepath)
+ txtfile = open(self.modelname+'.lib', 'w')
+ txtfile.write('.MODEL ' + self.modelname +' ' + self.model_name + '(\n' )
+ for tags, text in self.modeldict.items():
+ txtfile.write('+ ' + tags + ' = ' + text +'\n')
+ txtfile.write(')')
+ tree.write(self.modelname +".xml")
+ if self.magnetic.isChecked():
+ savepath = os.path.join(self.savepath, 'Misc')
+ os.chdir(savepath)
+ txtfile = open(self.modelname+'.lib', 'w')
+ txtfile.write('.MODEL ' + self.modelname +' ' + self.model_name + '(\n' )
+ for tags, text in self.modeldict.items():
+ txtfile.write('+ ' + tags + ' = ' + text +'\n')
+ txtfile.write(')')
+ tree.write(self.modelname +".xml")
+ if self.bjt.isChecked():
+ savepath = os.path.join(self.savepath, 'Transistor')
+ os.chdir(savepath)
+ txtfile = open(self.modelname+'.lib', 'w')
+ txtfile.write('.MODEL ' + self.modelname +' ' + self.model_name + '(\n' )
+ for tags, text in self.modeldict.items():
+ txtfile.write('+ ' + tags + ' = ' + text +'\n')
+ txtfile.write(')')
+ tree.write(self.modelname +".xml")
+ txtfile.close()
+ os.chdir(defaultcwd)
+
+ '''Checks if the file with the name already exists'''
+ def validation(self,text):
+ newfilename = text+'.xml'
+ all_dir = [x[0] for x in os.walk(self.savepathtest)]
+ for each_dir in all_dir:
+ all_files = os.listdir(each_dir)
+ if newfilename in all_files:
+ self.msg = QtGui.QErrorMessage(self)
+ self.msg.showMessage('The file with name ' + text+ ' already exists.')
+ self.msg.setWindowTitle("Error Message")
+
+ '''save the editing in the model table '''
+ def savethefile(self,editfile):
+
+ xmlpath, file = os.path.split(editfile)
+ filename = os.path.splitext(file)[0]
+ libpath = os.path.join(xmlpath,filename+'.lib')
+ libfile = open(libpath, 'w')
+ libfile.write('.MODEL ' + self.reference +' ' + self.model_name + '(\n' )
+ for tags, text in self.modeldict.items():
+ libfile.write('+ ' + tags + ' = ' + text +'\n')
+ libfile.write(')')
+ libfile.close()
+ for params in self.tree.findall('param'):
+ self.root.remove(params)
+ param = ET.SubElement(self.root,'param')
+ for tags, text in self.modeldict.items():
+ ET.SubElement(param, tags).text = text
+ self.tree.write(editfile)
+
+ def removeparameter(self):
+ self.savebtn.setDisabled(False)
+ index = self.modeltable.currentIndex()
+ param = index.data().toString()
+ remove_item = self.modeltable.item(index.row(),0).text()
+ self.modeltable.removeRow(index.row())
+ del self.modeldict[str(remove_item)]
+ \ No newline at end of file
diff --git a/src/modelEditor/__init__.py b/src/modelEditor/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/modelEditor/__init__.py