Boris Murmann
08/19/2024, 2:23 AM* old binned models
*.lib /foss/pdks/sky130A/libs.tech/ngspice/sky130.lib.spice tt
* new continuous models
.lib /foss/pdks/sky130A/libs.tech/combined/sky130.lib.spice tt
.param mc_mm_switch=0
.param lx=0.15 wx=162.5 nfx=40 idx=0.5m
.save @m.xm1a.msky130_fd_pr__nfet_01v8_lvt
XM1a d g s 0 sky130_fd_pr__nfet_01v8_lvt L={lx} W={wx} nf={nfx} 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
XM1b d g s 0 sky130_fd_pr__nfet_01v8_lvt L={lx} W={wx} nf={nfx} 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
vg g 0 1
vd d 0 1
is s 0 {2*idx}
.control
op
*show
print @m.xm1a.msky130_fd_pr__nfet_01v8_lvt[gm]
print @m.xm1a.msky130_fd_pr__nfet_01v8_lvt[cgg]
.endc
.end
Mitch Bailey
08/19/2024, 2:30 AM0fe599b2afb6708d281543108caf8310912f54af
open_pdks 1.0.493?Tim Edwards
08/19/2024, 1:51 PM0fe599b2afb6708d281543108caf8310912f54af
. I'm doing a full rebuild on my end and then try to figure out what's going on.Tim Edwards
08/19/2024, 2:00 PMHarald Pretl
08/19/2024, 2:54 PMTim Edwards
08/19/2024, 3:04 PMHarald Pretl
08/19/2024, 3:06 PMTim Edwards
08/19/2024, 3:07 PMTim Edwards
08/19/2024, 3:15 PMcat /foss/pdks/sky130A/libs.tech/combined/continuous/models_fet.spice | grep nf\ = | grep param
do you get this?:Tim Edwards
08/19/2024, 3:16 PM.param w = 5 l = 0.7 nf = 1 sa = 0 sb = 0 sd = 0
.param nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = 0 nrs = 0 sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w}
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w}
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param nf = 1 w = 5 l = 0.7 sa = 0 sb = 0 sd = 0
.param nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = 0 nrs = 0 sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
(Namely, nf = 1
should never be at the end of the .param line)Tim Edwards
08/19/2024, 3:23 PMHarald Pretl
08/19/2024, 3:38 PMHarald Pretl
08/19/2024, 3:40 PM2024.08
image we have `0fe599b2afb6708d281543108caf8310912f54af installed, that matches the above quoted one — check.Harald Pretl
08/19/2024, 3:42 PMcat /foss/pdks/sky130A/libs.tech/combined/continuous/models_fet.spice | grep nf\ = | grep param
, I get this:
/foss/designs > cat /foss/pdks/sky130A/libs.tech/combined/continuous/models_fet.spice | grep nf\ = | grep param
.param w = 5 l = 0.7 nf = 1 sa = 0 sb = 0 sd = 0
.param nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = 0 nrs = 0 sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w}
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w}
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param nf = 1 w = 5 l = 0.7 sa = 0 sb = 0 sd = 0
.param nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = 0 nrs = 0 sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
.param l = 1 w = 1 nf = 1 ad = 0 as = 0 pd = 0 ps = 0 nrd = {0.14/w} nrs = {0.14/w} sa = 0 sb = 0 sd = 0
Looks pretty similar to Tim’s output I would say.Harald Pretl
08/19/2024, 3:45 PMngspice test_boris.spice
I get all kind of weird errors, that also Boris reports. Running ngspice -n test_boris.spice
works fine. In our image, I have in the user home the following `.spiceinit`:
* Set to 4 threads, if not changed otherwise
set num_threads=4
* Load the PDK-specific .spiceinit
source $PDK_ROOT/$PDK/libs.tech/ngspice/.spiceinit
Harald Pretl
08/19/2024, 3:46 PM.spiceinit
the problem shows up. @Tim Edwards Could you please try to replicate?Tim Edwards
08/19/2024, 3:46 PMTim Edwards
08/19/2024, 3:48 PM.spiceinit
or with num_threads
set.Harald Pretl
08/19/2024, 3:52 PM.spiceinit
call in the user home. If I remove the file the error is gone. It is this line that triggers the error: source $PDK_ROOT/$PDK/libs.tech/ngspice/.spiceinit
Harald Pretl
08/19/2024, 3:55 PM* ngspice initialization for sky130
* assert BSIM compatibility mode with "nf" vs. "W"
set ngbehavior=hsa
* "nomodcheck" speeds up loading time
set ng_nomodcheck
set enable_noisy_r
@Tim Edwards could you please try this file?Harald Pretl
08/19/2024, 4:24 PMsource /foss/pdks/volare/sky130/versions/0fe599b2afb6708d281543108caf8310912f54af/sky130A/libs.tech/ngspice/.spiceinit
the error shows up (I did this test to check whether the symbolic link is the issue, but it is not.. the resolved path length is). If I now do this (sourcing the exact same file) everything is fine:
source /tmp/.spiceinit
So the issue is in ngspice of a buffer size somewhere, coupled with the volare PDK setup that causes pretty long path lengths due to the symbolic links.Harald Pretl
08/19/2024, 4:25 PMBoris Murmann
08/19/2024, 5:20 PMTim Edwards
08/20/2024, 12:49 AM~/.volare/
which avoids the versions/<long_hash_value>/
in the path. But it sounds like you gave it the symbolic link and it expanded it and then caused a buffer overrun. Or was it the expansion of $PDK_ROOT/$PDK
(I know that support of environment variables passed directly to ngspice is new, so more likely to have bugs not previously encountered by anyone)?
I'd say go ahead with the bug report.Harald Pretl
08/20/2024, 3:49 PMsource
statements in a .spiceinit
. I will provide an updated image which avoids this, I am currently in the build and test stage. This a very weird failure.