Merge branch 'pre-master-45' into bt_dev

This commit is contained in:
Brian Taylor 2024-12-31 17:30:00 -08:00
commit 0368a71f62
15 changed files with 208 additions and 327 deletions

97
DEVICES
View File

@ -65,6 +65,7 @@ Table of contents
13. Verilog-A models
14. XSPICE code models
15. Digital Building Blocks (U instances)
16. Digital Verilog Blocks compiled with Verilator or Icarus Verilog
------------------
@ -82,7 +83,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: C
Level: 1 (and only)
Dir: devices/cap
Status:
Status: active
Enhancements over the original model:
- Parallel Multiplier
@ -99,7 +100,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: L
Level: 1 (and only)
Dir: devices/ind
Status:
Status: active
Enhancements over the original model:
- Parallel Multiplier
@ -115,7 +116,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: R
Level: 1 (and only)
Dir: devices/res
Status:
Status: active
Enhancements over the original model:
- Parallel Multiplier
@ -139,7 +140,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: P
Level: 1 (and only)
Dir: devices/cpl
Status:
Status: active
This model comes from swec and kspice. It is not documented, if
you have kspice docs, can you write a short description
@ -159,7 +160,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: O
Level: 1 (and only)
Dir: devices/ltra
Status:
Status: active
- Original spice model.
- Does not implement parallel code switches.
@ -170,7 +171,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: T
Level: 1 (and only)
Dir: devices/tra
Status:
Status: active
- Original spice model.
- Does not implement parallel code switches.
@ -181,7 +182,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: Y
Level: 1 (and only)
Dir: devices/txl
Status:
Status: active
This model comes from kspice. It is not documented, if
you have kspice docs, can you write a short description
@ -199,7 +200,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: U
Level: 1 (and only)
Dir: devices/urc
Status:
Status: active
- Original spice model.
- Does not implement parallel code switches.
@ -213,7 +214,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: B
Level: 1 (and only)
Dir: devices/asrc
Status:
Status: active
4.2 CCCS - Current Controlled Current Source
@ -231,7 +232,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: H
Level: 1 (and only)
Dir: devices/ccvs
Status:
Status: active
- Original spice model.
@ -242,7 +243,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: I
Level: 1 (and only)
Dir: devices/isrc
Status:
Status: active
This is the original spice device improved by Alan Gillespie
with the following features:
@ -257,7 +258,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: G
Level: 1 (and only)
Dir: devices/vccs
Status:
Status: active
- Original spice model.
@ -268,7 +269,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: E
Level: 1 (and only)
Dir: devices/vcvs
Status:
Status: active
- Original spice model.
@ -278,7 +279,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: V
Level: 1 (and only)
Dir: devices/vsrc
Status:
Status: active
The original spice device improved with the following features:
@ -286,6 +287,7 @@ will be updated every time the device specific code is altered or changed to ref
- Check for non-monotonic series in PWL
- Random values
- White, 1/f, and random telegraph transient noise sources
- Port model for S parameter simulation
5. Switches
@ -296,7 +298,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: W
Level: 1 (and only)
Dir: devices/csw
Status:
Status: active
- This model comes from Jon Engelbert.
@ -307,7 +309,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: S
Level: 1 (and only)
Dir: devices/sw
Status:
Status: active
- This model comes from Jon Engelbert.
@ -320,7 +322,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: D
Level: 1 (and only)
Dir: devices/dio
Status:
Status: active
Enhancements over the original model:
- Parallel Multiplier
@ -339,7 +341,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: Q
Level: 1
Dir: devices/bjt
Status:
Status: active
Enhancements over the original model:
- Parallel Multiplier
@ -354,7 +356,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: Q
Level: 4 & 9
Dir: devices/vbic
Status:
Status: active, used by IHP Open Source PDK
This is the Vertical Bipolar InterCompany model in version 1.2. The author
of VBIC is Colin McAndrew mcandrew@ieee.org.
@ -370,6 +372,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: Q
Level: 8
Dir: devices/hicum2
Status: active
HICUM: HIgh CUrrent Model is a physics-based geometry-scalable compact
model for homo- and heterojunction bipolar transistors, developed by
@ -385,7 +388,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: J
Level: 1
Dir: devices/jfet
Status:
Status: active
This is the original spice JFET model.
@ -400,7 +403,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: J
Level: 2
Dir: devices/jfet2
Status:
Status: active
This is the Parker Skellern model for MESFETs.
@ -424,7 +427,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: Z
Level: 5
Dir: devices/hfet1
Status:
Status: active
This is the Heterostructure Field Effect Transistor model from:
K. Lee, M. Shur, T. A. Fjeldly and T. Ytterdal
@ -443,7 +446,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: Z
Level: 6
Dir: devices/hfet2
Status:
Status: active
Simplified version of hfet1
@ -461,7 +464,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: Z
Level: 1
Dir: devices/mes
Status:
Status: active
This is the original spice3 MESFET model (Statz).
@ -481,7 +484,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: Z
Level: 2,3,4
Dir: devices/mesa
Status:
Status: active
This is a multilevel model. It contains code for mesa levels
2,3 and 4
@ -501,7 +504,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 1
Dir: devices/mos1
Status:
Status: Used in subcircuit models, obsolete for CMOS
This is the so-called Schichman-Hodges model.
@ -515,7 +518,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 2
Dir: devices/mos2
Status:
Status: OBSOLETE
This is the so-called Grove-Frohman model.
@ -530,7 +533,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 3
Dir: devices/mos3
Status:
Status: Used in subcircuit models, obsolete for CMOS
Enhancements over the original model:
- Parallel multiplier
@ -543,7 +546,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 6
Dir: devices/mos6
Status:
Status: obsolete
Enhancements over the original model:
- Parallel multiplier
@ -556,7 +559,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 9
Dir: devices/mos9
Status:
Status: obsolete
This is a slightly modified Level 3 MOSFET model.
(Whatever the implementer have had in mind.)
@ -571,7 +574,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 4
Dir: devices/bsim1
Status:
Status: OBSOLETE
Enhancements over the original model:
- Parallel multiplier
@ -590,7 +593,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 5
Dir: devices/bsim2
Status:
Status: OBSOLETE
Enhancements over the original model:
- Parallel multiplier
@ -603,7 +606,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 8 & 49, version = 3.0
Dir: devices/bsim3v0
Status: TO BE TESTED AND IMPROVED
Status: OBSOLETE
11.9 BSIM3v1 - BSIM model level 3
@ -612,7 +615,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 8 & 49, version = 3.1
Dir: devices/bsim3v1
Status: TO BE TESTED AND IMPROVED
Status: OBSOLETE
This is the BSIM3v3.1 model modified by Serban Popescu.
This is level 49 model. It is an implementation that supports
@ -625,7 +628,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 8 & 49, version = 3.2.2, 3.2.3, 3.2.4
Dir: devices/bsim3v32 (level 3.2.4)
Status: o.k.
Status: active
This is another BSIM3 model from Berkeley Device Group.
You can find some test netlists with results for this model
@ -647,7 +650,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 8 & 49, version = 3.3.0
Dir: devices/bsim3 (level 3.3.0)
Status: o.k.
Status: active
This is the actual BSIM3 model from Berkeley Device Group.
You can find some test netlists with results for this model
@ -662,6 +665,8 @@ will be updated every time the device specific code is altered or changed to ref
- NodesetFix
- Support for Multi-core processors using OpenMP
BSIM3 models are very stable, they may replace many older models
for channel length 0.25u and up.
11.12 BSIM4 - BSIM model level 4
@ -669,7 +674,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 14 & 54, version = 4.5, 4.6, 4.7, 4.8
Dir: devices/bsim4 (level 4.8.0)
Status: o.k.
Status: active
This is the actual BSIM4 model from Berkeley Device Group.
Test are available on its web site.
@ -719,7 +724,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: -
Dir: devices/vdmos
Status: o.k.
Status: active
This is a simplified Power MOS model, derived from MOS1 and
diode, similar to LTSPICE and SuperSpice VDMOS
@ -754,7 +759,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 56
Dir: devices/bsim3soi_dd
Status: TO BE TESTED.
Status: obsolete
There is a bsim3soidd directory under the
test hierarchy. Test circuits come from bsim3soi
@ -769,7 +774,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 57
Dir: devices/bsim3soi_pd
Status: TO BE TESTED.
Status: obsolete
PD model has been integrated. There is a bsim3soipd directory
under the test hierarchy. Test circuits come from the bsim3soi
@ -784,7 +789,7 @@ will be updated every time the device specific code is altered or changed to ref
Class: M
Level: 10 & 58
Dir: devices/bsim3soi
Status: o.k.
Status: active
This is the actual version from Berkeley. This version is
backward compatible with its previous versions BSIMSOI3.x.
@ -832,11 +837,17 @@ will be updated every time the device specific code is altered or changed to ref
14. XSpice code models
more than 100 models are available, please see ngspice manual chapt. 8
more than 100 models are available, digital, analog, and hybrid.
Please see ngspice manual chapt. 8
15. Digital Building Blocks (U instances)
U instances are digital primitives which may be used (in proper combination) to
model digital devices, e.g. from the 74xx or 40xx families. ngspice maps them
onto XSPICE models, which allows a fast event based simulation. Please see the
ngspice manual, chapter 10.
ngspice manual, chapter 10.1 and 10.2.
16. Digital Verilog Blocks compiled with Verilator or Icarus Verilog
Verilog digital code may be compiled into a shared library (*.dll, *.so)
with Verilator or Icarus Verilog and then directly linked into ngspice via
the code model d_cosim. Please see the ngspice manual, chapter 10.3.

