Project

General

Profile

SPICE TEAM » History » Version 9

jun chen, 03/07/2025 12:23 AM

1 1 jun chen
# SPICE TEAM
2 6 jun chen
-------------------------------------------------------------------
3 7 jun chen
4 6 jun chen
## Some tips for piece(Ngspice) user (by Kramer)
5 1 jun chen
6 6 jun chen
For the hspice or other spice user, in-house spice simulator piece has many triky usags and I list some of them here.
7
8
1. About easurement
9
10
Both meas line at control block and outside of control block are supported, but both cannot support any complex expression as below
11
12
```
13
.meas tran vtest find par('v(n1)-v(n0)') at=40n
14
.meas tran ttest when v(n1) = 'v(0)+vdd'
15
```
16
The right way is
17
```
18
.control
19
let vdiff = v(n1)-v(n0)
20
let vtest = v(0)+vdd
21
meas tran vtest find vdiff at=40n
22
meas tran ttest when v(n1) = vtest
23
.endc
24
```
25
There are more useful measurement statements for example.
26
27
```
28
.control
29
* rhs of let statement cannot use the golbal parameter outside of control block while vdd is a special case!
30
let halfvdd = 'vdd/2'
31
let trans = {v(q)*v(cp)/vdd}
32
meas tran tran01 when tranx = 'halfvdd' rise=1
33
meas tran delay1 trig v(in) val='halfvdd' fall=1 targ v(zn) val = 'halfvdd' rise=1
34
print tran01 delay 1 > trans.txt
35
.endc
36
```
37
2. some useful options
38
```
39
.opt noopac  ; skip op when do ac analysis
40
.opt numdgt=9 ; set the output data's digital number to 9 (must set in control block, as *.control numdgt=9 .endc*)
41
*#set nobreak ; set output data file without page break
42
.opt maxord=1 method=trap trtol=1  ; options to get stable waveform without some ring (more accuracy)
43
```
44
45
The following lines to set autostop when v(zn) cloase to zero
46
```
47
.opt autostop
48
.meas tran tend when v(zn)='vss+1e-5' fall=1
49
```
50
51
3. about output file format
52
53
In control block, we can use print or wrdata to dump data to file.
54
```
55
print i(vp) i(cl_t) v(q) > dat1.txt
56
wrdata dat2.txt i(vp) i(cl_t) v(q)
57
```
58
59
The dat1.txt(left) and dat2.txt(right) as below:
60
61
![](clipboard-202503070017-nfx2n.png)
62
63 7 jun chen
4. alter usage
64
65
Wrong usage for altering C1's capacitance:
66
67
```
68
C1 1 0 'cload'
69
.control
70
alter C1=1p
71
tran 1p 10n
72
alter C1=1.2p
73
tran 1p 10n
74
.endc
75
```
76
77
The right way as below, in the above case, the latter simulation will be impacted by the former.
78
```
79
c1 1 0 'cload'
80
.control
81
alterparam cload = 1p
82
reset
83
tran 1p 10n
84
alterparam cload = 1.2p
85
reset
86
tran 1p 10n
87
.endc
88
```
89
90 6 jun chen
-----------------------------------------------------------------
91 9 jun chen
## Development Environment:
92 8 jun chen
New spice engine "piece" is located in pub2018/bin/rhelx-64/analog. (2021/7/12 historical moments!!!)
93 7 jun chen
94 8 jun chen
piece update can flow below procedure [[Tool_lib_organization]]
95
96
## 
97
98
-----------------------------------------------------------------
99
100 1 jun chen
## Reference SPICE center (Repository in 10.30.100.22/spice)
101
102 3 jun chen
## **ngSPICE**
103 4 jun chen
> Reference:  http://ngspice.sourceforce.net/docs.html
104
> User manual:  attachment:"ngspice-34-manual.pdf"
105
> Binary and library install guidance:  attachment:"ngspice_install.pptx"
106
> ngspice git clone: `git clone ssh://git@10.30.100.22:222/analog/spice.git`
107
> Local build binary with ngSpice 34: `/rnd1/jchen/ngspice34/agigaspice/release/bin/bin/ngspice`
108
> Example spice file: `/rnd1/jchen/ngspice34/agigaspice/examples`
109 8 jun chen
> [[Ngspice compiling method enhancement]] (SiQi)
110 3 jun chen
111 4 jun chen
## **spice3f5 元祖SPICE**
112
> attachment:"spice3f5.tar.gz"
113 1 jun chen
114 4 jun chen
## **cuSPICE, (CUDA ver. ngSPICE)**
115
> attachment:"CuSPICE.pdf"
116 5 jun chen
> Reference: SPICE on GPU:  http://ngspice.sourceforge.net/cuspice.html
117 1 jun chen
118
## **xyce** 
119 3 jun chen
> Xyce install method (Langyun):   attachment:"基于WSL的Ubuntu系统Serial Xyce编译整理.docx"
120 2 jun chen
> Reference: https://xyce.sandia.gov/
121
122 4 jun chen
##  **SPICE 历史** 
123
> attachment:"SPICE_history.docx"