SPICE TEAM » History » Version 10
jun chen, 03/07/2025 12:36 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 |  |
||
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 | 10 | jun chen | |
92 | 9 | jun chen | ## Development Environment: |
93 | 10 | jun chen | |
94 | 8 | jun chen | New spice engine "piece" is located in pub2018/bin/rhelx-64/analog. (2021/7/12 historical moments!!!) |
95 | 7 | jun chen | |
96 | 8 | jun chen | piece update can flow below procedure [[Tool_lib_organization]] |
97 | 10 | jun chen | |
98 | ### Useful tools |
||
99 | |||
100 | **Auto generate package RLCK netlist tool {By SiQi)** |
||
101 | |||
102 | Please refer to the ppt for details and usages: attachment:"netlist_auto_generator.pptx" |
||
103 | |||
104 | ``` |
||
105 | /rndl/sqchen/importand—thing/scripts/feature—test/spice/generate—netlist/auto—gene.py -c |
||
106 | <config—file> -f <output format> |
||
107 | ``` |
||
108 | |||
109 | **Sweep netlist and draw distribution histogram tool {By SiQi)** |
||
110 | |||
111 | Please refer to the ppt for details and usages: attachment:"sweep_netlist_draw_histogram.pptx" |
||
112 | ``` |
||
113 | /rndl/sqchen/importand—thing/scripts/feature—test/spice/sweep—netlist/sweep—netlist.py -n |
||
114 | <netlist> |
||
115 | ``` |
||
116 | |||
117 | ### Spice regression system {by Siqi) |
||
118 | |||
119 | There is a new regression running system for SPICE cases, which is independent from wukong system. |
||
120 | |||
121 | Please refer to the slides for all details: attachment:"SPICE_regression_system_intro.pptx" |
||
122 | |||
123 | [Jenkins_Tutorials](attachment:"Jenkins_Tutorials.pdf") (By ZhengYu) |
||
124 | |||
125 | Docker user manual: attachment:"docker使用简明文档.docx" |
||
126 | |||
127 | 3 different kinds of performance check tools we have now (by Siqi): attachment:"performance_check_tool.pptx" |
||
128 | 8 | jun chen | |
129 | ## |
||
130 | |||
131 | ----------------------------------------------------------------- |
||
132 | |||
133 | 1 | jun chen | ## Reference SPICE center (Repository in 10.30.100.22/spice) |
134 | |||
135 | 3 | jun chen | ## **ngSPICE** |
136 | 4 | jun chen | > Reference: http://ngspice.sourceforce.net/docs.html |
137 | > User manual: attachment:"ngspice-34-manual.pdf" |
||
138 | > Binary and library install guidance: attachment:"ngspice_install.pptx" |
||
139 | > ngspice git clone: `git clone ssh://git@10.30.100.22:222/analog/spice.git` |
||
140 | > Local build binary with ngSpice 34: `/rnd1/jchen/ngspice34/agigaspice/release/bin/bin/ngspice` |
||
141 | > Example spice file: `/rnd1/jchen/ngspice34/agigaspice/examples` |
||
142 | 8 | jun chen | > [[Ngspice compiling method enhancement]] (SiQi) |
143 | 3 | jun chen | |
144 | 4 | jun chen | ## **spice3f5 元祖SPICE** |
145 | > attachment:"spice3f5.tar.gz" |
||
146 | 1 | jun chen | |
147 | 4 | jun chen | ## **cuSPICE, (CUDA ver. ngSPICE)** |
148 | > attachment:"CuSPICE.pdf" |
||
149 | 5 | jun chen | > Reference: SPICE on GPU: http://ngspice.sourceforge.net/cuspice.html |
150 | 1 | jun chen | |
151 | ## **xyce** |
||
152 | 3 | jun chen | > Xyce install method (Langyun): attachment:"基于WSL的Ubuntu系统Serial Xyce编译整理.docx" |
153 | 2 | jun chen | > Reference: https://xyce.sandia.gov/ |
154 | |||
155 | 4 | jun chen | ## **SPICE 历史** |
156 | > attachment:"SPICE_history.docx" |