9
FAQ
View File

@ -256,7 +256,7 @@
The latest version released is:
ngspice-43 (released on July 14 2024)
ngspice-44 (released on January 2 2025)
2.2. What are the latest features in the current release?
@ -311,8 +311,9 @@
Ngspice is written in C, C++, and uses some GNU extensions. You may use
a GNU C/C++ compiler and a LINUX environment to compile it. Ngspice can
be compiled under Windows using the mingw or cygwin environment as
well as MS Visual Studio. It will readily compile on macOS.
FreeBSD or Solaris will do, but are not officially supported.
well as MS Visual Studio. It will readily compile on macOS, Intel CPUs or
Apple M1 - M4. Wasm, FreeBSD or Solaris will do, but are not officially
supported.
3.2. I get errors when I try to compile the source code, why?
@ -356,7 +357,7 @@
4.4. Disclaimer and Copyright
Copyright: Holger Vogt, 2024
Copyright: Holger Vogt, 2025
License: Creative Commons Attribution Share-Alike (CC-BY-SA) v4.0.
This document is provided as is. The information in it is not
warranted to be correct: you use it at your own risk.

273
INSTALL
View File

@ -1,12 +1,9 @@
Ngspice installation instructions
=================================
Important notice: If you upgrade from ngspice-38 or older
there there is an update required for the XSPICE code
models (analog.cm etc.). Therefore it
Important notice: If you upgrade, it
is not sufficient to only re-make the main executable,
you will have to compile and install the code models as well,
e.g. with --enable-xspice.
you will have to compile and install the code models as well.
Table of contents
@ -21,23 +18,20 @@ Table of contents
1.5.3 Options Useful for Debugging Ngspice
1.6 Installation on Red Hat, Oracle or CentOS Linux
2 Compilers and Options
3 Compiling For Multiple Architectures
4 Installation Names
5 Optional Features
6 Specifying the System Type
7 Sharing Defaults
8 Operation Controls
9 NGSPICE COMPILATION UNDER WINDOWS OS
9.1 How to make ngspice with MINGW and MSYS
9.2 make ngspice with MS Visual Studio 2022
9.3 make ngspice with pure CYGWIN
9.4 ngspice console app with MINGW or CYGWIN
9.5 cross compiling ngspice for Windows from LINUX
10 NGSPICE COMPILATION UNDER macOS
10.1 Use precompiled binary package
10.2 Compile NGSPICE manually from a tarball
10.3 Compile NGSPICE manually from git
10.4 About compilers
3 NGSPICE COMPILATION UNDER WINDOWS OS
3.1 How to make ngspice with MINGW and MSYS
3.2 make ngspice with MS Visual Studio 2022
3.3 make ngspice with pure CYGWIN
3.4 ngspice console app with MINGW or CYGWIN
3.5 cross compiling ngspice for Windows from LINUX
4 NGSPICE COMPILATION UNDER macOS M1 - M4
4.1 Prerequisites
4.2 Compile scripts for the bash terminal
5 NGSPICE COMPILATION UNDER macOS (tested with Intel CPUs)
5.1 Use precompiled binary package
5.2 Compile NGSPICE manually from a tarball
5.3 Compile NGSPICE manually from git
5.4 About compilers
This file describes the procedures to install ngspice from sources.
@ -87,14 +81,14 @@ This file describes the procedures to install ngspice from sources.
For compiling ngspice as a shared library, see section 1.4.
1.2 Install from tarball (e.g. ngspice-43.tar.gz)
1.2 Install from tarball (e.g. ngspice-44.tar.gz)
This covers installation from a release distribution (for example
ngspice-43.tar.gz, the so called tar ball).
ngspice-44.tar.gz, the so called tar ball).
After downloading the tar ball to a local directory, unpack it by command:
$ tar -zxvf ngspice-43.tar.gz
$ tar -zxvf ngspice-44.tar.gz
Now change directories in to the top-level source directory (where this
INSTALL file can be found).
@ -136,7 +130,7 @@ This file describes the procedures to install ngspice from sources.
1.3 Install from the git repository
This section describes how to install from source code taken directly
This section describes how to install from source code taken directly
from the git repository. It is intended for those who want to use the most
recent enhancements of ngspice and for developers. For user install
instructions using source from a released distributions, please see the
@ -236,7 +230,7 @@ This file describes the procedures to install ngspice from sources.
device models like BSOMBULK or BSIM_CMG.
(the following have to be selected to become available)
(the following have to be selected explicitely to become available)
--enable-cider
Cider is a mixed-level simulator that couples Spice3 and DSIM
@ -277,7 +271,7 @@ This file describes the procedures to install ngspice from sources.
"tclspice" is compiled and installed instead of
plain ngspice.
1.5.3 Options Useful for Debugging Ngspice
1.5.3 Options Useful for Debugging ngspice (but not used often)
--enable-ansi
Configure will try to find an option for your compiler so that
@ -305,7 +299,7 @@ This file describes the procedures to install ngspice from sources.
Debug pole/zero code.
--enable-sensdebug
Debug sensitivity code *SENSDEBUG*.
Debug sensitivity code *SENSDEBUG*.
--enable-smltmsdebug
Debug distortion code *SMALLTIMES*
@ -340,148 +334,16 @@ This file describes the procedures to install ngspice from sources.
2 Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
On CentOS with older GCC it might be necessary to add -std=c99
to the CFLAGS in ./compile_linux.sh .
3 Compiling For Multiple Architectures
3 NGSPICE COMPILATION UNDER WINDOWS OS
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
3.1 How to make ngspice with MINGW and MSYS2
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
4 Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
When installed on MinGW with MSYS alternative paths are not fully supported.
See 'How to make ngspice with MINGW and MSYS' below for details.
5 Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
6 Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
7 Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
8 Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
9 NGSPICE COMPILATION UNDER WINDOWS OS
====================================
9.1 How to make ngspice with MINGW and MSYS2
Creating ngspice with MINGW is a straight forward procedure,
Creating ngspice with MINGW is a straight forward procedure,
if you have MSYS2/MINGW installed properly. A modern environment is
offered by MSYS2 (https://www.msys2.org/). An installation procedure for
gcc in MSYS2 is decribed in
@ -489,15 +351,18 @@ This file describes the procedures to install ngspice from sources.
You will need some enhancements to the standard install (git, autoconf,
automake, libtool, FLEX and BISON, all available with pacman in MSYSS2).
Some links are given below which describe the procedures.
Unfortunately compiling with MINGW is slow. Compiling with Visual Studio
may be more than 10 times faster!
Installing from the tarball, e.g. ngspice-43.tar.gz, is simple: After
Installing from the tarball, e.g. ngspice-44.tar.gz, is simple: After
expanding, you may just run ./compile_min.sh from the ngspice directory.
The default installation location of ngspice is the Windows path
The default installation location of ngspice is the Windows path
C:\spice. The install path can be altered by passing --prefix=NEWPATH
as an argument to ./configure during the build process.
Put the install path you desire inside "", e.g. "D:/NewSpice". Be
Put the install path you desire inside "", e.g. "D:/NewSpice". Be
careful to use forward slashes "/", not backward slashes "\" (something
still to be fixed). Then add --prefix="D:/NewSpice" as an argument to
./configure in the normal way.
@ -592,7 +457,7 @@ This file describes the procedures to install ngspice from sources.
script compile_min_shared.sh.
9.2 make ngspice with MS Visual Studio 2022
3.2 make ngspice with MS Visual Studio 2022
ngspice may be compiled with MS Visual Studio 2022 or newer.
@ -671,8 +536,7 @@ This file describes the procedures to install ngspice from sources.
ngspice\visualc\sharedspice\ReleaseOMP.x64.
9.3 make ngspice with pure CYGWIN
3.3 make ngspice with pure CYGWIN
If you don't have libdl.a you may need to link libcygwin.a
to libdl.a symbolically.
@ -682,38 +546,59 @@ This file describes the procedures to install ngspice from sources.
$ cd /lib
$ ln -s libcygwin.a libdl.a.
The procedure of compiling is the same as Linux.
The procedure of compiling is the same as with OS Linux.
9.4 ngspice console app with MINGW or CYGWIN
3.4 ngspice console app with MINGW or CYGWIN
Omitting the configure flag --with-wingui will yield a console ngspice.
You then will not have any graphics interface. In CYGWIN you may add --with-x
for the X11 graphics (not available in mingw). A typical configure command
for the X11 graphics (not available in MINGW). A typical configure command
may look like
./configure --enable-osdi --enable-xspice --enable-cider --enable-openmp
--disable-debug CFLAGS=-m64 LDFLAGS=-m64 prefix=C:/Spice64
./configure --enable-cider --disable-debug CFLAGS=-m64 LDFLAGS=-m64 prefix=C:/Spice64
9.5 cross compiling ngspice for Windows from LINUX
3.5 cross compiling ngspice for Windows from LINUX
Two scripts are available in the ngspice directory that allow cross
compiling for NMS Windows, if you are running LINUX. ngspice.exe or
ngspice.dll may be made. For details please see cross-compile.sh or
cross-compile-shared.sh.
Two scripts are available in the ngspice directory that allow cross
compiling for NMS Windows, if you are running LINUX. ngspice.exe or
ngspice.dll may be made. For details please see cross-compile.sh or
cross-compile-shared.sh.
10 NGSPICE COMPILATION UNDER macOS
==================================
4 NGSPICE COMPILATION UNDER macOS M1 - M4
=======================================
(tested on a mac mini with Sonoma 13.2.1 and M2 CPU)
10.1 Use precompiled binary package
4.1 Prerequisites
1. Install xcode command line tools
2. Install Homebrew
All installs following are via Homebrew (except for OpenMP)
3. Install ngspice (this will add a lot of dependencies useful
also for compilation)
4 Install gnuplot (plotting externally, or creating ps or png)
5. Install XQuartz, libtool, autoconf, automake, readline, ncurses
6. Install OpenMP from mac.r-project.org (a sufficiently modern OpenMP,
required by the ngspice OSDI interface).
4.2 Compile scripts for the bash terminal
1. standard ngspice executable
compile_macos_clang_M2.sh
2. ngspice as a shared library
compile_macos_clang_M2_shared.sh
5 NGSPICE COMPILATION UNDER macOS (tested with Intel CPUs)
========================================================
5.1 Use precompiled binary package
1. Install an X11 interface (like Xquartz)
2. Packages are available from Homebrew or MacPorts
Install the downloaded NGSPICE package
It may happen though that a package has been compiled without graphics support
3. Open a terminal window and start using NGSPICE
10.2 Compile NGSPICE manually from a tarball
5.2 Compile NGSPICE manually from a tarball
1. Install an X11 interface (like Xquartz)
2. Install MacPorts from https://www.macports.org
3. Execute this command:
@ -724,11 +609,11 @@ cross-compile-shared.sh.
advantage that it supports OpenMP.
5. Or run the commands manually: Configure NGSPICE invoking "./configure".
A complete set of features is:
./configure --enable-cider --enable-xspice --enable-openmp --enable-pss --enable-debug=no
./configure --with-x --enable-cider --disable-debug
6. Compile NGSPICE invoking "make -j4"
7. Install NGSPICE invoking "make install" or "sudo make install"
10.3 Compile NGSPICE manually from git
5.3 Compile NGSPICE manually from git
1. Install an X11 interface (like Xquartz)
2. Install MacPorts from https://www.macports.org
3. Execute this command:
@ -737,7 +622,7 @@ cross-compile-shared.sh.
4. Execute this command:
./autogen.sh
5. Configure NGSPICE invoking "./configure". A complete set of feature is:
./configure --enable-cider --enable-xspice --enable-openmp --enable-pss --with-readline=yes --enable-debug=no
./configure --enable-cider --disable-debug
6. Compile NGSPICE invoking "make -j4"
7. Install NGSPICE invoking "make install" or "sudo make install"
@ -760,10 +645,10 @@ Resulting dependencies of ngspice
/usr/lib/libSystem.B.dylib
/usr/local/lib/gcc/11/libgcc_s.1.dylib
10.4 About compilers
A compile script compile_macos_clang.sh contains all necessary steps for compiling
with the Xcode clang/llvm compiler. This compiler however does not support -fopenmp.
Therefore you may download and install gcc, e.g. from Homebrew and run the new
compile script compile_macos_gcc.sh. OpenMp enables parallel processing of
BSIM3/4 model evaluation, thus speeding up simulation.
5.4 About compilers
A compile script compile_macos_clang.sh contains all necessary steps for compiling
with the Xcode clang/llvm compiler. This compiler however does not support -fopenmp.
Therefore you may download and install gcc, e.g. from Homebrew and run the new
compile script compile_macos_gcc.sh. OpenMp enables parallel processing of
BSIM3/4 model evaluation, thus speeding up simulation.

