Update : if anyone of you is facing the similar error, just change your sky130A files permission to ...
m
Update : if anyone of you is facing the similar error, just change your sky130A files permission to rwx via chmod 777 .include statement keeps failing. Any help?
a
need the spice to debug. My guess: you forgot to escape the "
m
**.subckt inv_tran Vin Vin GND pulse(0 1.8 0 1ns 1ns 4ns 10ns) Vdd Vdd GND 1.8 x1 Vdd Vout Vin GND inv_1 ** begin user architecture code .lib /usr/local/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt .include /home/harshit/.xschem/inv.spice .tran 100ps 20ns .save all .end ** end user architecture code **.ends * expanding symbol: /home/harshit/.xschem/inv_1.sym # of pins=4 * sym_path: /home/harshit/.xschem/inv_1.sym * sch_path: /home/harshit/.xschem/inv_1.sch .subckt inv_1 Vdd Vout Vin VSS *.ipin Vdd *.ipin VSS *.opin Vout *.ipin Vin XM1 Vout Vin VSS VSS sky130_fd_pr__nfet_01v8 L=0.30 W=3.0 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29' + pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W' + sa=0 sb=0 sd=0 mult=1 m=1 XM2 Vout Vin Vdd Vdd sky130_fd_pr__pfet_01v8 L=0.30 W=3.0 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29' + pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W' + sa=0 sb=0 sd=0 mult=1 m=1 .ends .GLOBAL GND .end
Here it is
a
Try properly escaping "
m
Sorry I don't get it
This is for SQL, but principle is the same.
m
But I don;t have a path in a string in my case
Should I put that path in a string
?
a
You need to modify the xschem, so the .include is a proper statement in the result SPICE. To do this the path has to be between "" <- two double quotes. For this to happen in xschem declaration containing the .include the " <- has to exist and its content has to be escaped. " -> inside string becomds \"
m
Okay let me try again
Well nothing worked.
a
Could you share the spice, xschem and error agian?
m
I am not using Xschem. It's just a normal spice netlist that uses another netlist as a subcircuit
Lemme share that
a
Why do you have the subckt declared AND included? It's strange.
m
Oh btw, i have shared the netlist code above
a
Yeah I can see it. Try putting .include "some_path" in the netlist. Does it work?
m
Nope it did not
Actually it's an error on my professor's pc
he has the ngspice36 installed and it is throwing him this error
and he did not use xschem for that
a
Post the updated netlist + error, so I can take a look
also check if the path actually exists. It's a strange path for me.
m
Okay wait!, I mean if that was a path error, it would throw directory not found or something along that line
a
or maybe not.
m
** sch_path: /home/harshit/.xschem/inv_tran.sch **.subckt inv_tran Vin Vin GND pulse(0 1.8 0 1ns 1ns 4ns 10ns) Vdd Vdd GND 1.8 x1 Vdd Vout Vin GND inv_1 ** begin user architecture code .lib /usr/local/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt # .include "/home/harshit/.xschem/inv.spice" .tran 100ps 20ns .save all .end ** end user architecture code **.ends * expanding symbol: /home/harshit/.xschem/inv_1.sym # of pins=4 ** sym_path: /home/harshit/.xschem/inv_1.sym ** sch_path: /home/harshit/.xschem/inv_1.sch .subckt inv_1 Vdd Vout Vin VSS *.ipin Vdd *.ipin VSS *.opin Vout *.ipin Vin XM3 Vout Vin VSS VSS sky130_fd_pr__nfet_01v8_lvt L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29' + pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W' + sa=0 sb=0 sd=0 mult=1 m=1 XM1 Vout Vin Vdd Vdd sky130_fd_pr__pfet_01v8 L=0.15 W=1 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29' + pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W' + sa=0 sb=0 sd=0 mult=1 m=1 .ends .GLOBAL GND .end
error is : ERROR: .include statement failed. ERROR: fatal error in ngspice, exit(1)
a
1. Why do you have #. Its not a way to comment in spice. It's *
2, You didnt check if path exists. And it is strange that after puttin #, you still got the error you got. Maybe check which spice you are running in ngspice?
m
for number two, I did check and the path exists, So how can I check the version of spice in ngspice
can you please guide me for that
a
Which SPICE netlist file you are running. Is it the same as the one you are editing? Try just removing the content of SPICE netlist, does it magically not error out?
m
I did, and as I said, it's an error on my professor's pc. We are trying to debug it together and he is not on slack so. We have tried commenting out the .include line, * <- this character was used this time. I made sure that the location exists and also that the file we are editing is the same as the one we are running on spice
Also, I have a similar setup on my pc and it runs smoooothly in that, without quotes even
ALso he is getting .include error even if there is just a .lib statement in the file
is this a ngspice error?
we have tried version 28-36
a
If I had to guess. You are using wrong netlist. It's not NGSPICE issue.
"ALso he is getting .include error even if there is just a .lib statement in the file" ... which suggests that you are using wrong netlist
Try removing content of netlist competly. Does it still error out?
m
well, the errors are gone and spice runs nothing(as I would expect off an empty netlist)
Screenshot from 2022-02-27 21-01-27.png
Professor got the same things
a
Now put the content of netlist back. Remove the comment for .include. put double quotes for .lib.
Also: Stop changing the enviorment. I am trying to identify the problem.
m
Sorry
Nothing changes
same as before
a
Post error message and netlist. I am just checking that it's correct.
m
Wait asking him for it
**.subckt inv_tran Vin Vin GND pulse (0 1.8 0 1ns 1ns 4ns 10ns) Vdd Vdd GND 1.8 x1 Vdd Vout Vin GND inv_1 ** begin user architecture code .lib "/usr/local/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice" TT .include "/home/shailesh/mayank/inv.spice" .tran 100ps 20ns .save all .end ** end user architecture code **.ends * expanding symbol: /home/harshit/.xschem/inv_1.sym # of pins=4 * sym_path: /home/harshit/.xschem/inv_1.sym * sch_path: /home/harshit/.xschem/inv_1.sch .subckt inv_1 Vdd Vout Vin VSS *.ipin Vdd *.ipin VSS *.opin Vout *.ipin Vin XM1 Vout Vin VSS VSS sky130_fd_pr__nfet_01v8 L=0.30 W=3.0 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29' + pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W' + sa=0 sb=0 sd=0 mult=1 m=1 XM2 Vout Vin Vdd Vdd sky130_fd_pr__pfet_01v8 L=0.30 W=3.0 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29' + pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W' + sa=0 sb=0 sd=0 mult=1 m=1 .ends .GLOBAL GND .end
IMG-20220227-WA0014.jpg
And I really appreciate you taking time to help us with this
a
You changed the paths and the libs' case... It's hard to help you, because everytime I am trying to take a step forward you go in totally different direction. You need to: check the files. Check for every path to exist. Check the netlist. THEN check the NGSPICE. Go line by line checking if the NGSPICE does not crash. The moment it crashes is the reason. Wild guess: spaces cause issues. Another guess: YOu dont even need the .include since the subckt is already declared below... If I had to guess is that you are editing a different file than you are running or have syntax error in included file.
m
Sorry, but The above netlist I sent you is the one my professor is working on and about the path, we have checked the file and the path and the netlist as well. We have been trying to rectify this for the past two hours and have done everything, we have even placed all these files inside the sky130/ngspice folder as well. I have checked everything, the files the folders, the location the netlist...
All of this works on my system but not on his
And yes, that is why I commented the .include file since the subckt exists at the bottom, yet, the .lib caused the error. IT was the same netlist, since I am opening it inside the ngspice, using edit inv_tran.spice
error is the same as what the image at the top attached
a
Oh okay. It seems that it might be incorrect PDK installation? Try leaving only .lib.
Keep in mind, you are not allowed to move the PDK installation. And it needs to be reasonbaly new. There is no reason to not use latest version, or at least mpw-5c version.
💯 1
m
It is the latest version since, we reinstalled the whole os and software today at 6pm(IST), then started our brainstorming session.
same issue persists, the infamous .include statement failed
I guess reinstalling everything again 😂
What bugs me is, I installed the helped him install the thing the same way I did on my machine, I don;t see this error and even not having quotes work fine. But his pc seems to run into the .include error a lot
a
Did you try leaving only .lib?
m
Yes, I removed the .include line and only left the .lib line
a
Please post the sky130.json for your and the Professor's.
m
**.subckt inv_tran Vin Vin GND pulse (0 1.8 0 1ns 1ns 4ns 10ns) Vdd Vdd GND 1.8 x1 Vdd Vout Vin GND inv_1 ** begin user architecture code .lib "/usr/local/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice" TT .tran 100ps 20ns .save all .end ** end user architecture code **.ends * expanding symbol: /home/harshit/.xschem/inv_1.sym # of pins=4 * sym_path: /home/harshit/.xschem/inv_1.sym * sch_path: /home/harshit/.xschem/inv_1.sch .subckt inv_1 Vdd Vout Vin VSS *.ipin Vdd *.ipin VSS *.opin Vout *.ipin Vin XM1 Vout Vin VSS VSS sky130_fd_pr__nfet_01v8 L=0.30 W=3.0 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29' + pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W' + sa=0 sb=0 sd=0 mult=1 m=1 XM2 Vout Vin Vdd Vdd sky130_fd_pr__pfet_01v8 L=0.30 W=3.0 nf=1 ad='int((nf+1)/2) * W/nf * 0.29' as='int((nf+2)/2) * W/nf * 0.29' + pd='2*int((nf+1)/2) * (W/nf + 0.29)' ps='2*int((nf+2)/2) * (W/nf + 0.29)' nrd='0.29 / W' nrs='0.29 / W' + sa=0 sb=0 sd=0 mult=1 m=1 .ends .GLOBAL GND .end
a
It's where you installed the PDK. This contains info on used sky130 json. If they are not 100% matching we might know the reason
m
So should I compare my professor's nodeinfojson to mine?
a
yes.
It contains the version of sky130
m
Okay, doing that asap
a
sky130 something something .json
m
we both have different builds: mine is open_pdk : "1.0.238" his is open_pdk : "1.0.289"
he is reinstalling it. Thank you for your time and effort. If anything happens I will let you know
a
well. Now we identified that the issue might be in open pdk. Try using the ones from mpw-5c: export SKYWATER_COMMIT=c094b6e83a4f9298e47f696ec5a7fd53535ec5ebexport OPEN_PDKS_COMMIT=7519dfb04400f224f140749cda44ee7de6f5e095export PDK_MAGIC_COMMIT=7d601628e4e05fd17fcb80c3552dacb64e9f6e7bexport OPENLANE_TAG=2022.02.23_02.50.41
m
OKAY! SENDING HIM THESE
I am so stressed over this, I am sure it is something minor
a
m
Forwarding this now 😅
He's offline now, if he gives me an update I will send it here.
s
I see other users with the same issue, and i believe it is something going wrong inside the spice models, after the top .lib statement. Some lower level .include does not work. I can not reproduce this error since my open_pdks installation is 10 days old, however i will eventually update my installs here and check. @User
t
Sorry, I've been on travel since yesterday so I missed most of this conversation---I need to catch up on the thread and then figure out if there is something wrong in open_pdks. I did check in changes to open_pdks as recently as this morning, although I don't think any of them would specifically affect the SPICE model files.
m
My professor figured it out, he just changed the permission of all the folders in sky130A to rwx. @User @User But you know what's strange, i did not had to do that, for me it was just install and use.
a
I see the same include error. Using open_pdks from Sun Feb 26 4pm: https://github.com/RTimothyEdwards/open_pdks/commit/c82996fd68365fb014b70354b9663cf041ec416e
Going to try pulling open_pdks and reinstalling
m
@User try changing the permissions of your sky130A folder
a
did no luck, except I am using sky130B paths. Could try .lib with the sky130A path.
👍 1
Oh wait it worked! My bad I didn’t realize we needed a recursive chmod…
👍 1
m
Awesome. It was a surprise to me as well, changing permission of literally everything in that parent folder.
1
a
for reference all I did was sudo chmod -R 777 pdk (after cd’ing into the pdk path under /usr)
Thanks a tonne!
😁 1
m
I think it would be a better solution, to add this statement in the pdk install shell script itself. Would make it a lot easier.
a
https://github.com/RTimothyEdwards/open_pdks/issues/230 Could you provide more details here?
t
Are you people serious??? There is no way that a SPICE library needs executable permission. Plus, giving root executable permission to something in the root path is something that should make alarm bells go off in the head of any Linux user.
m
How about just read write permissions/ so chmod -R 666 ?
t
Do not give library files write permission, either.
👍 1
m
Still learning about linux so not sure about the vulnerabilities actually
t
I am also seeing an error when attempting to run ngspice on xschem examples, but it appears to come from the line
.lib $::SKYWATER_MODELS/sky130.lib.spice tt
in the schematic. xschem is translating it to
.lib ::SKYWATER_MODELS/sky130.lib.spice tt
when it writes the netlist, rather than substituting the variable. Possibly I just need to update xschem, which I haven't tried yet.
s
@User If this issue persist let me know. Currently code symbols contain a netlisting rule set as
format="tcleval( @value )"
and value set as:
value=".lib $::SKYWATER_MODELS/sky130.lib.spice tt"
So if a tcl global variable
SKYWATER_MODELS
exists it will be substituted. Ensure the tcleval(...) is present in the format attribute, so the content will be passed down to tcl for evaluation.
t
@User: Sorry, I lost track of where this thread was, because I was intending to give an update. I pulled the most recent version of xschem and the problem I had went away. The problem (or problems) being reported were unrelated, and stemmed from some scripts in open_pdks having hard-coded references to the sky130A variant that needed to be fixed. Otherwise, some of the sky130B processing would overwrite files in sky130A and make a big mess of things. The pushes I made to open_pdks yesterday should clear this up.
👍 2
s
Thanks, @User, yes the thread was veeery long i also had some difficulties to get to the root point.