https://open-source-silicon.dev logo
Channels
aa
abcc
activity
adiabatonauts
analog-design
announce
announcements
b2aws
b2aws-tutorial
bag
basebands
beagleboard
bluetooth
board-respin
cadence-genus
cadence-innovus
cadence-spectre
cadence-virtuoso
caravan
caravel
caravel-board
chilechipmakers
chip-yard
chipignite
chipignite2206q_stanford_bringup
chisel
coalition-for-digital-environmental-sustainability
community_denmark_dtu
containers
courses
design-review
design-services
dffram
digital-design
digital-electronics-learners
discord-mods
dynamic-power-estimation
efabless
electric
events
fasoc
fault
foss-asic-tools
fossee-iitb-esim
fossee-iitb-google-sky130
fpga
funding
fuserisc
general
generative-ai-silicon-challenge
genius-vlsi
gf180
gf180mcu
hardware-beginners
help-
ieee-sscs-cac-23
ieee-sscs-dc-21q3
ieee-sscs-dc-22
ieee-sscs-dc-23
ihp-sg13g2
images
infiniband
j-core
japan-region
junk
klayout
latam_vlsi
layouteditor
lvs
lvs-analysis
magic
magical
maker-projects
maker-zone
microwatt
mpw-2-silicon
mpw-one-clean-short
mpw-one-silicon
neuro-mem
nydesign
open_pdks
open-pdk
openadiabaticlogic
openfpga
openhighqualityresonators
openlane
openlane_cloudrunner
openlane-development
openocd
openpositarithmetic
openpower
openram
openroad
opentitan
osu
pa-test-chip
paracells
pd-openlane-and-sky130
picosoc
pll
popy_neel
power
private-shuttle
rad-lab-silicon
radio
rdircd
reram
researchers
rf-mmw-design
rios
riscv
sdram
serdes
shuttle
shuttle-precheck
shuttle-status
silicon-photonics
silicon-validation
silicon-validation-private
sky130
sky130-ci
sky130-pv-workshop
sky65
sky90
skywater
sram
stdcelllib
strive
swerv
system-verilog-learners
tapeout-job
tapeout-pakistan
team-awesome
timing-closure
toysram
travis-ci
uvm-learners
vendor-synopsys
venn
verification-be
verification-fe
verilog-learners
vh2v
vhdl
vhdl-learners
vliw
vlsi_verilog_using_opensource_eda
vlsi_verilog_using_opensoure_eda
vlsi-learners-group
vlsi101
waveform-viewers
xls
xschem
xyce
zettascale
Powered by
Title
m

Morris Frazier

03/14/2023, 3:46 AM
Hi all, I'm trying to simulate a ring oscillator in xschem (actually ngspice). In the ngspice console, I get:
Checking parameters for BSIM 4.5 model x3.xm1:sky130_fd_pr__nfet_01v8__model.25
Fatal: Pclm = -0.0968433 is not positive.
Fatal: Drout = -0.261499 is negative.
Warning: Cdscd = -0.00649389 is negative.
Warning: Eta0 = -0.0934787 is negative.
Fatal error: detected during BSIM4v5.5.0 parameter checking for 
    model x3.xm1:sky130_fd_pr__nfet_01v8__model.25 of device instance m.x3.xm1.msky130_fd_pr__nfet_01v8
I've tried 1 inverter and 3 inverters. I'm attaching PNG exports from xschem. Any advice appreciated.
a

Arman Avetisyan

03/14/2023, 5:06 AM
try checking for pdk versions. Is it up to date?
s

Stefan Schippers

03/14/2023, 9:08 AM
Please send the complete .spice netlist so I can run a test.
In some cases users were running an ancient version of ngspice. DO not use an ngspice installed with apt from the linux repositories, get ngspice from sourceforge repository as explained here.
m

Morris Frazier

03/14/2023, 11:12 AM
pdks are up to date for sure. ngspice was a distro provided version but not too far behind. have updated ngspice to latest git from sourceforge, but same/similar behavior as before. here is the generated netlist:
** sch_path: /home/user/work/inverter/xschem/inverter_multi_tb.sch
**.subckt inverter_multi_tb val
*.opin val
x1 val net2 inverter
x2 net1 val inverter
x3 net2 net1 inverter
V1 VDD GND 1.8
.save i(v1)
**** begin user architecture code

.lib /usr/local/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt



.ic V(val) 1
.control
save all
tran 1n 1u
plot V(val)
.endc

**** end user architecture code
**.ends

* expanding   symbol:  inverter.sym # of pins=2
** sym_path: /home/user/work/inverter/xschem/inverter.sym
** sch_path: /home/user/work/inverter/xschem/inverter.sch
.subckt inverter out inp
*.ipin inp
*.opin out
XM1 out inp GND GND sky130_fd_pr__nfet_01v8 L=0.18 W=4.5 nf=3 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 out inp VDD VDD sky130_fd_pr__pfet_01v8 L=0.18 W=3 nf=3 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
.GLOBAL VDD
.end
s

Stefan Schippers

03/14/2023, 11:22 AM
I copied your netlist, changed only the path for the
sky130.lib.spice
file which is different on my system and simulation did run with no errors. If you build and install ngspice from sources remember to remove the packaged ngspice installation (
sudo apt purge ngspice
) my open_pdks install is super new, updated yesterday, as well as ngspice.
m

Morris Frazier

03/14/2023, 2:47 PM
I get similar results at my end too when I invoke similarly
ngspice -i ~/.xschem/simulations/inverter_multi_tb.spice
. it still does not work when I press the
simulate
button in
xschem
though. the command line for
ngspice
seems the same up to
-a
option which just seem to trigger an irrelevant compatibility option. however the working directory varies between these - when I invoke ngspice manually from the schematic directory I get the good behavior but when I invoke it manually from
.xschem/simulations
I get the bad behavior similar to the button. update: if I soft-link the spice init file in the
simulations
directory it seems to work from the button too, though I wasn't expecting that to be necessary. resolved, thanks.
s

Stefan Schippers

03/14/2023, 5:06 PM
Good!. Yes whatever the directory you use for ngspice simulations you must provide or soft-link a .spiceinit file:
set ngbehavior=hsa
set ng_nomodcheck 
# set filetype=ascii
set num_threads=4