View File

@ -49,6 +49,7 @@ CODE ORGANIZATION
misc/ Various math support algorithms
deriv/ Various partial derivatives used by some device models (bjt, MOS1-9)
dense/ Matrix operations used by S-parameter simulation
KLU/ Alternative fast matrix solver KLU
"src/frontend" contains the code for interfacing ngspice to its input and output.
Files com_*.c contain the control language commands. outitf.c organizes the

27
NEWS
View File

@ -1,3 +1,30 @@
Ngspice-44, December 29th, 2024
============
- New features:
+ Add function ngSpice_Reset(void) to completely reset shared ngspice.
+ Bail out when state file is not found.
+ Define 1e-12 as a minimum resistor value.
+ Update VBIC model.
+ d_cosim supports Icarus Verilog.
+ Extend bsim4 operating point info list.
+ Make several error messages more verbose by
adding source file name (and line number).
+ Command 'let' will handle V(/nname).
+ Enable using fftw3 as a build option of shared ngspice on Windows.
+ Set lower case for variables or vectors names in command 'echo'.
+ Add optional series resistance or junction capacitance for diode
model, if none is defined in the .model statement.
+ Allow plotting a single point in an ascii plot.
+ Bail out when the number of s parameter ports is less than 2.
+ Add function ngSpice_nospiceinit(void) if you don't want to
read .spiceinit (shared ngspice only).
+ Reorder and renovate timer functions.
+ Enhance sensitivity analysis with an option to choose the parameters
to be varied. Shell-style wildcards ("*?") are supported.
+ Enable strings as parameters across subckt boundaries.
+ Replace all BOOLEAN, BOOL, _Bool by bool.
Ngspice-43, July 14th, 2024
============
- New features:

