My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gatedDlatch.core.cpp
Go to the documentation of this file.
1 /*
2  * gatedDlatch.core.cpp - device implementations for gatedDlatch module
3  *
4  * This is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2, or (at your option)
7  * any later version.
8  *
9  */
10 
11 #if HAVE_CONFIG_H
12 #include <config.h>
13 #endif
14 
16 #include "component.h"
17 #include "device.h"
18 #include "gatedDlatch.core.h"
19 
20 #ifndef CIR_gatedDlatch
21 #define CIR_gatedDlatch -1
22 #endif
23 
24 // external nodes
25 #define D 0
26 #define C 1
27 #define QB 2
28 #define QO 3
29 // internal nodes
30 #define QA 4
31 
32 // useful macro definitions
33 #define NP(node) real (getV (node))
34 #define BP(pnode,nnode) (NP(pnode) - NP(nnode))
35 #define _load_static_residual2(pnode,nnode,current)\
36  _rhs[pnode] -= current;\
37  _rhs[nnode] += current;
38 #define _load_static_augmented_residual2(pnode,nnode,current)\
39  _rhs[pnode] -= current;\
40  _rhs[nnode] += current;
41 #define _load_static_residual1(node,current)\
42  _rhs[node] -= current;
43 #define _load_static_augmented_residual1(node,current)\
44  _rhs[node] -= current;
45 #define _load_static_jacobian4(pnode,nnode,vpnode,vnnode,conductance)\
46  _jstat[pnode][vpnode] += conductance;\
47  _jstat[nnode][vnnode] += conductance;\
48  _jstat[pnode][vnnode] -= conductance;\
49  _jstat[nnode][vpnode] -= conductance;\
50  if (doHB) {\
51  _ghs[pnode] += conductance * BP(vpnode,vnnode);\
52  _ghs[nnode] -= conductance * BP(vpnode,vnnode);\
53  } else {\
54  _rhs[pnode] += conductance * BP(vpnode,vnnode);\
55  _rhs[nnode] -= conductance * BP(vpnode,vnnode);\
56  }
57 #define _load_static_jacobian2p(node,vpnode,vnnode,conductance)\
58  _jstat[node][vpnode] += conductance;\
59  _jstat[node][vnnode] -= conductance;\
60  if (doHB) {\
61  _ghs[node] += conductance * BP(vpnode,vnnode);\
62  } else {\
63  _rhs[node] += conductance * BP(vpnode,vnnode);\
64  }
65 #define _load_static_jacobian2s(pnode,nnode,node,conductance)\
66  _jstat[pnode][node] += conductance;\
67  _jstat[nnode][node] -= conductance;\
68  if (doHB) {\
69  _ghs[pnode] += conductance * NP(node);\
70  _ghs[nnode] -= conductance * NP(node);\
71  } else {\
72  _rhs[pnode] += conductance * NP(node);\
73  _rhs[nnode] -= conductance * NP(node);\
74  }
75 #define _load_static_jacobian1(node,vnode,conductance)\
76  _jstat[node][vnode] += conductance;\
77  if (doHB) {\
78  _ghs[node] += conductance * NP(vnode);\
79  } else {\
80  _rhs[node] += conductance * NP(vnode);\
81  }
82 #define _load_dynamic_residual2(pnode,nnode,charge)\
83  if (doTR) _charges[pnode][nnode] += charge;\
84  if (doHB) {\
85  _qhs[pnode] -= charge;\
86  _qhs[nnode] += charge;\
87  }
88 #define _load_dynamic_residual1(node,charge)\
89  if (doTR) _charges[node][node] += charge;\
90  if (doHB) {\
91  _qhs[node] -= charge;\
92  }
93 #define _load_dynamic_jacobian4(pnode,nnode,vpnode,vnnode,capacitance)\
94  if (doAC) {\
95  _jdyna[pnode][vpnode] += capacitance;\
96  _jdyna[nnode][vnnode] += capacitance;\
97  _jdyna[pnode][vnnode] -= capacitance;\
98  _jdyna[nnode][vpnode] -= capacitance;\
99  }\
100  if (doTR) {\
101  _caps[pnode][nnode][vpnode][vnnode] += capacitance;\
102  }\
103  if (doHB) {\
104  _chs[pnode] += capacitance * BP(vpnode,vnnode);\
105  _chs[nnode] -= capacitance * BP(vpnode,vnnode);\
106  }
107 #define _load_dynamic_jacobian2s(pnode,nnode,vnode,capacitance)\
108  if (doAC) {\
109  _jdyna[pnode][vnode] += capacitance;\
110  _jdyna[nnode][vnode] -= capacitance;\
111  }\
112  if (doTR) {\
113  _caps[pnode][nnode][vnode][vnode] += capacitance;\
114  }\
115  if (doHB) {\
116  _chs[pnode] += capacitance * NP(vnode);\
117  _chs[nnode] -= capacitance * NP(vnode);\
118  }
119 #define _load_dynamic_jacobian2p(node,vpnode,vnnode,capacitance)\
120  if (doAC) {\
121  _jdyna[node][vpnode] += capacitance;\
122  _jdyna[node][vnnode] -= capacitance;\
123  }\
124  if (doTR) {\
125  _caps[node][node][vpnode][vnnode] += capacitance;\
126  }\
127  if (doHB) {\
128  _chs[node] += capacitance * BP(vpnode,vnnode);\
129  }
130 #define _load_dynamic_jacobian1(node,vnode,capacitance)\
131  if (doAC) {\
132  _jdyna[node][vnode] += capacitance;\
133  }\
134  if (doTR) {\
135  _caps[node][node][vnode][vnode] += capacitance;\
136  }\
137  if (doHB) {\
138  _chs[node] += capacitance * NP(vnode);\
139  }
140 
141 #define _save_whitenoise1(n1,pwr,type)\
142  _white_pwr[n1][n1] += pwr;
143 #define _save_whitenoise2(n1,n2,pwr,type)\
144  _white_pwr[n1][n2] += pwr;
145 #define _save_flickernoise1(n1,pwr,exp,type)\
146  _flicker_pwr[n1][n1] += pwr;\
147  _flicker_exp[n1][n1] += exp;
148 #define _save_flickernoise2(n1,n2,pwr,exp,type)\
149  _flicker_pwr[n1][n2] += pwr;\
150  _flicker_exp[n1][n2] += exp;
151 #define _load_whitenoise2(n1,n2,pwr)\
152  cy (n1,n2) -= pwr/kB/T0; cy (n2,n1) -= pwr/kB/T0;\
153  cy (n1,n1) += pwr/kB/T0; cy (n2,n2) += pwr/kB/T0;
154 #define _load_whitenoise1(n1,pwr)\
155  cy (n1,n1) += pwr/kB/T0;
156 #define _load_flickernoise2(n1,n2,pwr,exp)\
157  cy (n1,n2) -= pwr*pow(_freq,-exp)/kB/T0;\
158  cy (n2,n1) -= pwr*pow(_freq,-exp)/kB/T0;\
159  cy (n1,n1) += pwr*pow(_freq,-exp)/kB/T0;\
160  cy (n2,n2) += pwr*pow(_freq,-exp)/kB/T0;
161 #define _load_flickernoise1(n1,pwr,exp)\
162  cy (n1,n1) += pwr*pow(_freq,-exp)/kB/T0;
163 
164 // derivative helper macros
165 #define m00_hypot(v00,x,y) v00 = xhypot(x,y);
166 #define m10_hypot(v10,v00,x,y) v10 = (x)/(v00);
167 #define m11_hypot(v11,v00,x,y) v11 = (y)/(v00);
168 #define m00_max(v00,x,y) v00 = ((x)>(y))?(x):(y);
169 #define m10_max(v10,v00,x,y) v10 = ((x)>(y))?1.0:0.0;
170 #define m11_max(v11,v00,x,y) v11 = ((x)>(y))?0.0:1.0;
171 #define m00_min(v00,x,y) v00 = ((x)<(y))?(x):(y);
172 #define m10_min(v10,v00,x,y) v10 = ((x)<(y))?1.0:0.0;
173 #define m11_min(v11,v00,x,y) v11 = ((x)<(y))?0.0:1.0;
174 #define m00_pow(v00,x,y) v00 = pow(x,y);
175 #define m10_pow(v10,v00,x,y) v10 = (x==0.0)?0.0:(v00)*(y)/(x);
176 #define m11_pow(v11,v00,x,y) v11 = (x==0.0)?0.0:(log(x)*(v00));
177 
178 #define m00_div(v00,v10,x,y) double v10=1/(y); double v00=(x)*v10;
179 #define m10_div(v10,v00,vv,x,y)
180 #define m11_div(v11,v00,vv,x,y) double v11 = -v00*vv;
181 
182 #define m00_mult(v00,v10,v11,x,y) double v10=(x); double v11=(y); double v00=v10*v11;
183 #define m00_add(v00,x,y) double v00=(x)+(y);
184 
185 #define m00_cos(v00,x) v00 = cos(x);
186 #define m10_cos(v10,v00,x) v10 = (-sin(x));
187 #define m00_sin(v00,x) v00 = sin(x);
188 #define m10_sin(v10,v00,x) v10 = (cos(x));
189 #define m00_tan(v00,x) v00 = tan(x);
190 #define m10_tan(v10,v00,x) v10 = (1.0/cos(x)/cos(x));
191 #define m00_cosh(v00,x) v00 = cosh(x);
192 #define m10_cosh(v10,v00,x) v10 = (sinh(x));
193 #define m00_sinh(v00,x) v00 = sinh(x);
194 #define m10_sinh(v10,v00,x) v10 = (cosh(x));
195 #define m00_tanh(v00,x) v00 = tanh(x);
196 #define m10_tanh(v10,v00,x) v10 = (1.0/cosh(x)/cosh(x));
197 #define m00_acos(v00,x) v00 = acos(x);
198 #define m10_acos(v10,v00,x) v10 = (-1.0/sqrt(1-x*x));
199 #define m00_asin(v00,x) v00 = asin(x);
200 #define m10_asin(v10,v00,x) v10 = (+1.0/sqrt(1-x*x));
201 #define m00_atan(v00,x) v00 = atan(x);
202 #define m10_atan(v10,v00,x) v10 = (+1.0/(1+x*x));
203 #define m00_atanh(v00,x) v00 = atanh(x);
204 #define m10_atanh(v10,v00,x) v10 = (+1.0/(1-x*x));
205 #define m00_logE(v00,x) v00 = log(x);
206 #define m10_logE(v10,v00,x) v10 = (1.0/x);
207 #define m00_log10(v00,x) v00 = log10(x);
208 #define m10_log10(v10,v00,x) v10 = (1.0/x/M_LN10);
209 #define m00_sqrt(v00,x) v00 = sqrt(x);
210 #define m10_sqrt(v10,v00,x) v10 = (0.5/v00);
211 #define m00_fabs(v00,x) v00 = fabs(x);
212 #define m10_fabs(v10,v00,x) v10 = (((x)>=0)?(+1.0):(-1.0));
213 
214 #define m00_exp(v00,x) v00 = exp(x);
215 #define m10_exp(v10,v00,x) v10 = v00;
216 
217 #define m00_abs(v00) ((v00)<(0)?(-(v00)):(v00))
218 #define m00_floor(v00,x) v00 = floor(x);
219 #define m00_limexp(v00,x) v00 = ((x)<80.0?exp(x):exp(80.0)*(x-79.0));
220 #define m10_limexp(v10,v00,x) v10 = ((x)<80.0?(v00):exp(80.0));
221 
222 #define m20_logE(v00) (-1.0/v00/v00)
223 #define m20_exp(v00) exp(v00)
224 #define m20_limexp(v00) ((v00)<80.0?exp(v00):0.0)
225 #define m20_sqrt(v00) (-0.25/(v00)/sqrt(v00))
226 #define m20_fabs(v00) 0.0
227 #define m20_pow(x,y) ((y)*((y)-1.0)*pow(x,y)/(x)/(x))
228 #define m00_vt(x) (kBoverQ*(x))
229 #define m10_vt(x) (kBoverQ)
230 
231 // simulator specific definitions
232 #define _modelname "gatedDlatch"
233 #define _instancename getName()
234 #define _circuit_temp (getPropertyDouble("Temp")+273.15)
235 #define _param_given(p) (isPropertyGiven(p)?1:0)
236 
237 
238 // $vt and $vt() functions
239 #define _vt_nom (kBoverQ*_circuit_temp)
240 
241 using namespace device;
242 
243 /* Device constructor. */
245 {
246  type = CIR_gatedDlatch;
247 }
248 
249 /* Initialization of model. */
250 void gatedDlatch::initModel (void)
251 {
252  // create internal nodes
253  setInternalNode (QA, "QA");
254 
255  // get device model parameters
256  loadVariables ();
257  // evaluate global model equations
258  initializeModel ();
259  // evaluate initial step equations
260  initialStep ();
261  // evaluate global instance equations
262  initializeInstance ();
263 }
264 
265 /* Initialization of DC analysis. */
267 {
268  allocMatrixMNA ();
269  initModel ();
270  pol = 1;
271  restartDC ();
272  doAC = 1;
273  doTR = 0;
274  doHB = 0;
275 }
276 
277 /* Run when DC is restarted (fallback algorithms). */
279 {
280 }
281 
282 /* Initialize Verilog-AMS code. */
283 void gatedDlatch::initVerilog (void)
284 {
285  // initialization of noise variables
286 
287  int i1, i2, i3, i4;
288 
289  // zero charges
290  for (i1 = 0; i1 < 5; i1++) {
291  for (i2 = 0; i2 < 5; i2++) {
292  _charges[i1][i2] = 0.0;
293  } }
294 
295  // zero capacitances
296  for (i1 = 0; i1 < 5; i1++) {
297  for (i2 = 0; i2 < 5; i2++) {
298  for (i3 = 0; i3 < 5; i3++) {
299  for (i4 = 0; i4 < 5; i4++) {
300  _caps[i1][i2][i3][i4] = 0.0;
301  } } } }
302 
303  // zero right hand side, static and dynamic jacobian
304  for (i1 = 0; i1 < 5; i1++) {
305  _rhs[i1] = 0.0;
306  _qhs[i1] = 0.0;
307  _chs[i1] = 0.0;
308  _ghs[i1] = 0.0;
309  for (i2 = 0; i2 < 5; i2++) {
310  _jstat[i1][i2] = 0.0;
311  _jdyna[i1][i2] = 0.0;
312  }
313  }
314 }
315 
316 /* Load device model input parameters. */
317 void gatedDlatch::loadVariables (void)
318 {
319  TR_H = getPropertyDouble ("TR_H");
320  TR_L = getPropertyDouble ("TR_L");
321  Delay = getPropertyDouble ("Delay");
322 }
323 
324 /* #define's for translated code */
325 #undef _DDT
326 #define _DDT(q) q
327 #define _DYNAMIC
328 #define _DERIVATE
329 #define _DDX
330 #define _DERIVATEFORDDX
331 
332 /* Evaluate Verilog-AMS equations in model initialization. */
333 void gatedDlatch::initializeModel (void)
334 {
335 #if defined(_DYNAMIC)
336 #endif
337 {
338 Rd=1e3;
339 #if defined(_DYNAMIC)
340 Ccc=((Delay*1.43)/Rd);
341 #endif
342 }
343 }
344 
345 /* Evaluate Verilog-AMS equations in instance initialization. */
346 void gatedDlatch::initializeInstance (void)
347 {
348 }
349 
350 /* Evaluate Verilog-AMS equations in initial step. */
351 void gatedDlatch::initialStep (void)
352 {
353 }
354 
355 /* Evaluate Verilog-AMS equations in final step. */
356 void gatedDlatch::finalStep (void)
357 {
358 }
359 
360 /* Evaluate Verilog-AMS equations in analog block. */
361 void gatedDlatch::calcVerilog (void)
362 {
363 
364 /* ----------------- evaluate verilog analog equations -------------------- */
365 double In2;
366 #if defined(_DERIVATE)
367 double In2_VC_GND;
368 double In2_VD_GND;
369 #endif
370 double In2a;
371 #if defined(_DERIVATE)
372 double In2a_VD_GND;
373 #endif
374 double In1;
375 #if defined(_DERIVATE)
376 double In1_VD_GND;
377 double In1_VC_GND;
378 #endif
379 #if defined(_DERIVATE)
380 In1_VD_GND=(-(NP(C)));
381 In1_VC_GND=(-(NP(D)));
382 #endif
383 In1=(1-(NP(D)*NP(C)));
384 #if defined(_DERIVATE)
385 In2a_VD_GND=(-1.0);
386 #endif
387 In2a=(1-NP(D));
388 #if defined(_DERIVATE)
389 In2_VC_GND=(-(In2a));
390 In2_VD_GND=(-(NP(C)*In2a_VD_GND));
391 #endif
392 In2=(1-(NP(C)*In2a));
393 {
394 double m00_tanh(d00_tanh0,(TR_H*((In1*NP(QB))-0.5)))
395 #if defined(_DERIVATE)
396 double m10_tanh(d10_tanh0,d00_tanh0,(TR_H*((In1*NP(QB))-0.5)))
397 #endif
398 _load_static_residual1(QO,((-0.5)*(1-d00_tanh0)));
399 #if defined(_DERIVATE)
400 _load_static_jacobian1(QO,QB,((-0.5)*(-(TR_H*(In1))*d10_tanh0)));
401 _load_static_jacobian1(QO,C,((-0.5)*(-(TR_H*In1_VC_GND*NP(QB))*d10_tanh0)));
402 _load_static_jacobian1(QO,D,((-0.5)*(-(TR_H*In1_VD_GND*NP(QB))*d10_tanh0)));
403 #endif
404 }
406 #if defined(_DERIVATE)
408 #endif
409 {
410 double m00_tanh(d00_tanh0,(TR_L*((In2*NP(QA))-0.5)))
411 #if defined(_DERIVATE)
412 double m10_tanh(d10_tanh0,d00_tanh0,(TR_L*((In2*NP(QA))-0.5)))
413 #endif
414 _load_static_residual1(QB,((-0.5)*(1-d00_tanh0)));
415 #if defined(_DERIVATE)
416 _load_static_jacobian1(QB,QA,((-0.5)*(-(TR_L*(In2))*d10_tanh0)));
417 _load_static_jacobian1(QB,D,((-0.5)*(-(TR_L*In2_VD_GND*NP(QA))*d10_tanh0)));
418 _load_static_jacobian1(QB,C,((-0.5)*(-(TR_L*In2_VC_GND*NP(QA))*d10_tanh0)));
419 #endif
420 }
422 #if defined(_DERIVATE)
424 #endif
426 #if defined(_DERIVATE)
428 #endif
429 #if defined(_DYNAMIC)
431 #if defined(_DERIVATE)
433 #endif
434 #endif
435 
436 /* ------------------ end of verilog analog equations --------------------- */
437 
438 /* ------------------ evaluate verilog noise equations -------------------- */
439 
440 /* ------------------- end of verilog noise equations --------------------- */
441 }
442 
443 /* Perform DC iteration. */
445 {
446  // evaluate Verilog code
447  initVerilog ();
448  calcVerilog ();
449 
450  // fill right hand side and static jacobian
451  for (int i1 = 0; i1 < 5; i1++) {
452  setI (i1, _rhs[i1]);
453  for (int i2 = 0; i2 < 5; i2++) {
454  setY (i1, i2, _jstat[i1][i2]);
455  }
456  }
457 }
458 
459 /* Save operating points. */
461 {
462  // save global instance operating points
463 }
464 
465 /* Load operating points. */
467 {
468 }
469 
470 /* Calculate operating points. */
472 {
473 }
474 
475 /* Initialization of AC analysis. */
477 {
478  allocMatrixMNA ();
479 }
480 
481 /* Perform AC calculations. */
482 void gatedDlatch::calcAC (nr_double_t frequency)
483 {
484  setMatrixY (calcMatrixY (frequency));
485 }
486 
487 /* Compute Y-matrix for AC analysis. */
488 matrix gatedDlatch::calcMatrixY (nr_double_t frequency)
489 {
490  _freq = frequency;
492  matrix y (5);
493 
494  for (int i1 = 0; i1 < 5; i1++) {
495  for (int i2 = 0; i2 < 5; i2++) {
496  y (i1,i2) = rect (_jstat[i1][i2], _jdyna[i1][i2] * 2 * M_PI * _freq);
497  }
498  }
499 
500  return y;
501 }
502 
503 /* Initialization of S-parameter analysis. */
505 {
506  allocMatrixS ();
507 }
508 
509 /* Perform S-parameter calculations. */
510 void gatedDlatch::calcSP (nr_double_t frequency)
511 {
512  setMatrixS (ytos (calcMatrixY (frequency)));
513 }
514 
515 /* Initialization of transient analysis. */
517 {
518  setStates (2 * 5 * 5);
519  initDC ();
520 }
521 
522 /* Perform transient analysis iteration step. */
523 void gatedDlatch::calcTR (nr_double_t)
524 {
525  doHB = 0;
526  doAC = 1;
527  doTR = 1;
528  calcDC ();
529 
530  int i1, i2, i3, i4, state;
531 
532  // 2-node charge integrations
533  for (i1 = 0; i1 < 5; i1++) {
534  for (i2 = 0; i2 < 5; i2++) {
535  state = 2 * (i2 + 5 * i1);
536  if (i1 != i2)
537  if (_charges[i1][i2] != 0.0)
538  transientCapacitanceQ (state, i1, i2, _charges[i1][i2]);
539  } }
540 
541  // 1-node charge integrations
542  for (i1 = 0; i1 < 5; i1++) {
543  state = 2 * (i1 + 5 * i1);
544  if (_charges[i1][i1] != 0.0)
545  transientCapacitanceQ (state, i1, _charges[i1][i1]);
546  }
547 
548  // charge: 2-node, voltage: 2-node
549  for (i1 = 0; i1 < 5; i1++) {
550  for (i2 = 0; i2 < 5; i2++) {
551  if (i1 != i2)
552  for (i3 = 0; i3 < 5; i3++) {
553  for (i4 = 0; i4 < 5; i4++) {
554  if (i3 != i4)
555  if (_caps[i1][i2][i3][i4] != 0.0)
556  transientCapacitanceC (i1, i2, i3, i4, _caps[i1][i2][i3][i4], BP(i3,i4));
557  } } } }
558 
559  // charge: 2-node, voltage: 1-node
560  for (i1 = 0; i1 < 5; i1++) {
561  for (i2 = 0; i2 < 5; i2++) {
562  if (i1 != i2)
563  for (i3 = 0; i3 < 5; i3++) {
564  if (_caps[i1][i2][i3][i3] != 0.0)
565  transientCapacitanceC2Q (i1, i2, i3, _caps[i1][i2][i3][i3], NP(i3));
566  } } }
567 
568  // charge: 1-node, voltage: 2-node
569  for (i1 = 0; i1 < 5; i1++) {
570  for (i3 = 0; i3 < 5; i3++) {
571  for (i4 = 0; i4 < 5; i4++) {
572  if (i3 != i4)
573  if (_caps[i1][i1][i3][i4] != 0.0)
574  transientCapacitanceC2V (i1, i3, i4, _caps[i1][i1][i3][i4], BP(i3,i4));
575  } } }
576 
577  // charge: 1-node, voltage: 1-node
578  for (i1 = 0; i1 < 5; i1++) {
579  for (i3 = 0; i3 < 5; i3++) {
580  if (_caps[i1][i1][i3][i3] != 0.0)
581  transientCapacitanceC (i1, i3, _caps[i1][i1][i3][i3], NP(i3));
582  } }
583 }
584 
585 /* Compute Cy-matrix for AC noise analysis. */
586 matrix gatedDlatch::calcMatrixCy (nr_double_t frequency)
587 {
588  _freq = frequency;
589  matrix cy (5);
590 
591 
592  return cy;
593 }
594 
595 /* Perform AC noise computations. */
596 void gatedDlatch::calcNoiseAC (nr_double_t frequency)
597 {
598  setMatrixN (calcMatrixCy (frequency));
599 }
600 
601 /* Perform S-parameter noise computations. */
602 void gatedDlatch::calcNoiseSP (nr_double_t frequency)
603 {
604  setMatrixN (cytocs (calcMatrixCy (frequency) * z0, getMatrixS ()));
605 }
606 
607 /* Initialization of HB analysis. */
609 {
610  initDC ();
611  allocMatrixHB ();
612 }
613 
614 /* Perform HB analysis. */
616 {
617  doHB = 1;
618  doAC = 1;
619  doTR = 0;
620 
621  // jacobian dI/dV and currents get filled
622  calcDC ();
624 
625  // fill in HB matrices
626  for (int i1 = 0; i1 < 5; i1++) {
627  setQ (i1, _qhs[i1]); // charges
628  setCV (i1, _chs[i1]); // jacobian dQ/dV * V
629  setGV (i1, _ghs[i1]); // jacobian dI/dV * V
630  for (int i2 = 0; i2 < 5; i2++) {
631  setQV (i1, i2, _jdyna[i1][i2]); // jacobian dQ/dV
632  }
633  }
634 }
635 
636 #include "gatedDlatch.defs.h"