summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice/Convert.py
diff options
context:
space:
mode:
authorRahul P2022-08-29 16:42:20 +0530
committerGitHub2022-08-29 16:42:20 +0530
commit2843e73ed81ac0bb5e685a5f1e045babb67083f0 (patch)
tree04bb912a0a08a1062cc02ec6ae01791045b0e786 /src/kicadtoNgspice/Convert.py
parent076d3b293fd6e19ca3785a73c9ce6f228892bf13 (diff)
parentd21e1405e29a3d3a1766f23bb469ec6edf575235 (diff)
downloadeSim-2843e73ed81ac0bb5e685a5f1e045babb67083f0.tar.gz
eSim-2843e73ed81ac0bb5e685a5f1e045babb67083f0.tar.bz2
eSim-2843e73ed81ac0bb5e685a5f1e045babb67083f0.zip
Merge pull request #218 from Eyantra698Sumanto/sky130-dev
Added more Sky130 Libraries
Diffstat (limited to 'src/kicadtoNgspice/Convert.py')
-rwxr-xr-xsrc/kicadtoNgspice/Convert.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py
index 7d68e44e..c1209cd3 100755
--- a/src/kicadtoNgspice/Convert.py
+++ b/src/kicadtoNgspice/Convert.py
@@ -550,11 +550,37 @@ class Convert:
shutil.copy2(src, dst)
elif eachline[0:6] == 'scmode':
+ (filepath, filemname) = os.path.split(self.clarg1)
+ self.Fileopen = os.path.join(filepath, ".spiceinit")
+ print("======================================================")
+ print("Writing to the .spiceinit file to make ngspice SKY130 compatible")
+ self.writefile = open(self.Fileopen, "w")
+ self.writefile.write('''
+set ngbehavior=hsa ; set compatibility for reading PDK libs
+set ng_nomodcheck ; don't check the model parameters
+set num_threads=8 ; CPU hardware threads available
+option noinit ; don't print operating point data
+optran 0 0 0 100p 2n 0 ; don't use dc operating point, but transient op)
+''')
+ print("======================================================")
+
tempStr = completeLibPath.split(':')
print(tempStr)
+ libs = '''
+sky130_fd_pr__model__diode_pd2nw_11v0.model.spice
+sky130_fd_pr__model__diode_pw2nd_11v0.model.spice
+sky130_fd_pr__model__inductors.model.spice
+sky130_fd_pr__model__linear.model.spice
+sky130_fd_pr__model__pnp.model.spice
+sky130_fd_pr__model__r+c.model.spice
+'''
includeLine.append(
".lib \"" + tempStr[0] + "\" " + tempStr[1])
- deviceLine[index] = '*scmode'
+ for i in libs.split():
+ includeLine.append(
+ ".include \"" + tempStr[0].replace(
+ "sky130.lib.spice", i) + "\"")
+ deviceLine[index] = "*scmode"
# words.append(completeLibPath)
# deviceLine[index] = words