|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | 03-May-2022 | - |
| ng_shared_xspice_v/ | H | 08-Aug-2021 | - | 1,203 | 985 |
| src/ | H | 08-Aug-2021 | - | 1,160 | 462 |
| xspice/ | H | 08-Aug-2021 | - | 1,981 | 1,965 |
| .gitignore | H A D | 08-Aug-2021 | 448 | 26 | 21 |
| ANALYSES | H A D | 08-Aug-2021 | 4.1 KiB | 116 | 75 |
| AUTHORS | H A D | 08-Aug-2021 | 1.6 KiB | 79 | 73 |
| BUGS | H A D | 08-Aug-2021 | 1.6 KiB | 39 | 27 |
| COPYING | H A D | 08-Aug-2021 | 28.2 KiB | 571 | 465 |
| ChangeLog | H A D | 08-Aug-2021 | 671 KiB | 20,070 | 16,790 |
| DEVICES | H A D | 08-Aug-2021 | 20.5 KiB | 872 | 617 |
| FAQ | H A D | 08-Aug-2021 | 13.9 KiB | 382 | 256 |
| INSTALL | H A D | 08-Aug-2021 | 25.3 KiB | 716 | 538 |
| Makefile.am | H A D | 08-Aug-2021 | 1 KiB | 33 | 25 |
| NEWS | H A D | 08-Aug-2021 | 36.6 KiB | 916 | 733 |
| README | H A D | 08-Aug-2021 | 2.2 KiB | 68 | 46 |
| README-old.adms | H A D | 08-Aug-2021 | 20.8 KiB | 454 | 391 |
| README.adms | H A D | 08-Aug-2021 | 2.9 KiB | 59 | 41 |
| README.shared-xspice | H A D | 08-Aug-2021 | 1.4 KiB | 32 | 22 |
| README.tcl | H A D | 08-Aug-2021 | 4.8 KiB | 101 | 74 |
| README.utf8 | H A D | 08-Aug-2021 | 1.3 KiB | 36 | 26 |
| README.vdmos | H A D | 08-Aug-2021 | 2.6 KiB | 73 | 58 |
| Stuarts_Poly_Notes | H A D | 08-Aug-2021 | 3.3 KiB | 104 | 69 |
| autogen.sh | H A D | 08-Aug-2021 | 5.9 KiB | 261 | 190 |
| build-for-mac-os.sh | H A D | 08-Aug-2021 | 1.2 KiB | 42 | 20 |
| compile_linux.sh | H A D | 08-Aug-2021 | 3.3 KiB | 85 | 47 |
| compile_linux_shared.sh | H A D | 08-Aug-2021 | 3.7 KiB | 89 | 47 |
| compile_macos.sh | H A D | 08-Aug-2021 | 3.6 KiB | 87 | 47 |
| compile_min.sh | H A D | 08-Aug-2021 | 3.7 KiB | 93 | 47 |
| compile_min_shared.sh | H A D | 08-Aug-2021 | 3.3 KiB | 87 | 47 |
| configure.ac | H A D | 08-Aug-2021 | 52.5 KiB | 1,480 | 1,275 |
| cross-compile-shared.sh | H A D | 08-Aug-2021 | 1.6 KiB | 59 | 30 |
| cross-compile.sh | H A D | 08-Aug-2021 | 1.3 KiB | 54 | 28 |
| make-install-vngspice.bat | H A D | 08-Aug-2021 | 1.9 KiB | 68 | 51 |
| make-install-vngspiced.bat | H A D | 08-Aug-2021 | 1.9 KiB | 68 | 51 |
| ngspice-x86.exe.manifest | H A D | 08-Aug-2021 | 1.4 KiB | 35 | 29 |
| ngspice.exe.manifest | H A D | 08-Aug-2021 | 1.4 KiB | 35 | 29 |
| ngspice.pc.in | H A D | 08-Aug-2021 | 219 | 12 | 9 |
| resource.h | H A D | 08-Aug-2021 | 434 | 17 | 9 |
| sharedspice.sln | H A D | 08-Aug-2021 | 1.8 KiB | 38 | 36 |
| sharedspice.vcxproj | H A D | 08-Aug-2021 | 140.4 KiB | 2,269 | 2,269 |
| spinit_all | H A D | 08-Aug-2021 | 655 | 30 | 26 |
| spinitd | H A D | 08-Aug-2021 | 698 | 31 | 26 |
| spinitd64 | H A D | 08-Aug-2021 | 710 | 31 | 26 |
| spinitr | H A D | 08-Aug-2021 | 692 | 31 | 26 |
| spinitr64 | H A D | 08-Aug-2021 | 704 | 31 | 26 |
| vngspice-fftw.sln | H A D | 08-Aug-2021 | 19.1 KiB | 265 | 263 |
| vngspice-fftw.vcxproj | H A D | 08-Aug-2021 | 164.2 KiB | 2,729 | 2,729 |
| vngspice.rc | H A D | 08-Aug-2021 | 1.5 KiB | 72 | 52 |
| vngspice.sln | H A D | 08-Aug-2021 | 19.1 KiB | 265 | 263 |
| vngspice.vcxproj | H A D | 08-Aug-2021 | 164 KiB | 2,737 | 2,737 |
README
1README for NGSPICE
2==================
3
4Ngspice is a mixed-level/mixed-signal circuit simulator. Its code
5is based on three open source software packages: Spice3f5, Cider1b1
6and Xspice.
7
8Spice3 does not need any introduction, is the most popular circuit
9simulator. In over 30 years of its life Spice3 has become a de-facto
10standard for simulating circuits.
11
12Cider couples Spice3f5 circuit level simulator to DSIM device simulator
13to provide greater simulation accuracy of critical devices. DSIM
14devices are described in terms of their structures and materials.
15
16Xspice is an extension to Spice3C1 that provides code modelling support
17and simulation of digital components through an embedded event driven
18algorithm.
19
20Ngspice is, anyway, much more than the simple sum of the packages
21above, as many people contributed to the project with their experience,
22their bug fixes and their improvements. If you are interested, browse
23the site and discover what ngspice offers and what needs. If you think
24you can help, join the development team.
25
26Ngspice is an ongoing project, growing everyday from users contributions,
27suggestions and reports. What we will be able to do depends mostly on
28user interests, contributions and feedback.
29
30
31
32USER DISCUSSION FORUMS:
33-----------------------
34
35 For discussions on ngspice, there are five discussion forums, to be
36 found at https://sourceforge.net/p/ngspice/discussion/. These
37 typically provide quick answers to any question concerning ngspice.
38 A new section on 'tips and examples' assembles useful tips provided
39 by maintainers and users.
40
41
42
43MAILING LISTS:
44-------------
45
46 There are two mailing lists dedicated to the use and development of ngspice.
47
48 * ngspice-users@lists.sourceforge.net:
49 This list is the list for the users of the ngspice simulator.
50
51 * ngspice-devel@lists.sourceforge.net:
52 ngspice development issues. Developers and "want to be" developers should
53 subscribe here.
54
55 To subscribe the list(s), send a message to:
56 <ngspice-users-subscribe@lists.sourceforge.net>
57 <ngspice-devel-subscribe@lists.sourceforge.net>
58
59
60
61WEB SITEs:
62--------
63
64This project is hosted on Sourceforge.net.
65The home page is http://ngspice.sourceforge.net
66The page offering source code and user interaction is
67 http://sourceforge.net/projects/ngspice
68
README-old.adms
1***************************************************************************
2* DISCLAIMER *
3* *
4* The admst code generators, part of adms and this document are released *
5* under LGPL license terms. *
6* *
7* Copyright (C) 2006 Freescale Inc. *
8* *
9* This library is free software; you can redistribute it and/or *
10* modify it under the terms of the GNU Lesser General Public *
11* License as published by the Free Software Foundation; either *
12* version 2.1 of the License, or (at your option) any later version. *
13* *
14* This library is distributed in the hope that it will be useful, *
15* but WITHOUT ANY WARRANTY; without even the implied warranty of *
16* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
17* Lesser General Public License for more details. *
18* *
19* You should have received a copy of the GNU Lesser General Public *
20* License along with this library; if not, write to the Free Software *
21* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
22* 02110-1301 USA *
23***************************************************************************
24
25WARNING!
26
27The text in this document has been prepared in 2006 and is outdated. It is
28provided here only for reference and may provide some (historical)
29information.
30
31Please refer to the ngspice adms web page at
32http://ngspice.sourceforge.net/admshowto.html
33for actual information on how to integrate Verilog A device models into
34ngspice.
35
36Holger Vogt, May 2013
37
38
39
40INTRODUCTION
41
42In this document we will provide a guideline on how to auto-generate the
43ready-to compile C code for the ngspice API of a compact device model
44defined in the Verilog-AMS language.
45
46Condition:
47 To compile Verilog-AMS compact models into ngspice-ready C models with
48 admsXml a copy of the latest adms distribution is needed. You get it from
49 the adms Download page http://mot-adms.sourceforge.net as a source code
50 package. (Also use of cvs version is possible, but needs some more effort.)
51
52Version:
53 This guideline has been tested on Windows-XP under cygwin using:
54 $ admsXml -v
55 [usage] <release name="admsXml" version="2.1.3" date="Feb 2 2006" time="19:01:39"/>
56 [info] elapsed time: 0
57 [info] admst iterations: 0 (0 freed)
58
59Goal:
60 In this guideline we will add device model hicum0 to ngspice
61 using the Verilog-AMS source code available at:
62 http://www.iee.et.tu-dresden.de/~schroter/Hicum_PD/Hicumna/hicumL0V1p11.va
63
64Limitations:
65 The adms ngspice interface supports a limited set of Verilog-AMS language
66 constructs. See the home page of adms (http://mot-adms.sourceforge.net/)
67 for more info.
68 Feel free to contribute to the adms ngspice interface so that more
69 constructs can be supported.
70
71
7201- ngspice Files
73
74 Ngspice does not (yet) have support for loading models at run time, every
75 model must be included at compile time. Then, adding a new model into
76 ngspice is a process that cannot be completely automated. Some files need
77 to be edited by hand.
78
79 01.01 What ngspice need to know of a new model ?
80
81 First you have to assign your new model a "device type". As you probably
82 know, ngspice recognizes the type of a device by the first letter in
83 device's name in the netlists ("r" for resistors, "q" for BJT, "m" for
84 mosfets and so on). Then the first thing you have to find is the correct
85 type for your new device (let's call this device_type).
86
87 Since there can be more than one model for each device type, another
88 parameter you have to set is the device_level, which must be unique
89 for each device type.
90
91 Once you have found the (device_type, device_level) couple you have
92 identified the files you have to edit:
93
94 <ngspice-data-tree>/configure.ac
95 Here you have to add the entries in adms section for your new directory
96 and library.
97
98 <ngspice-data-tree>/src/spicelib/parser/inp2<device_type>.c
99 Substitute <device_type> with the letter corresponding to the
100 type of you new model. Here you have to add the interface code for your
101 new device. In the case of hicum (a BJT model and thus a "q" device type)
102 you have to edit inp2q.c
103
104 <ngspice-data-tree>/src/spicelib/parser/inpdomod.c
105 Here you have to add a switch for the level of your new device.
106
107 <ngspice-data-tree>/src/spicelib/devices/dev.c
108 Follow the structure of the files and add information on your new
109 model. In dev.c you have to adjust some macro.
110
111 See existing examples to make the modifications for your own implementation.
112 <ngspice-data-tree> is the path to the ngspice source installation.
113 For instance <ngspice-data-tree> can be /tools/ng-spice-rework-17
114
115 Please see appendix 01 about spice3-flavoured flags.
116
11702- adms Files
118
119 List of files that adms needs to create the ready-to-compile C code:
120 <ngspice-data-tree>/src/spicelib/devices/adms/admst/ngspice*.xml
121 adms creates the ready-to-compile C code from a set of admst code
122 generators. admst is a subset of the XML language which has been created
123 specifically for the purpose of C code generation. The syntax of admst is
124 very close to the XSLT language (it includes some extensions.)
125
12603- Create the data file structure
127
128 Create the following directories if they do not already exist:
129 -a <ngspice-data-tree>/src/spicelib/devices/adms/hicum0
130 -b <ngspice-data-tree>/src/spicelib/devices/adms/hicum0/admsva
131
132 There is no convention on the way to choice the last directory name in -a.
133 However in -b 'admsva' is mandatory.
134
13504- Save the Verilog-AMS source code
136
137 Save the source code of hicum0 from
138 http://www.iee.et.tu-dresden.de/~schroter/Hicum_PD/Hicumna/hicumL0V1p11.va
139 to:
140 <ngspice-data-tree>/src/spicelib/devices/adms/hicum0/admsva/hic0_full.va
141
142 NOTE: the name of the Verilog-AMS file that contains the 'module' declaration
143 should match the name of the module in the file.
144 For instance in file hic0_full.va you will find the following declaration:
145 ...
146 module hic0_full (c,b,e,s);
147 ...
148
14905- Create file 'Makefile.am'
150
151 In directory ..../hicum0 run the following command in order to create file 'Makefile.am':
152 $ admsXml admsva/hic0_full.va -Iadmsva -e ../admst/ngspiceMakefile.am.xml
153 [info] admsXml-2.1.3 Feb 2 2006 19:01:39
154 [warning] [admsva\hic0_full.va:30]: standard vams file created (not found in -I path) ... 'constants.h'
155 [warning] [admsva\hic0_full.va:31]: standard vams file created (not found in -I path) ... 'discipline.h'
156 [info] Makefile.am: file created
157 [info] elapsed time: 1.0624
158 [info] admst iterations: 185425 (185425 freed)
159 After this step file 'Makefile.am' is created:
160 $ head Makefile.am
161 ##
162 ## Interface:
163 ## created by: admsXml-2.1.3 - Monday, 01/30/06
164 ## Process this file with automake to produce Makefile.in
165 ADMSXMLINTERFACE:=../admst
166 adms:
167 admsXml.exe -Iadmsva admsva/hic0_full.va \
168
16906- Update/Create the auto-tools files (configure, Makefile.in, Makefile)
170
171 06.01 Manual changes
172 In directory <ngspice-data-tree> edit file configure.ac, add new device 'hicum0'
173 (use the name of the directory - not the name of the module):
174 $ grep hicum0 configure.ac
175 src/spicelib/devices/adms/hicum0/Makefile \
176 In directory <ngspice-data-tree>/src/spicelib/devices edit file Makefile.am, add new device 'hicum0':
177 $ grep hicum0 Makefile.am
178 adms/hicum0 \
179 adms/hicum0 \
180
181 06.02 Makefile.in
182 In directory <ngspice-data-tree> run the shell command 'automake':
183 File 'Makefile.in' is created in directory <ngspice-data-tree>/src/spicelib/devices/hicum0.
184 In directory <ngspice-data-tree>/src/spicelib/devices/hicum0 you should have:
185 $ ls
186 Makefile.am Makefile.in admsva constants.h discipline.h
187
188 06.03 Update file 'configure'
189 In directory <ngspice-data-tree> run the shell command 'autoconf':
190 File 'configure' is updated.
191 Edit the file to make sure that "adms/hicum0/Makefile" is present in the file.
192
193 06.04 Makefile
194 In directory <ngspice-data-tree> run shell command 'configure':
195 $ configure
196 ...
197 config.status: creating src/spicelib/devices/adms/hicum0/Makefile
198 ...
199 File 'Makefile' is created in directory <ngspice-data-tree>/src/spicelib/devices/hicum0.
200 In directory <ngspice-data-tree>/src/spicelib/devices/hicum0 you should have:
201 $ ls
202 Makefile Makefile.am Makefile.in admsva constants.h discipline.h
203
20407- Create the ready-to-compile auto-generated C code of device hicum0
205
206 In directory ..../hicum0 run the following command in order to create the auto-generated C code:
207 $ make adms
208 admsXml.exe -Iadmsva admsva/hic0_full.va \
209 -e ../admst/ngspiceVersion.xml \
210 -e ../admst/ngspiceMakefile.am.xml \
211 -e ../admst/ngspiceMODULEitf.h.xml \
212 -e ../admst/ngspiceMODULEinit.c.xml \
213 -e ../admst/ngspiceMODULEinit.h.xml \
214 -e ../admst/ngspiceMODULEext.h.xml \
215 -e ../admst/ngspiceMODULEdefs.h.xml \
216 -e ../admst/ngspiceMODULEask.c.xml \
217 -e ../admst/ngspiceMODULEmask.c.xml \
218 -e ../admst/ngspiceMODULEpar.c.xml \
219 -e ../admst/ngspiceMODULEmpar.c.xml \
220 -e ../admst/ngspiceMODULEload.c.xml \
221 -e ../admst/ngspiceMODULEacld.c.xml \
222 -e ../admst/ngspiceMODULEtemp.c.xml \
223 -e ../admst/ngspiceMODULEsetup.c.xml \
224 -e ../admst/ngspiceMODULEguesstopology.c.xml \
225 -e ../admst/ngspiceMODULE.c.xml
226 [info] admsXml-2.1.3 Feb 2 2006 19:01:39
227 [info] Makefile.am: file created
228 [info] hic0_fullitf.h: file created
229 [info] hic0_fullinit.c: file created
230 [info] hic0_fullinit.h: file created
231 [info] hic0_fullext.h: file created
232 [info] hic0_fulldefs.h: file created
233 [info] hic0_fullask.c: file created
234 [info] hic0_fullmask.c: file created
235 [info] hic0_fullpar.c: file created
236 [info] hic0_fullmpar.c: file created
237 [info] noise contribution not implemented - ignored!
238 [info] noise contribution not implemented - ignored!
239 [info] noise contribution not implemented - ignored!
240 [info] noise contribution not implemented - ignored!
241 [info] noise contribution not implemented - ignored!
242 [info] noise contribution not implemented - ignored!
243 [info] hic0_fullload.c: file created
244 [info] hic0_fullacld.c: file created
245 [info] hic0_fulltemp.c: file created
246 [info] hic0_fullsetup.c: file created
247 [info] hic0_fullguesstopology.c: file created
248 [info] hic0_full.c: file created
249 [info] elapsed time: 5.43757
250 [info] admst iterations: 1099640 (1099640 freed)
251 perl -p -i -e 's/IOP\("(\w+)"/IOP("\L\1"/' hic0_full.c
252
253 In directory <ngspice-data-tree>/src/spicelib/devices/hicum0 you should have:
254 $ ls
255 Makefile constants.h hic0_fullacld.c hic0_fullguesstopology.c hic0_fullload.c hic0_fullsetup.c
256 Makefile.am discipline.h hic0_fullask.c hic0_fullinit.c hic0_fullmask.c hic0_fulltemp.c
257 Makefile.in hic0_full.c hic0_fulldefs.h hic0_fullinit.h hic0_fullmpar.c
258 admsva hic0_fullext.h hic0_fullitf.h hic0_fullpar.c
259
26008- Compile the ready-to-compile auto-generated C code
261
262 In directory ..../hicum0 run the following command in order to create the object files*.o and libhic0_full.a:
263 $ make CFLAGS="-g"
264 if gcc -DHAVE_CONFIG_H -I. -I. -I../../../../.. -I../../../../../src/include -g -MT hic0_full.o
265 -MD -MP -MF ".ds/hic0_full.Tpo" -c -o hic0_full.o hic0_full.c; \
266 then mv -f ".deps/hic0_full.Tpo" ".deps/hic0_full.Po"; else rm -f ".deps/hic0_full.Tpo"; exit 1; fi
267 ...
268 ar cru libhic0_full.a hic0_full.o hic0_fullacld.o hic0_fullask.o hic0_fullguesstopology.o hic0_fullinit.o
269 hic0_fullload.o hic0_fullmask.o hic0_fullmpar.o hic0_fullpar.o hic0_fullsetup.o hic0_fulltemp.o
270 ranlib libhic0_full.a
271
272 WARNING: at the compilation step some messages about '#warning conflict' will be printed.
273 They mean that some ngspice reserved keywords have been used in the Verilog-AMS.
274 Just ignore them in the case of hicum0.
275
276 In directory <ngspice-data-tree>/src/spicelib/devices/hicum0 you should have:
277 $ ls
278 Makefile hic0_full.c hic0_fullask.o hic0_fullinit.h hic0_fullmask.o hic0_fullsetup.o
279 Makefile.am hic0_fulldefs.h hic0_fullinit.o hic0_fullmpar.c hic0_fulltemp.c
280 Makefile.in hic0_full.o hic0_fullext.h hic0_fullitf.h hic0_fullmpar.o hic0_fulltemp.o
281 admsva hic0_fullacld.c hic0_fullguesstopology.c hic0_fullload.c hic0_fullpar.c libhic0_full.a
282 constants.h hic0_fullacld.o hic0_fullguesstopology.o hic0_fullload.o hic0_fullpar.o
283 discipline.h hic0_fullask.c hic0_fullinit.c hic0_fullmask.c hic0_fullsetup.c
284
285 NOTE: CFLAGS is redefined to "-g" is order to speed up the compilation process.
286 It is better NOT to redefine CFLAGS for official releases.
287 (the compilation will take a lot longer to complete)
288
289
29009- Update manually the ngspice parser files
291 Modify the following files:
292 <ngspice-data-tree>/src/spicelib/parser/inp2q.c ----> depends on the type of the device, here 'q' device
293 <ngspice-data-tree>/src/spicelib/parser/inpdomod.c
294 <ngspice-data-tree>/src/spicelib/devices/dev.c
295 ...
29610- Update executable 'ngspice'
297
298 10-01 Update ngspice
299 In directory <ngspice-data-tree> run shell command 'make':
300 $ make
301 File 'src/ngspice.exe' is updated and contains the new device 'hicum0'.
302
303 10-02 Install ngspice
304 In directory <ngspice-data-tree> run shell command 'make':
305 $ make install
306 ngspice executables are installed in /usr/local/bin.
307
30811- Test the Implementation of hicum0 into ngspice
309 11-01 Create a simple ngspice netlist
310 Create file 'hicum0.sp'. Its contents is given below:
311 $ cat hicum0.sp
312 .title Netlist
313 .option
314 + temp=25.0
315 + reltol=1e-5
316 + abstol=1e-15
317 .model mybjtmodel npn
318 + npn=1
319 + level=5
320 qN1
321 + c b 0 0
322 + mybjtmodel
323 rcc cc c 100.0
324 rbb bb b 1k
325 vcc
326 + cc 0
327 + 1.0
328 vbb
329 + bb 0
330 + 0.0
331 + ac=0.0
332 .dc vbb 0.0 1.0 0.02
333 .print
334 + dc
335 + v(c)
336 + i(vbb)
337 + i(vcc)
338 .end
339
340 11-02 run 'ngspice':
341 $ ngspice -b hicum0.sp
342 Circuit: .title Netlist
343 Doing analysis at TEMP = 298.150000 and TNOM = 300.150000
344 No. of Data Rows : 51
345 .title Netlist
346 DC transfer characteristic Mon Jan 30 10:22:01 2006
347 --------------------------------------------------------------------------------
348 Index v-sweep v(c) vbb#branch vcc#branch
349 --------------------------------------------------------------------------------
350 0 0.000000e+00 1.000000e+00 0.000000e+00 -7.105421e-17
351 1 2.000000e-02 1.000000e+00 -5.593842e-19 -1.265654e-16
352 2 4.000000e-02 1.000000e+00 -2.076336e-18 -2.775558e-16
353 3 6.000000e-02 1.000000e+00 -5.366258e-18 -6.061817e-16
354 4 8.000000e-02 1.000000e+00 -1.254873e-17 -1.320055e-15
355 5 1.000000e-01 1.000000e+00 -2.812744e-17 -2.874367e-15
356 6 1.200000e-01 1.000000e+00 -7.629085e-17 -7.666090e-15
357 7 1.400000e-01 1.000000e+00 -1.669761e-16 -1.669553e-14
358 8 1.600000e-01 1.000000e+00 -3.645759e-16 -3.636425e-14
359 9 1.800000e-01 1.000000e+00 -7.948513e-16 -7.920553e-14
360 10 2.000000e-01 1.000000e+00 -1.732082e-15 -1.725142e-13
361 11 2.200000e-01 1.000000e+00 -3.773484e-15 -3.757461e-13
362 12 2.400000e-01 1.000000e+00 -8.219658e-15 -8.183998e-13
363 13 2.600000e-01 1.000000e+00 -1.790375e-14 -1.782522e-12
364 14 2.800000e-01 1.000000e+00 -3.899630e-14 -3.882434e-12
365 15 3.000000e-01 1.000000e+00 -8.493698e-14 -8.456170e-12
366 16 3.200000e-01 1.000000e+00 -1.849987e-13 -1.841804e-11
367 17 3.400000e-01 1.000000e+00 -4.029389e-13 -4.011557e-11
368 18 3.600000e-01 1.000000e+00 -8.776254e-13 -8.737407e-11
369 19 3.800000e-01 1.000000e+00 -1.911521e-12 -1.903059e-10
370 20 4.000000e-01 1.000000e+00 -4.163405e-12 -4.144973e-10
371 21 4.200000e-01 9.999999e-01 -9.068141e-12 -9.027994e-10
372 22 4.400000e-01 9.999998e-01 -1.975094e-11 -1.966349e-09
373 23 4.600000e-01 9.999996e-01 -4.301867e-11 -4.282821e-09
374 24 4.800000e-01 9.999991e-01 -9.369701e-11 -9.328218e-09
375 25 5.000000e-01 9.999980e-01 -2.040767e-10 -2.031732e-08
376 26 5.200000e-01 9.999956e-01 -4.444870e-10 -4.425191e-08
377 27 5.400000e-01 9.999904e-01 -9.680991e-10 -9.638130e-08
378 28 5.600000e-01 9.999790e-01 -2.108483e-09 -2.099148e-07
379 29 5.800000e-01 9.999543e-01 -4.591957e-09 -4.571626e-07
380 30 6.000000e-01 9.999004e-01 -9.999448e-09 -9.955176e-07
381 31 6.200000e-01 9.997833e-01 -2.176941e-08 -2.167303e-06
382 32 6.400000e-01 9.995284e-01 -4.736784e-08 -4.715812e-06
383 33 6.600000e-01 9.989751e-01 -1.029470e-07 -1.024912e-05
384 34 6.800000e-01 9.977781e-01 -2.231776e-07 -2.221894e-05
385 35 7.000000e-01 9.952090e-01 -4.812339e-07 -4.791028e-05
386 36 7.200000e-01 9.897838e-01 -1.026165e-06 -1.021618e-04
387 37 7.400000e-01 9.786930e-01 -2.140206e-06 -2.130697e-04
388 38 7.600000e-01 9.573154e-01 -4.287705e-06 -4.268455e-04
389 39 7.800000e-01 9.197474e-01 -8.062749e-06 -8.025264e-04
390 40 8.000000e-01 8.611162e-01 -1.395965e-05 -1.388838e-03
391 41 8.200000e-01 7.801099e-01 -2.212604e-05 -2.198901e-03
392 42 8.400000e-01 6.791392e-01 -3.235919e-05 -3.208608e-03
393 43 8.600000e-01 5.627227e-01 -4.429334e-05 -4.372773e-03
394 44 8.800000e-01 4.367031e-01 -5.756142e-05 -5.632969e-03
395 45 9.000000e-01 3.111929e-01 -7.186079e-05 -6.888071e-03
396 46 9.200000e-01 2.120521e-01 -8.696058e-05 -7.879479e-03
397 47 9.400000e-01 1.637984e-01 -1.026891e-04 -8.362016e-03
398 48 9.600000e-01 1.443326e-01 -1.189191e-04 -8.556674e-03
399 49 9.800000e-01 1.353683e-01 -1.355550e-04 -8.646317e-03
400 50 1.000000e+00 1.312181e-01 -1.525242e-04 -8.687819e-03
401 Total elapsed time: 0.625 seconds.
402 Current dynamic memory usage = 1.515520 MB,
403 Dynamic memory limit = 1241.702400 MB.
404
40512- How to update ngspice when the Verilog-AMS source code changes
406
407 If you modify the Verilog-AMS source code of 'hicum0'
408 just complete the following steps in order to update
409 'ngspice':
410
411 12-01 Update the auto-generated C code
412 In directory ..../hicum0 run:
413 - make clean
414 - make adms
415 - make
416 12-02 Update 'ngspice' and re-install
417 In directory <ngspice-data-tree> run:
418 - make
419 - make install
420
421Appendix 01: Comments on spice3-flavoured flags like npn, pnp, nmos, pmos and so on
422
423 In the adms-based implementation of hicum0 the value of the device type flag (either npn or pnp)
424 in the model card is just ignored.
425 The selection of the type of the device is actually done using model parameters.
426 In the Verilog-AMS code of hicum0 there are two special model parameters called 'npn' and 'pnp'
427 which decide what the type of the device will be (either a npn bipolar model or pnp bipolar model).
428 The Verilog-AMS piece of code that triggers the decision is as follows:
429 if (`PGIVEN(npn))
430 HICUMtype = `NPN;
431 else if (`PGIVEN(pnp))
432 HICUMtype = `PNP;
433 else
434 HICUMtype = `NPN;
435 end
436 `PGIVEN(npn) is a macro that returns 1 is model parameter 'npn' occurs in the .model card
437 of the ngspice netlist. Otherwise it returns 0.
438 For instance:
439 1- the following model card will select a NPN type device:
440 .model mybjtmodel npn
441 + npn=1
442 + level=5
443 2- the following model card will select a PNP type device:
444 .model mybjtmodel npn
445 + pnp=1
446 + level=5
447
448 In both cases flag 'npn' is just ignored.
449 In section 'Update manually the ngspice parser files' it is recommended
450 to use flag 'adms' instead.
451 This limitation results from the LRM of VerilogAMS that does not support flags.
452
453
454
README.adms
1This document is covered by the Creative Commons Attribution Share-Alike (CC-BY-SA) v4.0. .
2
3*************** Verilog A Device models in ngspice ******************************************
4
5
61 Introduction
7
8New compact device models today are released as Verilog-A code. Ngspice applies ADMS to
9translate the va code into ngspice C syntax. Currently a limited number of Verilog-A models is
10supported: HICUM level0 and level2 (HICUM model web page), MEXTRAM (MEXTRAM
11model web page), EKV (EKV model web page) and PSP (NXP PSP web site).
12
13
142 ADMS
15
16ADMS is a code generator that converts electrical compact device models specified in high-level
17description language into ready-to-compile C code for the API of spice simulators. Based on
18transformations specified in XML language, ADMS transforms Verilog-AMS code into other
19target languages. Here we use it to to translate the va code into ngspice C syntax.
20To make use of it, a set of ngspice specific XML files is distributed with ngspice in ngspice\
21src\spicelib\devices\adms\admst. Their translation is done by the code generator executable
22admsXml (see below).
23
24
253 How to integrate a Verilog-A model into ngspice
26
273.1 How to setup a *.va model for ngspice
28
29Unfortunately most of the above named models’ licenses are not compatible to free software
30rules as defined by DFSG. Therefore since ngspice-28 the va model files are no longer part of
31the standard ngspice distribution. They may however be downloaded as a tar.gz archive from the
32ngspice-30 file distribution folder. After downloading, you may expand the zipped files into
33your ngspice top level folder. The models enable dc, ac, and tran simulations. Noise simulation
34is not supported.
35Other (foreign) va model files will not compile without code tweaking, due to the limited
36capabilities of our ADMS installation.
37
38
393.2 Adding admsXml to your build environment
40
41The actual admsXml code is maintained by the QUCS project and is available at GitHub.
42Information on how to compile and install admsXml for Linux or Cygwin is available on the
43GitHub page. For MS Windows users admsXml.exe is available for download from
44https://sourceforge.net/projects/mot-adms/. You may copy admsXml.exe to your MSYS2 setup
45into the folder msys64\mingw64\bin, if 64 bit compilation is intended.
46More information, though partially outdated, is obtainable from the ngspice web pages
47(http://ngspice.sourceforge.net/admshowto.html) and from README-old.adms.
48
49
503.3 Compile ngspice with ADMS
51
52In the top level ngspice folder there are two compile scripts compile_min.sh and compile_linux.sh.
53They contain information how to compile ngspice with ADMS. You will have to run autogen.sh
54with the adms flag
55./autogen.sh --adms
56In addition you have to add --enable-adms to the ./configure command. Please check chapter
5732.1 of the ngspice manual for perequisites and further details.
58Compiling ngspice with ADMS with MS Visual Studio is not supported.
59
README.shared-xspice
1Enabling XSPICE data transfer over the shared ngspice api.
2
3This branch enhances shared ngspice capability to event driven XSPICE data transfer.
4
5The shared library (dll) exports three new function:
6ngSpice_Init_Evt() provides addresses for two new callback functions.
7 To be called upon initialization.
8ngGet_Evt_NodeInfo() provides info for a specific node.
9ngSpice_AllEvtNodes() provides a list of all event nodes.
10
11There are two new callback functions
12
13sendinitevt() sends info upon the event nodes: name, type an dcorresponding index
14and is calles once per event nodes upon initialization of the circuit.
15
16sendevt() is called each time, when for a given event node, that is determined
17by index, a time step has been accepted and its value has changed. This allows
18to immediately make use of that value in the calling process.
19
20For details on the definitions you may have a look at sharedspice.h.
21
22There is an example caller file (currently tested only under Windows,
23and compiled with Visual Studio) in directory ngspice\visualc\ng_shared_xspice_v.
24
25There is also a new feature: The 'save' command accepts the flag none of run in
26shared mode. Then there is no internal storage of analog output data, they are
27still available with the callback function ng_data. The above mentioned example
28file now includes a testrun2 to demonstrate this feature.
29
30The already existing fcn ngGet_Vec_Info(evtnode) will return an analog vector
31derived from event node evtnode containing 1 and 0.
32
README.tcl
1*********************************************************************************
2*Copied and written by Stefan Jones (stefan.jones@multigig.com) at Multigig Ltd *
3*Code based on and copied from ScriptEDA *
4*(http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/) *
5*Copyright (C) 2001 Author Pinhong Chen *
6* *
7*This program is free software; you can redistribute it and/or *
8*modify it under the terms of the GNU Lesser General Public License *
9*as published by the Free Software Foundation; either version 2 *
10*of the License, or (at your option) any later version. *
11* *
12*This program is distributed in the hope that it will be useful, *
13*but WITHOUT ANY WARRANTY; without even the implied warranty of *
14*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15*GNU Lesser General Public License for more details. *
16* *
17*You should have received a copy of the GNU Lesser General Public License *
18*along with this program; if not, write to the Free Software *
19*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
20*********************************************************************************
21
22WARNING!
23
24The text in this document has been prepared in 2006 and is partially outdated.
25It is provided here only for reference and may provide some (historical)
26information.
27
28
29Welcome to tclspice README_tcl
30
31This file acompanies ngspice sources starting with ngspice-rework-18. It
32describes what tclspice is, its installation, and points to resources that will
33help you to start with it. It also contains usefull datas to keep informed,
34get help, or get involved in the project.
35
36Enjoy
37
38Lionel (saintel@users.sourceforge.net)
39
40
41
42What is tclspice:
43
44tclspice is a variant of ngspice. It share 95% of its code (approx). The
45different between plain NGspice and tclspice is the type of binary it produces,
46and the way to access it. NGspice is a standalone program that you can execute
47and which can either automatically process a spice directives script. It can
48also propose you a command line interface.
49tclspice is a tcl package name. It is based on libspice shared library. This
50library is specifically designed to be loaded in tcl interpreters such as tclsh
51or wish. Then all spice directives are available as tcl functions. libspice also
52feature some new commands that are usefull for the integration into the tcl
53environment.
54
55tclspice differs from ngspice by its printf (bundled to tcl printf), malloc (tcl
56 malloc), data handling and plotting (BLT toolkit extensions to tcl/tk).
57
58
59Installing:
60
61Tclspice relies on three packages that are not included in ngspice:
62tcl : the tcl command interpreter, for interpretion of user scipt
63tk : the graphical extension of tcl, to represent data graphically and for GUIs
64blt : BLT toolkit gives number handling and plotting features to tcl/tk
65
66The latest configuration is (not much tested):
67tclspice-27
68tcl 8.4
69tk 8.4
70blt 2.4
71
72Tclspice is built and installed the same way as ngspice. Then, after reading this
73paragraph, the information you lack will probably be in README file in this directory.
74There is a configuration flag to set in order to compile tclspice library rather than
75plain ngspice, that is a standalone program. This flag is --with-tcl. It accepts an
76argument the path to tclConfig.sh
77
78If you don't provide any argument, configure script will try to find it automatically.
79 ./configure --enable-xspice --disable-cider --disable-xgraph --enable-numparam --with-readline=no --enable-adms=no --with-tcl
80
81If its does not, then it will propose you some possible locations.
82 can't find Tcl configuration script "tclConfig.sh"
83 Should you add --with-tcl=/usr/lib/tcl8.4/tclConfig.sh to ./configure arguments?
84
85If it does not, check that tcl8.4 is installed, and manually specify the path.
86 ./configure --enable-xspice --disable-cider --disable-xgraph --enable-numparam --with-readline=no --enable-adms=non --with-tcl=/usr/lib/tcl8.4
87
88Tclspice is not compatible with ngspice graphical code. Then when building tclspice,
89--no-x is automatically configured.
90
91
92
93Support and help :
94
95First of all (but last recourse), mail me at saintel@users.sourceforge.net
96
97For any kind of information on tclspice:
98 http://ngspice.sourceforge.net/tclspice.html
99It gives plenty of information. There is an index of good resources that you can
100read to get into tclspice quickly and proficently.
101
README.utf8
1use utf-8 for encoding of strings, this enables UNICODE
2international characters sets (of nearly any language)
3in plot titles and labels, file and folder names.
4
5Windows uses utf-16 and conversion functions between utf-8
6and utf-16, if access to Windows API functions is needed.
7A special fopen has been defined.
8
9In addition, plot labels on the y axis now are placed
10vertically, 90°, by using the Windows API or the Linux Xft library.
11
12Postscript plotting uses only a UNICODE subset, namely
13ISO-8859-1/ISO-8859-15, that allows extended ascii.
14
15Better looking fonts are now used for labelling the axes.
16
17Variables xbrushwidth and xgridwidth (to be set e.g. in
18.spiceinit or directly before a plot command) allow setting
19separately the linewidths of the graph (xbrushwidth) and
20the grid (xgridwidth).
21
22Slight modification of the Windows GUI string window to
23enhance readability.
24
25Windows GUI is now more responsive during lengthy op
26calculations.
27
28UNICODE in Gnuplot and (limited) in Postscript are supported.
29You will need to download and install gnuplot and a PS viewer
30(e.g. ghostscript, gv or others).
31
32Input files to ngspice now have to be utf-8 encoded. ANSI
33encoded files will fail (Notepad++ on Windows allows a simple
34conversion). For an ANSI version of ngspice you have to
35compile it with the configure flag --disable-utf8.
36
README.vdmos
1README for VDMOS model in NGSPICE
2==================
3
4A simmple MOS model for vertical power transistors (VDMOS model) is under
5development. Originally it has been available in LTSPICE
6(see http://ltwiki.org/LTspiceHelp/LTspiceHelp/M_MOSFET.htm) or
7SuperSpice (https://www.anasoft.co.uk/MOS1Model.htm).
8
9It is based on the MOS1 model. The Meyer capacitance has been
10replaced by a special cap model. A body diode with series
11resistance is parallel to the D/S device nodes. It defines the
12reverse behavior, but also the breakdown of the transistor.
13
14Basic current equations for ac, dc and tran operations are
15available as well as the capacitance model.
16
17Subthreshold behavior (parameter ksubthres) is available,
18and is compatible with LTSPICE. An alternative weak inversion
19model may be seected by choosing the subslope parameter instead
20of ksubthres.
21
22A quasi saturation model enhancement is available.
23
24The model parameters supported are:
25
26/* basic device */
27"vto", ,"Threshold voltage"
28"kp", "Transconductance parameter"
29"phi", "Surface potential"
30"lambda","Channel length modulation"
31"rd", "Drain ohmic resistance"
32"rs", "Source ohmic resistance"
33"rg", "Gate ohmic resistance"
34
35"tnom", "Parameter measurement temperature"
36"kf", "Flicker noise coefficient"
37"af", "Flicker noise exponent"
38
39/* quasi saturation */
40"rq", "Quasi saturation resistance fitting parameter"
41"vq", "Quasi saturation voltage fitting parameter"
42
43"mtriode", "Conductance multiplier in triode region"
44
45/* weak inversion */
46"subslope", "Slope of weak inversion log current versus vgs - vth "
47"subshift", "Shift of weak inversion plot on the vgs axis "
48"ksubthres", "Slope n from (vgs-vth)/n, LTSPICE and SuperSpice standard"
49
50/* body diode */
51"bv", "Vds breakdown voltage"
52"ibv", "Current at Vds=bv"
53"nbv", "Vds breakdown emission coefficient"
54"rds", "Drain-source shunt resistance"
55"rb", "Body diode ohmic resistance"
56"n", "Bulk diode emission coefficient"
57"tt", "Body diode transit time"
58"eg", "Body diode activation energy for temperature effect on Is"
59"Xti", "Body diode saturation current temperature exponent"
60"is", "Body diode saturation current"
61"vj", "Body diode junction potential"
62
63/* body diode capacitance (e.g. source-drain capacitance */
64"fc", "Body diode coefficient for forward-bias depletion capacitance formula"
65"cjo", "Zero-bias body diode junction capacitance"
66"m", "Body diode grading coefficient"
67
68/* gate-source and gate-drain capacitances */
69"cgdmin", "Minimum non-linear G-D capacitance"
70"cgdmax", "Maximum non-linear G-D capacitance"
71"a", "Non-linear Cgd capacitance parameter"
72"cgs", "Gate-source capacitance"
73