You could theoretically implement your equations by pretending you were programming an analog computer. That is, assign voltage values to global nodes that represented the values that your were generating and then using those voltage values later as different kinds of input through some conversion "hardware". Don't know for certain that this would work, and it would certainly be a huge kludge. jon -----Original Message----- From: si-list-bounce@xxxxxxxxxxxxx [mailto:si-list-bounce@xxxxxxxxxxxxx]On Behalf Of Ray Anderson Sent: Wednesday, September 03, 2003 2:54 PM To: si-list@xxxxxxxxxxxxx; piesiewicz@xxxxxxxxxxxxx Subject: [SI-LIST] Re: HSpice implementation of recursive convolution Radoslaw - =20 I think what you are trying to accomplish may be rather difficult to accomplish within Hspice. You have identified one of the fundamental limitations in the Hspice simulator architecture. I believe that variables defined in .param statements are evaluated only once during a spice run (i.e., you can't dynamically change the calculated values). It might appear that you could accomplish what you want to do utilizing a .print statment with an equation in a PAR() expression. The problem there is that while yes, you can print out a listing of time steps (say from the TIME variable), you can't do anything with the values you see printed out except look at them. The values aren't available for further use during a simulation. (the .print var PAR('equatio= n') construct functions very much like the algebraic capabilities in the AWAVES viewer in that the math is done AFTER the simulation, rather than during it= ) One _possible_ thing you may want to look into is using parameter defined circuit elements as behavioral elements to implement your equations. In theory I think you _might_ be able to get something to work but without looking into it further I really can't say for sure. If it can be made to work the solution would most likely be a kludgey workaround of the inherent simulator limitations. Perhaps some of the "real" Hspice gurus lurking on t= he list may have some suggestions. In speaking with a former IBM'er I learned that their in-house simulator "ASTAP" does allow one to do exactly what you are attempting to accomplish. Maybe the guys at Synopsys (the current Hspice owners) will take note of th= is discussion and think about implementing features to allow the use of recursive equations in Hspice during runtime. Good luck, if you get it to work please post your method to the si-list so the rest of us can learn how it is done! -Ray Anderson Sun Microsystems Inc. > >Thanks for responding, > >I have already tried what you suggested. The problem is, that the current = of >the source must be updated every, user defined, transient step, here dt. >This updating is done in a recursive manner in a two step process. I enclo= se >the listing in HSpice, with suggestions from you, and the problem is that >the equations seem to be calculated only once and are not updated every dt >step during transient analysis. How to solve this problem ? (make HSpice >update given parameters every dt step during transient analysis) > > >.OPTIONS LIST NODE POST > >.OP > >.PARAM k_11=3D1g > >.PARAM p_1=3D-5g > >.PARAM dt=3D20p > >.PARAM theta=3D'(-1/p_1**2-dt/p_1+exp(p_1*dt)/p_1**2)/dt' > >.PARAM x=3D'x+theta*V(1,2)' > >.PARAM x=3D'exp(p_1*dt)*x+(exp(p_1*dt)*(p_1*dt-1)+1)*V(1,2)/(dt*p_1**2)' > >.PARAM i_eq=3D'k_11*x' > >.TRAN dt 2n > >V1 1 0 10 AC 1 PWL 1p 0 2p 0.5 4p 1 2n 1 > >I1 1 2 i_eq >R1 1 2 1/'k_11*theta' > >C1 2 0 1p > > >.END >-----Urspr=FCngliche Nachricht----- >Von: "Raymond Anderson" <raymond.anderson@xxxxxxx> >An: <piesiewicz@xxxxxxxxxxxxx> >Cc: "Signal Integrity" <si-list@xxxxxxxxxxxxx> >Gesendet: Dienstag, 2. September 2003 23:53 >Betreff: Re: [SI-LIST] HSpice implementation of recursive convolution > > >> Equations may be evaluated within an Hspice deck at runtime by defining >> the equations within a .param statement. >> >> Here is a snippet from an Hspice deck showing a number of component >> values being calculated by way of equations at runtime: >> >> .param pi2=3D'2*3.14159' >> .param c1=3D1uF >> .param r1=3D'1/(pi2*fI*c1)' >> .param r2=3D'1/(pi2*z1*c1)' >> .param r3=3D'pi2*z2*r1/(pi2*p1-pi2*z2)' >> .param c2=3D'1/(pi2*z2*(r1+r3))' >> .param c3=3D'1/(pi2*p2*r2)' >> >> I haven't looked into the details of your code, but the general >> implementation might look something like this: >> >> >> .param v =3D 'Vtran(n1) - Vtran(n2)' >> .param x =3D 'x+theta*v' >> .param x =3D 'exp(p_1*dt)*x+ exp(p_1*dt-1)*v' >> .param i_eq =3D 'k_11*x' >> >> Hopefully this gives you a starting point. >> >> BTW, the 'S element' in the recent versions of Hspice utilizes >> recursive convolution internally when doing time domain simulation >> of s-parameter defined transfer functions. >> >> >> -Ray Anderson >> Sun Microsystems Inc. >> >> >> >> Radoslaw Piesiewicz wrote: >> > Hi, >> > I have a problem, namely how to implement the following code (it is >recursive convolution) in HSpice, the code is from some simulator that wor= ks >similarly to HSpice. The problem is to calculate the current Curr, it is >done in two step process >> > at every step in the transient analysis (at the intervals of FIXED >parameter). The problem is in implementing the part CALC ... ENDCALC >> > >> > Thanks >> > >> > Code: >> > >> > Var k_11 1.0G >> > Var p_1 -5.0G >> > Var dt 2p >> > Var theta FUNC=3D(p_1**2+exp(p_1*dt)) >> > Var x=3D0 >> > Var i_eq 0 >> > Var v=3D0 >> > >> > Res 'portVCCS' n1 n2 1.0 G=3Dk_11*theta >> > Curr 'portCurr' n1 n2 TRAN=3Di_eq >> > >> > Cap 'Cload' n2 GND 1p >> > >> > Volt 'Vin' n1 GND TRAN=3D1*(t>0) >> > >> > Sweep '' >> > + LOOP 1001 TIME LIN 0 2n FIXED >> > + X 't' 's' 0 2n MULTX=3D'n' >> > + Y 'u_(out)' 'V' 0 2 >> > >> > CALC >> > >> > v =3D Vtran(n1) - Vtran(n2) >> > x=3D x+theta*v >> > x=3D exp(p_1*dt)*x+ exp(p_1*dt-1)*v >> > i_eq=3Dk_11*x >> > >> > ENDCALC >> > >> > Show Y Vtran(n2) >> > >> >> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = -=20 >- - - - - - - - - - - - - - - >> > Dipl.-Ing. Radoslaw Piesiewicz >> >> > ------------------------------------------------------------------ To unsubscribe from si-list: si-list-request@xxxxxxxxxxxxx with 'unsubscribe' in the Subject field or to administer your membership from a web page, go to: //www.freelists.org/webpage/si-list For help: si-list-request@xxxxxxxxxxxxx with 'help' in the Subject field List archives are viewable at: //www.freelists.org/archives/si-list or at our remote archives: http://groups.yahoo.com/group/si-list/messages Old (prior to June 6, 2001) list archives are viewable at: http://www.qsl.net/wb6tpu ------------------------------------------------------------------ To unsubscribe from si-list: si-list-request@xxxxxxxxxxxxx with 'unsubscribe' in the Subject field or to administer your membership from a web page, go to: //www.freelists.org/webpage/si-list For help: si-list-request@xxxxxxxxxxxxx with 'help' in the Subject field List archives are viewable at: //www.freelists.org/archives/si-list or at our remote archives: http://groups.yahoo.com/group/si-list/messages Old (prior to June 6, 2001) list archives are viewable at: http://www.qsl.net/wb6tpu