Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Memristor simulation in HSPICE

Status
Not open for further replies.

basawaraj

Newbie level 6
Newbie level 6
Joined
Mar 31, 2012
Messages
12
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,283
Activity points
1,401
Hi,

I am working with memristors and have been trying to simulate their behavior using HSPICE without success. Am using the non-linear dopant drift model from https://www.radioeng.cz/fulltexts/2009/09_02_210_214.pdf

Just to confirm that the SPICE code I was using was correct I tried it in Pspice, as the testing in the above paper was done on Pspice. It worked on Pspice and I was able to simulate the code, i.e., observe the hysteresis, using it. The code I used in PSpice is very similar to the one available at:
https://www.edaboard.com/threads/224608/

Am including it here (from the above thread, but my code is similar):

PSpice Code:

* Ron, Roff - Resistance in ON / OFF States
* Rinit - Resistance at T=0
* D - Width of the thin film
* uv - Migration coefficient
* p - Parameter of the WINDOW-function
* for modeling nonlinear boundary conditions
* x - W/D Ratio, W is the actual width
* of the doped area (from 0 to D)
*
.SUBCKT memristor Plus Minus PARAMS:
+ Ron=100 Roff=16K Rinit=11K D=10N uv=10F p=10

* DIFFERENTIAL EQUATION MODELING *

Gx 0 x value={ I(Emem)*uv*Ron/D^2*f(V(x),p)}
Cx x 0 1 IC={(Roff-Rinit)/(Roff-Ron)}
Raux x 0 1T
* RESISTIVE PORT OF THE MEMRISTOR *

Emem plus aux value={-I(Emem)*V(x)*(Roff-Ron)}
Roff aux minus {Roff}

*Flux computation*

Eflux flux 0 value={SDT(V(plus,minus))}

*Charge computation*

Echarge charge 0 value={SDT(I(Emem))}

* WINDOW FUNCTIONS
* FOR NONLINEAR DRIFT MODELING *

*window function, according to Joglekar
.func f(x,p)={1-(2*x-1)^(2*p)}
*proposed window function
;.func f(x,i,p)={1-(x-stp(-i))^(2*p)}
.ENDS memristor

Xmemrist aa 0 memristor
Vtest aa 0 SIN(0 1.2V 1 0 0 0)

.tran 0 3s 0 3m skipbp
.probe
.end

----------------------------------------------

But when I try to use it with HSPICE it does not work, i.e., I am unable to observe the hysteresis when plotting the I-V characteristics. The I-V plot is linear, representing a simple resistor.

My HSPICE code is shown below:


* MEMRISTOR
* Ron, Roff - Resistance in ON / OFF States
* Rinit - Resistance at T=0
* D - Width of the thin film
* uv - Migration coefficient
* p - Parameter of the WINDOW-function
* for modeling nonlinear boundary conditions
* x - W/D Ratio, W is the actual width
* of the doped area (from 0 to D)
*

.SUBCKT memristor Plus Minus
+ Ron=100 Roff=16K Rinit=11K D=10N uv=10F p=10

* DIFFERENTIAL EQUATION MODELING *

. PARAM f(x,p)= '1-pow((2*x-1),(2*p))'
Gx 0 x value='I(Emem)*uv*Ron/pow(D,2)*f(V(x),p)'
Cx x 0 1 IC='(Roff-Rinit)/(Roff-Ron)'
Raux x 0 1T

* RESISTIVE PORT OF THE MEMRISTOR *
Emem plus aux value='-I(Emem)*V(x)*(Roff-Ron)'
Roff aux minus Roff

*Flux computation*

*Eflux flux 0 value={SDT(V(plus,minus))}

*Charge computation*

*Echarge charge 0 value={SDT(I(Emem))}

* WINDOW FUNCTIONS
* FOR NONLINEAR DRIFT MODELING *

*window function, according to Joglekar
*.func f(x,p)={1-(2*x-1)^(2*p)}
*proposed window function
*;.func f(x,i,p)={1-(x-stp(-i))^(2*p)}
.ENDS memristor

Xmemrist aa 0 memristor Ron=100 Roff=16K Rinit=11K D=10N uv=10F p=10
Vtest aa 0 SIN(0 1.2V 1 0 0 0)
.tran 100U 5
.plot tran V(aa) I(Vtest)
.option list node post=2 ingold=2
.end

---------------------------------------------

The changes I made from Pspice to HSPICE are:
1. changed the 'window' function definition from Pspice to HSPICE equivalent,
2. commented the flux and charge computation sections, as HSPICE does not have a 'SDT' equivalent function and they are not needed to observe the memristor characteristics.

Am not able to figure out the issue, any help would be useful.

--
Thanks,
Basawaraj
 
Hi,

Came up with a idea to fix my HSPICE code. For this I have to access the nodes inside the subcircuit. This is pretty easy in HSPICE, but am not sure how to do this in PSPICE.

I tried by changing my memristor symbol, that is added another port at node "aux" of the subcircuit so that I could probe it. As I am only interested in probing it this port was left unconnected in the circuit. The simulation failed because this node was left unconnected.

Hence, is it possible to probe nodes inside a PSPICE subcircuit? If so how?
 

Hi,

Found a solution, have to turn off the runlvl parameter, i.e., set it to zero
 

I tried to run your posted code and turned off runlvl as you suggested,
.option list node post=2 ingold=2 runlvl=0

However, it did not work as I was not able to observe hysteresis. Anything else should I modify to get it working? Do you mind to post your final working HSPICE code? Thanks in advance.
 

Hi basawaraj,

Would you mind sharing your final HSPICE description? For any reason, no matter I made the changes you recommended it does not work for me. We are using Synopsys' HSPICE 2010.

Thanks in advance!
 

Hi,
I tested this code with hspice(V2008).At first it doesn't work and give me this error " **warning** (c:\users\sh.k\desktop\mem12.sp:17) ignore unrecognizable command card ." and then I checked every thing in this program. Finally I think I found what is wrong!
In this line: ". PARAM f(x,p)= '1-pow((2*x-1),(2*p))' " you should be delete the spice between "." and "PARAM". you do it and check again!
By the way, in Hspice it is better that "STD" changed to "INTEG".

---------
Shahab
 
  • Like
Reactions: sue88

    sue88

    Points: 2
    Helpful Answer Positive Rating
Shahab, Thank you so much for the reply! I'm going to give ti a try!
 

Hi onnes,
After all the changes suggested by u people i m getting just opposite curve of hysteresis, i.e., instead of 1st and 2nd quadrant i m getting it into 2nd and 4th quadrant. i have used the same code given above. Please help me with this.

Thanking you in anticipation.
 

Hi onnes,
After all the changes suggested by u people i m getting just opposite curve of hysteresis, i.e., instead of 1st and 2nd quadrant i m getting it into 2nd and 4th quadrant. i have used the same code given above. Please help me with this.

Thanking you in anticipation.

hi manish1468

i am facing the same issue . how did u solved this .? thanks in advance your swift response will be highly appreciated

- - - Updated - - -

hi manish1468

i am facing the same issue. can you let me know how u resolve the issue
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top