View File

@ -1,65 +0,0 @@
This document is covered by the Creative Commons Attribution Share-Alike (CC-BY-SA) v4.0. .
As of Jan. 2023 ADMS is deprectated and replaced by OpenVAF/OSDI.
See README_OSDI.md and README_OSDI_howto.
All references to ADMS will be removed in a future ngspice release.
*************** Verilog A Device models in ngspice ******************************************
1 Introduction
New compact device models today are released as Verilog-A code. Ngspice applies ADMS to
translate the va code into ngspice C syntax. Currently a limited number of Verilog-A models is
supported: HICUM level0 and level2 (HICUM model web page), MEXTRAM (MEXTRAM
model web page), EKV (EKV model web page) and PSP (NXP PSP web site).
2 ADMS
ADMS is a code generator that converts electrical compact device models specified in high-level
description language into ready-to-compile C code for the API of spice simulators. Based on
transformations specified in XML language, ADMS transforms Verilog-AMS code into other
target languages. Here we use it to to translate the va code into ngspice C syntax.
To make use of it, a set of ngspice specific XML files is distributed with ngspice in ngspice\
src\spicelib\devices\adms\admst. Their translation is done by the code generator executable
admsXml (see below).
3 How to integrate a Verilog-A model into ngspice
3.1 How to setup a *.va model for ngspice
Unfortunately most of the above named models licenses are not compatible to free software
rules as defined by DFSG. Therefore since ngspice-28 the va model files are no longer part of
the standard ngspice distribution. They may however be downloaded as a tar.gz archive from the
ngspice-30 file distribution folder. After downloading, you may expand the zipped files into
your ngspice top level folder. The models enable dc, ac, and tran simulations. Noise simulation
is not supported.
Other (foreign) va model files will not compile without code tweaking, due to the limited
capabilities of our ADMS installation.
3.2 Adding admsXml to your build environment
The actual admsXml code is maintained by the QUCS project and is available at GitHub.
Information on how to compile and install admsXml for Linux or Cygwin is available on the
GitHub page. For MS Windows users admsXml.exe is available for download from
https://sourceforge.net/projects/mot-adms/. You may copy admsXml.exe to your MSYS2 setup
into the folder msys64\mingw64\bin, if 64 bit compilation is intended.
More information, though partially outdated, is obtainable from the ngspice web pages
(http://ngspice.sourceforge.net/admshowto.html) and from README-old.adms.
3.3 Compile ngspice with ADMS
In the top level ngspice folder there are two compile scripts compile_min.sh and compile_linux.sh.
They contain information how to compile ngspice with ADMS. You will have to run autogen.sh
with the adms flag
./autogen.sh --adms
In addition you have to add --enable-adms to the ./configure command. Please check chapter
32.1 of the ngspice manual for perequisites and further details.
Compiling ngspice with ADMS with MS Visual Studio is not supported.

View File

@ -14,7 +14,6 @@
# OpenMP has been installed from https://mac.r-project.org/openmp/
# ngspice as shared library:
# Replace --with-x by --with-ngshared in line ../configure ... .
# Add (optionally) --enable-relpath to avoid absolute paths when searching for code models.
# It might be necessary to uncomment and run ./autogen.sh .
@ -43,13 +42,13 @@ if test "$1" = "d"; then
echo "configuring for 64 bit debug"
echo
../configure --with-ngshared --enable-cider --with-readline=/opt/homebrew/opt/readline --enable-debug CFLAGS="-m64 -O0 -g -Wall -I/opt/X11/include/freetype2 -I/opt/homebrew/opt/readline/include" LDFLAGS="-m64 -g -L/opt/homebrew/opt/readline/lib -L/opt/X11/lib -L/usr/local/lib -lomp"
../configure --with-ngshared --enable-cider --enable-debug CFLAGS="-m64 -O0 -g -Wall -I/opt/X11/include/freetype2" LDFLAGS="-m64 -g -L/opt/X11/lib -L/usr/local/lib -lomp"
else
cd release_sh
if [ $? -ne 0 ]; then echo "cd release_sh failed"; exit 1 ; fi
echo "configuring for 64 bit release"
echo
../configure --with-ngshared --enable-cider --with-readline=/opt/homebrew/opt/readline CFLAGS="-m64 -O2 -I/opt/X11/include/freetype2 -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/ncurses/include" LDFLAGS="-m64 -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/ncurses/lib -L/opt/X11/lib -L/usr/local/lib -lomp"
../configure --with-ngshared --enable-cider CFLAGS="-m64 -O2 -I/opt/X11/include/freetype2 -I/opt/homebrew/opt/ncurses/include" LDFLAGS="-m64 -L/opt/homebrew/opt/ncurses/lib -L/opt/X11/lib -L/usr/local/lib -lomp"
fi
if [ $? -ne 0 ]; then echo "../configure failed"; exit 1 ; fi

View File

@ -16,7 +16,7 @@
# problem to the user.
AC_PREREQ([2.59])
m4_define([ngspice_major_version], [43+])
m4_define([ngspice_major_version], [44+])
m4_define([ngspice_minor_version], [0])
m4_define([ngspice_version],
[ngspice_major_version])
@ -117,7 +117,7 @@ LT_INIT([shared static])
# --> Set 'LT_NGSPICE_AGE' to 0.
LT_NGSPICE_CURRENT=0
LT_NGSPICE_REVISION=10
LT_NGSPICE_REVISION=11
LT_NGSPICE_AGE=0
LIBNGSPICE_SO_VERSION=$LT_NGSPICE_CURRENT.$LT_NGSPICE_REVISION.$LT_NGSPICE_AGE

View File

@ -1480,6 +1480,12 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name
if (!y) {
fprintf(cp_err, "Error: .include filename missing\n");
if (sourcelineinfo) {
if (intfile)
fprintf(cp_err, " While reading the netlist sent by the calling program\n");
else
fprintf(cp_err, " While reading %s\n", sourcelineinfo);
}
tfree(buffer); /* was allocated by readline() */
controlled_exit(EXIT_FAILURE);
}
@ -1495,6 +1501,12 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name
y_resolved = inp_pathresolve_at(y, oldpath);
if (!y_resolved) {
fprintf(cp_err, "Error: Could not find include file %s\n", y);
if (sourcelineinfo) {
if (intfile)
fprintf(cp_err, " While reading the netlist sent by the calling program\n");
else
fprintf(cp_err, " While reading %s\n", sourcelineinfo);
}
controlled_exit(EXIT_FAILURE);
}
}
@ -1504,6 +1516,12 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name
if (!newfp) {
fprintf(cp_err, "Error: .include statement failed.\n"
"Could not open file\n%s\n", y_resolved);
if (y_resolved) {
if (intfile)
fprintf(cp_err, " While reading the netlist sent by the calling program\n");
else
fprintf(cp_err, " While reading %s\n", y_resolved);
}
tfree(buffer); /* allocated by readline() above */
controlled_exit(EXIT_FAILURE);
}
@ -1511,7 +1529,7 @@ static struct inp_read_t inp_read(FILE* fp, int call_depth, const char* dir_name
y_dir_name = ngdirname(y_resolved);
newcard = inp_read(
newfp, call_depth + 1, y_dir_name, NULL, FALSE, FALSE)
newfp, call_depth + 1, y_dir_name, y_resolved, FALSE, FALSE)
.cc; /* read stuff in include file into
netlist */
@ -8254,10 +8272,10 @@ static void inp_quote_params(struct card *c, struct card *end_c,
if (num_terminals <= 0)
continue;
/* There are devices that should not get quotes around tokens
following after the terminals. These may be model names or control
voltages. See bug 384 or Skywater issue 327 */
if (strchr("fhmouydqjzsw", *curr_line))
/* There are devices that should not get quotes around token directly
following the terminals. These may be model names, control voltages
or subckt names. See bugs 384, 730 or Skywater issue 327 */
if (strchr("fhmouydqjzswx", *curr_line))
num_terminals++;
for (i = 0; i < num_params; i++) {

View File

@ -81,7 +81,7 @@ int gr_init(double *xlims, double *ylims, /* The size of the screen. */
const char *commandline, /* For xi_zoomdata() */
int prevgraph) /* plot id, if started from a previous plot*/
{
GRAPH *graph;
GRAPH *graph, *pgraph;
wordlist *wl;
NG_IGNORE(nplots);
@ -157,11 +157,14 @@ int gr_init(double *xlims, double *ylims, /* The size of the screen. */
graph->plotname = tprintf("%s: %s", pname, plotname);
/* restore background color from previous graph, e.g. for zooming,
it will be used in NewViewport(graph) */
if (prevgraph > 0) {
graph->mgraphid = prevgraph;
pgraph = FindGraph(prevgraph);
if (pgraph)
graph->mgraphid = prevgraph;
else
prevgraph = graph->mgraphid = 0;
}
else {
graph->mgraphid = 0;
@ -178,7 +181,7 @@ int gr_init(double *xlims, double *ylims, /* The size of the screen. */
/* restore data from previous graph, e.g. for zooming */
if (prevgraph > 0) {
int i;
GRAPH* pgraph = FindGraph(prevgraph);
/* transmit colors */
for (i = 0; i < 25; i++) {
graph->colorarray[i] = pgraph->colorarray[i];

View File

@ -124,7 +124,7 @@ are of type bool if sharedspice.h is used externally.
*/
#ifndef NGSPICE_PACKAGE_VERSION
#define NGSPICE_PACKAGE_VERSION "43+"
#define NGSPICE_PACKAGE_VERSION "44+"
#endif
/* we have NG_BOOL instead of BOOL */
#ifndef HAS_NG_BOOL

View File

@ -816,7 +816,7 @@ int
ngSpice_nospiceinit(void)
{
bool t = TRUE;
cp_vset("no_spicenit", CP_BOOL, &t);
cp_vset("no_spiceinit", CP_BOOL, &t);
return 0;
}

View File

@ -2,7 +2,8 @@
EXTRA_DIST = README examples icm xspice.c .gitignore \
verilog/vlnggen \
verilog/verilator_shim.cpp verilog/verilator_main.cpp
verilog/verilator_shim.cpp verilog/verilator_main.cpp \
verilog/libvvp.def verilog/MSVC.CMD verilog/README.txt
## This is removed because icm relies upon the existance of all other
## libs. It is currently compiled manually, last.

View File

@ -18,11 +18,11 @@ initdata2_DATA = ../../include/ngspice/cosim.h \
# Icarus Verilog support: build two shared libraries.
pkglib_LTLIBRARIES = ivlng.la ivlngvpi.la
ivlng_la_SOURCES = icarus_shim.c icarus_shim.h
ivlng_la_SOURCES = icarus_shim.c icarus_shim.h coroutine_shim.h
ivlng_la_CFLAGS = -I../../../../src/include
ivlng_la_LDFLAGS = -module -shared -avoid-version
ivlngvpi_la_SOURCES = vpi.c icarus_shim.h vpi_user_dummy.h
ivlngvpi_la_SOURCES = vpi.c icarus_shim.h vpi_user_dummy.h coroutine.h coroutine_cosim.h
ivlngvpi_la_CFLAGS = -I../../../../src/include
ivlngvpi_la_LDFLAGS = -module -shared -avoid-version
@ -32,7 +32,7 @@ ivlngvpi_la_LDFLAGS = -module -shared -avoid-version
if DLIBS_FULLY_RESOLVED
pkglib_LTLIBRARIES += libvvp.la
libvvp_la_SOURCES = vpi_dummy.c vpi_user_dummy.h
libvvp_la_SOURCES = vpi_dummy.c vpi_user_dummy.h coroutine.h coroutine_cosim.h
libvvp_la_LDFLAGS = -no-undefined -module -shared -avoid-version
ivlng_la_LDFLAGS += -no-undefined
ivlngvpi_la_LIBADD = libvvp.la ivlng.la

View File

@ -15,7 +15,7 @@
#define PACKAGE "ngspice"
/* Version number of package */
#define VERSION "43+"
#define VERSION "44+"
/* Define the directory for executables */
#define NGSPICEBINDIR "../bin"