Dune — third-party notices and credits
======================================

Dune (https://github.com/milkway/dune) is distributed under the BSD
3-Clause licence; see the LICENSE file of the repository
(https://github.com/milkway/dune/blob/main/LICENSE). Copyright (c) 2026,
André Leite.

Dune is a derived work. Its simulation engine was written in Rust by
translating and following the C sources of two earlier programs, and
this file credits them and reproduces their copyright and licence
notices. The same text ships with every published package (the Rust
crates, the Python package `spice3`, the R package `spice` as
inst/COPYRIGHTS, and the npm package `@strategicprojects/dune-sim`).

Dune is an independent project. It is not affiliated with, sponsored by
or endorsed by the University of California, Berkeley, the UC Berkeley
BSIM Research Group or the ngspice project. The names "SPICE", "SPICE3"
and "ngspice" are used only descriptively, to identify the programs
whose netlist language and behaviour Dune implements.


1. SPICE3f5 (University of California, Berkeley)
------------------------------------------------

The netlist language, the device models, the numerical algorithms and
the analyses of Dune are derived from SPICE3 version 3f5, written at
the Department of Electrical Engineering and Computer Sciences of the
University of California, Berkeley (Thomas L. Quarles and many others;
the individual authors are named in the headers of the SPICE3f5 source
files and in the comments of the Dune modules that follow them). The
complete SPICE3f5 source distribution is kept, unmodified, in
corpus/spice3f5/ of the Dune repository. Source:
https://ptolemy.berkeley.edu/projects/embedded/pubs/downloads/spice/

The SPICE3f5 copyright file (corpus/spice3f5/COPYRIGHT), verbatim:

    7/17/2007
    Spice is covered now covered by the BSD Copyright:

    Copyright (c) 1985-1991 The Regents of the University of California.
    All rights reserved.

    Permission is hereby granted, without written agreement and without license
    or royalty fees, to use, copy, modify, and distribute this software and its
    documentation for any purpose, provided that the above copyright notice and
    the following two paragraphs appear in all copies of this software.

    IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
    DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
    OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
    CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
    "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE
    MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.


2. ngspice (the ngspice team and contributors)
----------------------------------------------

ngspice (https://ngspice.sourceforge.io/) is the maintained successor
of SPICE3f5. Dune uses release ngspice-47 in two ways.

(a) As the numerical reference. Dune is validated against ngspice-47:
the reference rawfiles of the test corpus (corpus/golden/,
corpus/measure/golden/, corpus/pss/golden/ in the repository) are
outputs of ngspice-47 and are redistributed there as test data.

(b) As a source. The following parts of the engine are derived from
ngspice-47 source files rather than from SPICE3f5, because the feature
does not exist in SPICE3f5 or because Dune follows ngspice's revision
of a SPICE3f5 routine. Paths on the right are relative to the ngspice
source tree (src/); the copyright and author lines are those of the
upstream file headers.

  crates/dune-core/src/bsim3/ (mod.rs, eval.rs, temp.rs, params.rs)
      BSIM3v3.3.0 MOSFET model — spicelib/devices/bsim3/: b3.c, b3ld.c,
      b3temp.c, b3set.c, b3mpar.c, b3cvtest.c, b3acld.c, b3noi.c,
      b3check.c, bsim3def.h. See section 3.

  crates/dune-core/src/sp.rs (and the RF-port parts of devices.rs,
  circuit.rs, matrix.rs)
      S-parameter analysis `.sp` — spicelib/analysis/span.c
      ("Alessio Cacciatori 2021"); spicelib/analysis/cktspdum.c
      ("Copyright 1990 Regents of the University of California.
      Author: 1985 Thomas L. Quarles"); the RFSPICE parts of
      spicelib/devices/vsrc/ and of spicelib/analysis/nevalsrc.c
      ("Author: 1987 Gary W. Ng", "Modified by Alessio Cacciatori").

  crates/dune-core/src/engine.rs (operating-point fallback chain)
      spicelib/analysis/cktop.c — dynamic gmin stepping, true gmin
      stepping and Gillespie's source stepping ("Copyright 1990 Regents
      of the University of California. Author: 1985 Thomas L. Quarles.
      Modified: 2000 AlansFixes. Modified: 2005 Paolo Nenzi -
      Restructured"); spicelib/analysis/optran.c — the transient
      operating point ("Copyright 2019 Holger Vogt  All rights
      reserved. Author: 2019 Holger Vogt. Modified BSD license").

  crates/dune-core/src/bsim1.rs, bsim2.rs (noise)
      spicelib/devices/bsim1/b1noi.c, spicelib/devices/bsim2/b2noi.c
      ("Author: 2003 Paolo Nenzi").

  crates/dune-core/src/trnoise.rs, srcfn.rs (transient noise sources
  TRNOISE and TRRANDOM)
      Grammar and semantics follow spicelib/devices/vsrc/vsrcload.c,
      vsrcacct.c, vsrcpar.c ("Copyright 1990 Regents of the University
      of California. Author: 1985 Thomas L. Quarles. Modified: 2000
      AlansFixes"), frontend/trannoise/1-f-code.c ("Copyright: Holger
      Vogt, 2008") and maths/misc/randnumb.c ("Copyright 2008 Holger
      Vogt"). The random number streams are Dune's own.

  crates/dune-core/src/measure.rs, crates/dune-netlist/src/meas.rs,
  crates/dune-cli/src/measure.rs (`.measure`)
      frontend/com_measure2.c ("Patches by Bill Swartz from 2009-05-18
      and 2009-08-21 are included"), frontend/measure.c,
      maths/misc/equality.c ("Copyright 1991 Regents of the University
      of California"; after Bruce Dawson, "Comparing floating point
      numbers").

  crates/dune-core/src/switch.rs
      spicelib/devices/sw/swload.c, spicelib/devices/csw/cswload.c
      ("Copyright 1990 Regents of the University of California.
      Author: 1985 Gordon Jacobs. Modified: 2001 Jon Engelbert"),
      spicelib/devices/sw/swtrunc.c.

  Other modules of crates/dune-core and crates/dune-netlist
      Wherever ngspice-47 corrected or extended a SPICE3f5 routine and
      Dune follows ngspice, the module comment names the ngspice file:
      among others spicelib/devices/devsup.c (Meyer capacitances),
      the MOS, resistor and diode noise and temperature routines
      (mos1noi.c, resnoise.c, restemp.c, ...), spicelib/analysis/
      dctrcurv.c (resistor and temperature sweeps), cktsens.c
      (sensitivity parameter set and filters), the arbitrary source
      (spicelib/devices/asrc/) and the ideal transmission line
      (spicelib/devices/tra/traacct.c). These files carry the Regents'
      copyright and ngspice modification lines such as "Modified: 2000
      AlansFixes" (Alan Gillespie), "Modified by Paolo Nenzi 2003" and
      "Dietmar Warning 2012". Each deliberate difference between
      SPICE3f5, ngspice and Dune is recorded in corpus/KNOWN_DIFFS.md.

  crates/dune-core/src/pss.rs (`.pss`)
      Not derived from ngspice code: only the card syntax and the plot
      names of ngspice's `.pss` (spicelib/analysis/dcpss.c, Stefano
      Perticaroli and Francesco Lannutti) are kept; the method is a
      different one.

The licence statement of ngspice-47 (file COPYING of the ngspice source
tree, https://sourceforge.net/p/ngspice/ngspice/ci/ngspice-47/tree/COPYING):

    The ngspice source code has evolved over time by integrating contributions
    from various sources (e.g. Spice3f5, XSPICE, CIDER, numparam, tclspice and
    others). Thus a mixture of license statements prevails.

    The ngspice license is the `Modified BSD' license. This is adopted for all of
    its source code, test and example files except for the files listed below.

None of the ngspice files named above is among the exceptions that
COPYING lists (m4, tclspice.c, maths/sparse, maths/KLU, osdi, ndev,
xspice, frontend/numparam, the manual). The 'Modified BSD' licence of
ngspice, verbatim from COPYING:

    Copyright 1985 - 2018, Regents of the University of California and others

    Redistribution and use in source and binary forms, with or without modification,
    are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

    3. Neither the name of the copyright holder nor the names of its
    contributors may be used to endorse or promote products derived from this
    software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.


3. BSIM3v3.3.0 (UC Berkeley BSIM Research Group)
------------------------------------------------

The BSIM3 model of Dune (crates/dune-core/src/bsim3/) is a translation
of the BSIM3v3.3.0 code as distributed with ngspice-47
(src/spicelib/devices/bsim3/). BSIM3 was developed by the BSIM Research
Group of the Department of Electrical Engineering and Computer
Sciences, University of California, Berkeley. The upstream file headers
read (b3ld.c; the other files differ only in the author lines):

    /**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
    /**** OpenMP support for ngspice by Holger Vogt 06/28/2010 ****/

    /**********
     * Copyright 2004 Regents of the University of California. All rights reserved.
     * File: b3ld.c of BSIM3v3.3.0
     * Author: 1991 JianHui Huang and Min-Chie Jeng.
     * Modified by Mansun Chan (1995).
     * Author: 1997-1999 Weidong Liu.
     * Author: 2001 Xuemei Xi
     * Modified by Xuemei Xi, 10/05, 12/21, 2001.
     * Modified by Xuemei Xi, 07/29/2005.
     **********/

Further authors named in the headers of the other files: Gary W. Ng
(b3noi.c) and Dietmar Warning (b3check.c, "Modified by Dietmar Warning,
12/21/2020").

The BSIM3 directory of ngspice-47 carries the file B3TERMS_OF_USE,
reproduced here verbatim:


    The terms under which the software is provided  are as the following.

    Software is distributed as is, completely without warranty or service
    support. The University of California and its employees are not liable
    for the condition or performance of the software.

    The University owns the copyright but shall not be liable for any
    infringement of copyright or other proprietary rights brought by third
    parties against the users of the software.

    The University of California hereby disclaims all implied warranties.

    The University of California grants the users the right to modify, copy,
    and redistribute the software and documentation, both within the user's
    organization and externally, subject to the following restrictions:

    1. The users agree not to charge for the University of California code
       itself but may charge for additions, extensions, or support.

    2. In any product based on the software, the users agree to acknowledge
       the UC Berkeley BSIM Research Group that developed the software. This
       acknowledgment shall appear in the product documentation.

    3. The users agree to obey all U.S. Government restrictions governing
       redistribution or export of the software.

    4. The users agree to reproduce any copyright notice which appears on
       the software on any copy or modification of such made available
       to others.

The test decks corpus/regress/bsim3_*.cir of the repository use the
BSIM3v3.3.0 model cards examples/mos/modelcard.nmos and modelcard.pmos
of the ngspice-47 distribution.


4. Rust dependencies
--------------------

The compiled packages link third-party Rust crates, each under its own
licence (see Cargo.lock; the R package lists them in inst/AUTHORS and
ships their licence texts inside the vendored sources).
