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') 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') 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') 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 a653afe64c75a66c0b64600d492f7375e4ac6601 Mon Sep 17 00:00:00 2001 From: Eyantra698Sumanto Date: Sun, 28 Aug 2022 15:14:38 +0530 Subject: Corrected the spelling of SKY130 --- src/kicadtoNgspice/DeviceModel.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py index c1eb5f90..604f814b 100755 --- a/src/kicadtoNgspice/DeviceModel.py +++ b/src/kicadtoNgspice/DeviceModel.py @@ -113,7 +113,7 @@ For more info please see the documentation''') beg = self.count self.deviceDetail[self.count] = "scmode1" sky130box.setTitle( - "Add parameters of sky130 library ") + "Add parameters of SKY130 library ") # + # " : " + # words[6]) @@ -201,14 +201,14 @@ sky130_fd_pr/models/sky130.lib.spice") and eachline[0] != 'a': print("Only components with designators 'sc', 'u', \ 'x', 'v', 'i', 'a'\ - can be used with sky130 mode") + can be used with SKY130 mode") print("Please remove other components") self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Invalid components") self.content = "Only components with designators " + \ "'sc', 'u' and 'x' can be used \ - with sky130 mode. " + \ + with SKY130 mode. " + \ "Please edit the schematic and \ generate netlist again" self.msg.showMessage(self.content) @@ -227,9 +227,9 @@ sky130_fd_pr/models/sky130.lib.spice") words[0] + " : " + words[-1]) path_name = '' - # Adding to get sky130 dimension + # Adding to get SKY130 dimension self.parameterLabel[self.count] = QtWidgets.QLabel( - "Enter the parameters of sky130 component " + words[0]) + "Enter the parameters of SKY130 component " + words[0]) sky130grid.addWidget( self.parameterLabel[self.count], self.row, 0) self.entry_var[self.count] = QtWidgets.QLineEdit() @@ -260,7 +260,7 @@ sky130_fd_pr/models/sky130.lib.spice") path_name = "" except BaseException as e: print("Error when set text of Device " + - "Sky130 Component :", str(e)) + "SKY130 Component :", str(e)) except BaseException: pass self.trackLibraryWithoutButton(self.count, path_name) -- 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') 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