summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ngspicetoModelica/Mapping.json14
-rw-r--r--src/ngspicetoModelica/NgspicetoModelica.py14
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)