Dear all,
I tried to convert the macro model from NG-SPICE to HSPICE, however I stuck in some problems.
Subcircuit from NG-SPICE
.SUBCKT Mem 1 2 6
Eres 1 9 poly(2) (8,0) (11,0) 0 0 0 0 1
Vsense 9 4 DC 0V
Fcopy 0 8 Vsense 1
Rstep 8 0 1k
Rser 2 4 10
Fmem 6 0 poly(2) Vsense Ecopy -0.5e-10 0 1e-10 0 -1 0 0 0 1
Cmem 6 0 90nF
Rsp 6 0 1000Meg
Ecopy 7 0 0 6 1
Rc 7 0 1
Ecpy2 10 0 6 0 1
Vref ref 0 DC 1V
R1 10 11 100k
Ssat1 11 0 0 11 SWX
Ssat2 11 ref 11 ref SWX
.model SWX SW(Ron=0.001, Roff=1000Meg, Vt=0.00001V, Vh=0.00001V)
.ends Mem
From the above model, I changed to HSPICE as the following
.SUBCKT Mem 1 2 6
Eres 1 9 poly(2) (8,0) (11,0) 0 0 0 0 1
Vsense 9 4 DC 0V
Fcopy 0 8 Vsense 1
Rstep 8 0 1k
Rser 2 4 10
Ecopy 7 0 0 6 1
Cmem 6 0 90nF
Rsp 6 0 1000Meg
Rc 7 0 1
Ecpy2 10 0 6 0 1
Vref ref 0 DC 1V
R1 10 11 100k
Gswitch1 11 0 VCR PWL(1) 0 11 0V,1000Meg 0.00001V,0.001
Gswitch2 11 ref VCR PWL(1) 11 ref 0V,1000Meg 0.00001V,0.001
Fmem 6 0 poly(2) Vsense Ecopy -0.5e-10 0 1e-10 0 -1 0 0 0 1
.ends Mem
From above HSPICE code, there is an error as the following
fmem 6 0 poly(2) vsense ecopy -0.5e-10 0 1e-10 0 -1 0 0 0 1
**error** (d:\neu course\phd\hspice\memristor\memristor 3 adampj.sp:27) voltage source not found on above line
**error** (d:\neu course\phd\hspice\memristor\memristor 3 adampj.sp:27) difficulty in reading input
In my view, the problem is from Ecopy. Since I think, Ecopy can't use as the current source in the F-Element.
Anyone has some ideas to fix this problem ?
Thank you,
PJ
P.S. I'm also not sure that the switch from NG-SPICE code the I changed to HSPICE is correct. If it's possible, anyone could check that line for me also.[/b]