• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. PSpice
  3. There is something wrong with my device model, which always...

Stats

  • State Suggested Answer
  • Replies 6
  • Answers 1
  • Subscribers 27
  • Views 2586
  • Members are here 0
More Content

There is something wrong with my device model, which always leads to mistakes in simulation, but I don't know where the mistakes are.

JQ202504092110
JQ202504092110 5 months ago

This is my PSPICE model:

.SUBCKT MEMRISTOR 1 2
Cx 3 0 1e-9 IC=0.314
Rx 3 0 1G
Vstp TIME 0 PULSE(0 1 0 1ns 1ns 1s 2s)
E_stp 4 0 VALUE { IF(TIME > 0, 0, 1) }
B_fx 5 0 V=1 - ( (0.9 * (V(3) - V(4)) ** 2 + 0.1) ) ** 10
Gx 0 3 VALUE { 1e-14 * 100 / (10e-9)**2 * I(Vsense) * V(5) }
E_Rmem 6 0 VALUE { 16e3 - V(3) * (16e3 - 100) }
Rmem 6 7 1
Vsense 1 7 DC 0
Rout 2 7 1e-12
.ENDS MEMRISTOR

This error occurred during my simulation:But I don't know what's wrong. Please help me analyze it.

ERROR(ORPSIM-16152): Invalid number: Error while converting token '-' to double value. Token can be a constant or expression

  • Sign in to reply
  • Cancel
  • rg13
    0 rg13 5 months ago

    It seems there is some syntax error in library which you are using. Could you share your archived project along with Pspice library (.lib) to Cadence ASK team?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • oldmouldy
    0 oldmouldy 5 months ago

    You have a B device for "B_fx" which is SPICE 3 and PSpice is SPICE 2. Since this B device is generating a Voltage, you can use an Evalue, like the other E devices, to replace the B device.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JQ202504092110
    0 JQ202504092110 5 months ago in reply to oldmouldy

    When I changed B_fx to E, there was a new error:

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JQ202504092110
    0 JQ202504092110 5 months ago in reply to rg13

    I don't know how to upload lib files,The following is my lib file code

    .SUBCKT MEMRISTOR1 Plus Minus PARAMS: Roff=16k Ron=100 D=10n uv=1e-14 p=10
    Cx x 0 1p IC=0.314
    E_stp stp 0 VALUE { IF(TIME >= 0, 1, 0) }
    E_arg arg 0 VALUE { 0.9*(V(x)-V(stp))**2 + 0.1 }
    E_f f 0 VALUE { 1 - (V(arg)**10) }
    Gdx 0 x VALUE { V(Plus,Minus)/(Roff - V(x)*(Roff-Ron)) * V(f) * 1e6 }
    Rmem Plus Minus R={Roff - V(x)*(Roff-Ron)}
    .ENDS MEMRISTOR1

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JQ202504092110
    0 JQ202504092110 5 months ago in reply to JQ202504092110

    Does this also need to be defined by value?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information