diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/deviceModelLibrary/Diode/1n4007.lib | 2 | ||||
-rwxr-xr-x | src/deviceModelLibrary/Diode/1n4148.lib | 2 | ||||
-rw-r--r-- | src/deviceModelLibrary/Templates/NMOS-180um.xml | 112 | ||||
-rw-r--r-- | src/deviceModelLibrary/Templates/PMOS-180um.xml | 112 | ||||
-rw-r--r-- | src/kicadtoNgspice/Convert.py | 29 | ||||
-rw-r--r-- | src/kicadtoNgspice/DeviceModel.py | 2 |
6 files changed, 23 insertions, 236 deletions
diff --git a/src/deviceModelLibrary/Diode/1n4007.lib b/src/deviceModelLibrary/Diode/1n4007.lib deleted file mode 100755 index 89d421d8..00000000 --- a/src/deviceModelLibrary/Diode/1n4007.lib +++ /dev/null @@ -1,2 +0,0 @@ -.model 1n4007 D( IS=7.02767e-09 RS=0.0341512 N=1.80803 EG=1.05743 XTI=5 BV=1000 IBV=5e-08 CJO=1E-11 -+VJ=0.7 M=0.5 FC=0.5 TT=1E-07 KF=0 AF=1 ) diff --git a/src/deviceModelLibrary/Diode/1n4148.lib b/src/deviceModelLibrary/Diode/1n4148.lib deleted file mode 100755 index b32fdf86..00000000 --- a/src/deviceModelLibrary/Diode/1n4148.lib +++ /dev/null @@ -1,2 +0,0 @@ -.model 1n4148 D( Is=2.495E-09 Rs=4.755E-01 n=1.679 tt=3.030E-09 Cjo=1.700E-12 M=1.959E-01 -+ Vj=1 Bv=1.000E+02 ibv=1.000E-04 ) diff --git a/src/deviceModelLibrary/Templates/NMOS-180um.xml b/src/deviceModelLibrary/Templates/NMOS-180um.xml deleted file mode 100644 index fc3b7a47..00000000 --- a/src/deviceModelLibrary/Templates/NMOS-180um.xml +++ /dev/null @@ -1,112 +0,0 @@ -<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/PMOS-180um.xml b/src/deviceModelLibrary/Templates/PMOS-180um.xml deleted file mode 100644 index 99916972..00000000 --- a/src/deviceModelLibrary/Templates/PMOS-180um.xml +++ /dev/null @@ -1,112 +0,0 @@ -<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/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index ca14d83f..b7d61c12 100644 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -2,7 +2,7 @@ import os import sys import shutil import TrackWidget - +from xml.etree import ElementTree as ET class Convert: """ @@ -176,7 +176,7 @@ class Convert: if self.value == '': return 0 else: - pass + self.value def addModelParameter(self,schematicInfo): @@ -309,7 +309,8 @@ class Convert: libname = tempStr[0] dimension = tempStr[1] #Replace last word with library name - words[-1] = libname.split('.')[0] + #words[-1] = libname.split('.')[0] + words[-1] = self.getRefrenceName(libname,libpath) #Appending Dimension of MOSFET words.append(dimension) deviceLine[index] = words @@ -320,7 +321,8 @@ class Convert: shutil.copy2(src, dst) else: #Replace last word with library name - words[-1] = libname.split('.')[0] + #words[-1] = libname.split('.')[0] + words[-1] = self.getRefrenceName(libname,libpath) deviceLine[index] = words includeLine.append(".include "+libname) @@ -342,10 +344,23 @@ class Convert: #Adding .include line to Schematic Info at the start of line for item in list(set(includeLine)): schematicInfo.insert(0,item) - - - + return schematicInfo + + def getRefrenceName(self,libname,libpath): + libname = libname.replace('.lib','.xml') + library = os.path.join(libpath,libname) + + #Extracting Value from XML + libtree = ET.parse(library) + for child in libtree.iter(): + if child.tag == 'refrence': + retVal = child.text + else: + pass + return retVal + +
\ No newline at end of file diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py index 4866437a..0ae421b6 100644 --- a/src/kicadtoNgspice/DeviceModel.py +++ b/src/kicadtoNgspice/DeviceModel.py @@ -193,7 +193,7 @@ class DeviceModel(QtGui.QWidget): #print "Object Called is ",sending_btn.objectName() self.widgetObjCount = int(sending_btn.objectName()) - self.libfile = str(QtGui.QFileDialog.getOpenFileName(self,"Open Library Directory","../deviceModelLibrary")) + self.libfile = str(QtGui.QFileDialog.getOpenFileName(self,"Open Library Directory","../deviceModelLibrary","*.lib")) #print "Selected Library File :",self.libfile #Setting Library to Text Edit Line |