From 600ffa6b9f5a78ac461a21c2d2df9f2aaa14c74b Mon Sep 17 00:00:00 2001 From: Eyantra698Sumanto Date: Fri, 26 Aug 2022 20:17:41 +0530 Subject: Added more Sky130 Libraries --- src/kicadtoNgspice/Convert.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/kicadtoNgspice/Convert.py') diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index 7d68e44e..d27583aa 100755 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -552,9 +552,20 @@ class Convert: elif eachline[0:6] == 'scmode': 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 -- cgit From 91c016cfe4af419615bf9d24f786618f16777473 Mon Sep 17 00:00:00 2001 From: Eyantra698Sumanto Date: Fri, 26 Aug 2022 20:28:25 +0530 Subject: Fixed Pep8 issues --- src/kicadtoNgspice/Convert.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/kicadtoNgspice/Convert.py') diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index d27583aa..c8d767ec 100755 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -553,18 +553,18 @@ class Convert: 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__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]) for i in libs.split(): - includeLine.append(".include \"" + tempStr[0].replace("sky130.lib.spice",i) + "\"") + includeLine.append( + ".include \"" + tempStr[0].replace( + "sky130.lib.spice", i) + "\"") deviceLine[index] = "*scmode" # words.append(completeLibPath) # deviceLine[index] = words -- cgit From ea6ddbaf93100f8ff88412955020daf4c458e21a Mon Sep 17 00:00:00 2001 From: Eyantra698Sumanto Date: Fri, 26 Aug 2022 20:30:20 +0530 Subject: Fixed Pep8 issues --- src/kicadtoNgspice/Convert.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/kicadtoNgspice/Convert.py') diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index c8d767ec..a4f9e642 100755 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -552,7 +552,8 @@ class Convert: elif eachline[0:6] == 'scmode': tempStr = completeLibPath.split(':') print(tempStr) - libs = '''sky130_fd_pr__model__diode_pd2nw_11v0.model.spice + 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 -- cgit From d21e1405e29a3d3a1766f23bb469ec6edf575235 Mon Sep 17 00:00:00 2001 From: Eyantra698Sumanto Date: Mon, 29 Aug 2022 14:59:02 +0530 Subject: Added the .spiceinit generation commands --- src/kicadtoNgspice/Convert.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/kicadtoNgspice/Convert.py') diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index a4f9e642..c1209cd3 100755 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -550,6 +550,20 @@ 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 = ''' -- cgit