• 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. Custom IC Design
  3. Converting a pspice model to schematic/spectre (max, table...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 126
  • Views 2567
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Converting a pspice model to schematic/spectre (max, table etc)

SteveVrk
SteveVrk over 3 years ago

Hello,

I would like to have this pspice circuit as a sub circuit in virtuoso:

.subckt ccm-dcm1 1 2 3 4 5 params: L=1 fs=1E6
Et 1 2 value={(1-v(u))*v(3,4)/v(u)}
Gd 4 3 value={(1-v(u))*i(Et)/v(u)}
Ga 0 a value={MAX(i(Et),0)}
Va a b
Rdummy b 0 10
Eu u 0 table {MAX(v(5), v(5)*v(5)/(v(5)*v(5)+2*L*fs*i(Va)/v(3,4)))} (0 0) (1 1)
.ends

This is what I put in the schematic editor:

And this is the netlist:

simulator lang=spectre
global 0
Ga (0 a) bsource v=MAX(i(Et),0)
Eu (u 0) bsource v=table MAX(v(5), \
v(5)*v(5)/(v(5)*v(5)+2*L*fs*i(Va)/v(3,4))) (0 0) (1 1)
Et (v1 v2) bsource v=(1-v(u))*v(3,4)/v(u)
Va (a b) vsource dc=0 type=dc
Rdummy (b 0) resistor r=10
Gd (v4 v3) bsource i=(1-v(u))*i(Et)/v(u) 
simulatorOptions options reltol=1e-3 vabstol=1e-6 iabstol=1e-12 temp=27 \
tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 rforce=1 maxnotes=5 maxwarns=5 \
digits=5 cols=80 pivrel=1e-3 sensfile="../psf/sens.output" \
checklimitdest=psf
dcOp dc write="spectre.dc" maxiters=150 maxsteps=10000 annotate=status
dcOpInfo info what=oppoint where=rawfile
modelParameter info what=models where=rawfile
element info what=inst where=rawfile
outputParameter info what=output where=rawfile
designParamVals info what=parameters where=rawfile
primitives info what=primitives where=rawfile
subckts info what=subckts where=rawfile
saveOptions options save=allpub

Of course, the simulation fails and I think the main issue (up to this point) is the table:

ERROR (SFE-874): "input.scs" 13: Cannot run the simulation because syntax error `Unexpected open parenthesis "(". Expected equals' was encountered at line 13, column 28. Correct the syntax error and rerun the simulation.

How do I properly implement this?

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    I thought I'd answered this yesterday but it seems I didn't hit the "Reply" button.

    There are several things wrong here:

    1. You can't just paste PSPICE syntax into a bsource component - they are not equivalent
    2. In particular there's no table support in bsource, and the MAX function would be called max (Spectre is case-sensitive)
    3. Also, you've changed the pin names to v1, v2, v3 etc whereas the expressions refer to v(1) v(2) etc - that would need to be v(v1) and so on.

    However, I would say there's little point in trying to translate this to a schematic - better would be to directly use the PSPICE model. To do that, simply do:

    1. Create a new cellView with Type: Pspice (the view name would usually be called "pspice") - I would recommend changing the cell name to be "ccm_dcm1" or "ccmdcm1" as a minus sign is not a great thing to have in a cell name (it might cause flow issues somewhere)
    2. Paste in the model code into the text editor that appears (again, changing the subckt name to match the cell name you picked in step 1)
    3. Press the "Build a database" button (the save icon with the green checkmark) or File->Extract (they're the same)
    4. It will check all is OK with the model, and ask you to generate a symbol (which will have pins called 1,2,3,4,5 etc) - move to whichever side of the symbol you want
    5. You can then place an instance of this symbol in your circuit
    6. In ADE, if using a config view then set the "view to use" of the component to be "pspice" or if not using a config view ensure that "pspice" is in the View List in Setup->Environment - this gets the netlister to look at the pspice view

    That's it. No translation to other languages needed - Spectre supports a large proportion of the PSPICE language, so you might as well use the model directly.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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