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.

Hspice simulation problem

Status
Not open for further replies.

srvn4041

Newbie level 6
Joined
May 17, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Bhopal
Activity points
1,373
I am trying to simulate basic circuit "knowing characteristics of memristor"

here is my code:

* circuit
.SUBCKT memristor Plus Minus
+ 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}

* 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

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

.tran 0 3s
.probe
.end


I have got the following error:

**error** no definition for 1:{i
it was called by 1:gx


Help me out, can anyone check this out in hspice and reply.

thanks in adv.
 

I know little about memristors but there's animated simulations using them at this link:

Click Yes if a message comes up asking if it can install the java applet.

https://www.falstad.com/circuit/e-mr-sine.html

There are several other simulations of memristor action. It has a whole library of various circuits.
 

This question is almost identical to another current thread so my answer will be the same - have you tried searching the forum? There have been several discussions about simulating memristors.

Keith
 

I know little about memristors but there's animated simulations using them at this link:

Click Yes if a message comes up asking if it can install the java applet.

https://www.falstad.com/circuit/e-mr-sine.html

There are several other simulations of memristor action. It has a whole library of various circuits.


Thank u sir, i will have a look into it

---------- Post added at 23:14 ---------- Previous post was at 23:11 ----------

This question is almost identical to another current thread so my answer will be the same - have you tried searching the forum? There have been several discussions about simulating memristors.

Keith

Sir,
i started following this board after having look at all thread, even then i couldn't run it in HSPICE particularly. Please help me out, i could do it in pspice but couldn't run it in HSPICE.
and one more thing is the the hp memristor model is also not working in HSPICE, please help me out

thanks in adv.
 

For HSPICE, try removing the = sign out of func:

Code:
.func f(x,p) {1-(2*x-1)^(2*p)}

For LTspice, it seems that it prefers ** to ^ for raising to a power.

Keith.
 

sir, the problem is with the value of Gx stated above its giving
no definition for 1:{i
it was called by 1:gx


For HSPICE, try removing the = sign out of func:

Code:
.func f(x,p) {1-(2*x-1)^(2*p)}

For LTspice, it seems that it prefers ** to ^ for raising to a power.

Keith.
 

Have you actually tried my suggestion? I tried your syntax and also got an error. I removed the equals sign and it fixed it. Gx calls the func f(x,p) so a syntax error in the func stops Gx working.

Keith
 

i have tried ur suggestion now,

I modified the code as stated below and tried.

* circuit
.SUBCKT memristor Plus Minus
+ 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}

* 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

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

.tran 0 3s
.probe
.end


but got an error

**error** no definition for 1:{i
it was called by 1:gx

Have you actually tried my suggestion? I tried your syntax and also got an error. I removed the equals sign and it fixed it. Gx calls the func f(x,p) so a syntax error in the func stops Gx working.

Keith
 

I which case I am not sure what to suggest - your code works fine for me. There is a similar thread here which seems to uses the same source information which is now fixed. See if that helps. https://www.edaboard.com/threads/253755/

The only other thing I can think of is if your simulator is case sensitive so requires a lower case letter 'i' in
Code:
Gx 0 x Value={I(Emem)*uv*Ron/D^2*f(V(x),p)}

So
Code:
Gx 0 x Value={i(Emem)*uv*Ron/D^2*f(V(x),p)}

i(Emem) is referring to the current in Emem.

Keith.
 

sir,
have u checked the code in HSPICE itself ?
I doubt as i couldn't get the result either by changing I to i as u mentioned above.

Can u please give me the link of software version ur using for simulation and also the exact code without any changes if possible the .lis and .sto files also.

Please help me out sir.
 


I am working under a professor who is familiar with HSPICE. So , he is insisting me to work on it only, or else it works cool with PSPICE and LTSPICE.

Help me out sir, by checking code in HSPICE itself please.
 

I don't have Hspice to try it, but from the Hspice manual I would suggest you remove the .func part from the line altogether so you get:

Code:
f(x,p) {1-(2*x-1)^(2*p)}

or

Code:
f(x,p)={1-(2*x-1)^(2*p)}

Keith.
 

Hi,

Had similar problem with the model in HSPICE.

There is a simple solution, just turn off runlvl (set it to zero) and it should work fine.

--
Basawaraj
 

hi baswaraj, i didn't get u please post the code of the working model.
it would be great help

---------- Post added at 12:26 ---------- Previous post was at 12:22 ----------

Neither did that work.

Please check it out in HSPICE and let me know whether we are getting results.

I don't have Hspice to try it, but from the Hspice manual I would suggest you remove the .func part from the line altogether so you get:

Code:
f(x,p) {1-(2*x-1)^(2*p)}

or

Code:
f(x,p)={1-(2*x-1)^(2*p)}

Keith.
 

Dear Keith,
tried the code, neither it worked.

the code seems to be fine in PSPICE.
problem is with the HSPICE itself.

thanks for help
 

Did you try using

Code:
.PARAM f(x,p)= '1-pow((2*x-1),(2*p))'

instead of

Code:
.func f(x,p)={1-(2*x-1)^(2*p)}

I don't see .func in any of the documentation I have on Hspice.

Also, please state what the problem is - "it doesn't work" is not very helpful. What is the error message and have you been able to get that error message to change? That would indicate some progress.

Also, what version of Hspice are you using? Earlier versions didn't have runlvl although I wouldn't expect that to help as your problem is a syntax one.

Keith.
 

Try out the code in https://www.edaboard.com/threads/246769/#post1087576.

Use the HSPICE code and add
Code:
.OPTION runlvl=0
and it should work fine.

Have tested it on F-2011.09-SP1 version of HSPICE and it works just fine.


Keith: Forgot to credit you on the suggestion you made in your previous post :sad:.
 
Last edited:

If you are using an old version of Hspice then runlvl won't work. However, I believe the problem you are having is a syntax error so runlvl won't matter.

Keith.

Just to add, I suggested the same thing in my post https://www.edaboard.com/threads/253698/ and we are told it doesn't work.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top