diff options
author | fahim-oscad | 2016-05-10 10:45:31 +0530 |
---|---|---|
committer | fahim-oscad | 2016-05-10 10:45:31 +0530 |
commit | 703b45855189130cb65f8fabf9d2fe5a54910e16 (patch) | |
tree | 74ba1852ee9b0cb5607b59f76653d8ce7952cdd5 /src | |
parent | 6c73f608fd6b4b3fec92cdc6c4842a5afc0a9d6f (diff) | |
download | eSim-703b45855189130cb65f8fabf9d2fe5a54910e16.tar.gz eSim-703b45855189130cb65f8fabf9d2fe5a54910e16.tar.bz2 eSim-703b45855189130cb65f8fabf9d2fe5a54910e16.zip |
Modifed JFET modelica model
Diffstat (limited to 'src')
-rw-r--r-- | src/ngspicetoModelica/Mapping.json | 14 | ||||
-rw-r--r-- | src/ngspicetoModelica/NgspicetoModelica.py | 14 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/ngspicetoModelica/Mapping.json b/src/ngspicetoModelica/Mapping.json index a75a8280..e254d66a 100644 --- a/src/ngspicetoModelica/Mapping.json +++ b/src/ngspicetoModelica/Mapping.json @@ -121,8 +121,8 @@ }, - "j":{ - "import":"Modelica.Electrical.Spice3.Semiconductors", + "j":{ + "import":"Spice3.Internal.JFET", "mapping":{ "kf":"KF", "rs":"RS", @@ -137,9 +137,9 @@ "cgs":"CGS", "lambda":"LAMBDA", "b" : "B" - - + }, + "default":{ "KF":"0", "RS":"0", @@ -157,11 +157,9 @@ } - } - - - }, + + }, "Models":{ diff --git a/src/ngspicetoModelica/NgspicetoModelica.py b/src/ngspicetoModelica/NgspicetoModelica.py index df165fa0..e9855e03 100644 --- a/src/ngspicetoModelica/NgspicetoModelica.py +++ b/src/ngspicetoModelica/NgspicetoModelica.py @@ -513,6 +513,7 @@ class NgMoConverter: elif deviceName=='j': trans = transInfo[words[4]] + """ if trans == 'njf': start = self.mappingData["Devices"][deviceName]["import"]+".J_NJFJFET" elif trans == 'pjf': @@ -520,8 +521,10 @@ class NgMoConverter: else: print "JFET "+str(trans)+" Not found" sys.exit(1) + """ + start = self.mappingData["Devices"][deviceName]["import"] - stat = start+" "+words[0]+"(" + stat = start+" "+words[0]+"(modelcard(" tempstatList=[] userDeviceParamList=[] refName = words[4] @@ -541,7 +544,7 @@ class NgMoConverter: defaultValue = self.mappingData["Devices"][deviceName]["default"][default] tempstatList.append(default+"="+self.getUnitVal(defaultValue)+" ") - stat += ",".join(str(item) for item in tempstatList)+");" + stat += ",".join(str(item) for item in tempstatList)+"));" modelicaCompInit.append(stat) @@ -786,6 +789,13 @@ class NgMoConverter: connInfo.append(conn) conn = 'connect(' + words[0] + '.E,' + nodeDic[words[3]] + ');' connInfo.append(conn) + elif eachline[0]=='j' or eachline[0]=='J': + conn = 'connect('+words[0]+'.D,' + nodeDic[words[1]]+');' + connInfo.append(conn) + conn = 'connect('+words[0]+'.G,' + nodeDic[words[2]]+');' + connInfo.append(conn) + conn = 'connect('+words[0]+'.S,' + nodeDic[words[3]]+');' + connInfo.append(conn) elif eachline[0]=='m' or eachline[0]=='M': conn = 'connect(' + words[0] + '.D,' + nodeDic[words[1]] + ');' connInfo.append(conn) |