HSPICE Questions, Using E and F element

Status
Not open for further replies.

MammPp

Junior Member level 2
Joined
Sep 14, 2008
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,441
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]
 

What problems did you get with the original subcircuit? I don't use Hspice but my simulator is generally compatible with Hspice and runs ok with the original subcircuit but with quite a few errors with your modified one.

Keith.
 

it seems that E element can not be embedded in F element.
anyway, what's your defining equation?
I(Fmen)=??
 

The original subcircuit is good however it's fit with the NG-SPICE not HSPICE.

Since my circuit simulator is HSPICE, I tried to convert from the original subcircuit to HSPICE. As shown above, E-Element is not compatible with F-Element so I tried to find the solution of this problem.

prcken: the definition of I(Fmem) is

-0.5e-10 +I(Ecopy)e-10 - I(Vsense)*I(Ecopy) + I(Vsense)*I(Ecopy)^2
 

i see, your defining equation is correct.
i think the problem lies in Ecopy is another controlled source. you can do a simple test, change Ecopy to a independent source and run simulation to see whether there is a error.

btw, what's the defining equation of Ecopy?
Ecopy is -V(6)? while the voltage at node6 is unknown, you want to sovle the current at the exact node 6, maybe there is a convergence problem?
 

The reason that I think the problem is from Ecopy is, when I used Vtest instead of Ecopy, the error is not occured.

For the definition of Ecopy, to tell the truth, I don't know. (just want to convert the code in NG-SPICE to HSPICE).

However, I tried to changed the Fmem to

Fmem 6 0 poly(2) Vsense 0 6 -0.5e-10 0 1e-10 0 -1 0 0 0 1

(Changed Ecopy to 0 6)
The same error is still occured.
 

Fmem 6 0 poly(2) Vsense 0 6 -0.5e-10 0 1e-10 0 -1 0 0 0 1

you can not do that
you can not change the name of voltage source through which the controlling
current flows into two nodes.
Eres 1 9 poly(2) (8,0) (11,0) 0 0 0 0 1
if this works
maybe you can try this ?
Fmem 6 0 poly(2) Vsense (0 6) -0.5e-10 0 1e-10 0 -1 0 0 0 1
 

Fmem 6 0 poly(2) Vsense (0 6) -0.5e-10 0 1e-10 0 -1 0 0 0 1

This one is not work. T_T
 

I have not made any suggestions as I don't use Hspice or NG-Spice and I thought you were managing to solve the problem.

At the risk of making a daft suggestion, could you not just put a voltage source with zero voltage in series with Ecopy, then use that in your Fmem statement?

Keith.
 

keith1200rs:
I don't understand about your suggestion. Is it possible that you could give me some clue ?

Anyone know this answer, please let me know
 

Assuming the earlier statement is correct "... E element can not be embedded in F element" then you need to add another device to get round the problem. If you add a voltage source with zero voltage in series with the E source (Ecopy) then it will have no effect on the E source but will not give you a device other than an E source to sense the current for the F element - the zero voltage source.

Keith.
 

    MammPp

    Points: 2
    Helpful Answer Positive Rating
Keith,

Thank you so much, it's worked.

Pilin
 

I'm just entering the world of circuit simulation in the theory memristor has two terminals and three write code, someone can explain ...
 

3rd terminal can used to set the initial value. this node should be floating.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…