Chris
02/01/2023, 10:40 PMStefan Schippers
02/02/2023, 10:12 AMsky130_fd_pr/corner.sym
. Specify the corner in its instance attributes (tt, ss, fs, ...) and this will provide to ngspice only the specified corner. For reasons we don't understand ngspice insists on parsing all corners, and this takes considerable time. On my laptop this makes ngspice start in 2 seconds.Chris
02/02/2023, 11:37 PMStefan Schippers
02/03/2023, 12:48 AMonly_toplevel=true
, so these code blocks will not be netlisted if not at the toplevel.Stefan Schippers
02/03/2023, 12:50 AMChris
02/06/2023, 7:06 PM.lib /usr/local/share/pdk/sky130A/libs.tech/ngspice/sky130.lib.spice tt
line which usually goes at the beginning of your spice script.Chris
02/08/2023, 7:09 PMStefan Schippers
02/09/2023, 11:38 AMset num_threads=4
. The .spiceinit
is the file that must be present in the directory where ngspice runs. it usually contains this:
set ngbehavior=hsa
set ng_nomodcheck
# set filetype=ascii
set num_threads=4
with this setting a long simulation show this in my computer:
top - 12:29:19 up 2:19, 7 users, load average: 1.91, 1.03, 0.75
Tasks: 213 total, 2 running, 211 sleeping, 0 stopped, 0 zombie
%Cpu(s): 84.2 us, 1.1 sy, 0.0 ni, 14.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 15881.4 total, 9008.8 free, 4467.2 used, 2900.6 buff/cache
MiB Swap: 17166.0 total, 17166.0 free, 0.0 used. 11414.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
11253 schippes 20 0 161168 123632 12192 R 331.2 0.8 0:20.70 ngspice
9604 schippes 20 0 2852780 372872 105420 S 5.0 2.3 3:30.21 Isolated +
You see ngspice is using 331% CPU, so it is using at least 4 threads. Ngspice uses more cpu if compiled with the --enable-openmp
flag and if using BSIM models that are OPENMP enabled. For example i tested a simulation on a design that uses old mos models that are not OPENMP enabled and cpu usage is capped at 100% (1 thread). Sky130 mos models are OPENMP aware so you can take advangare of this.Chris
02/09/2023, 11:37 PM