• 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. analogLib switch component not switching

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 125
  • Views 22494
  • 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

analogLib switch component not switching

MatthewLove
MatthewLove over 6 years ago

Hi,

I'm trying to use the switch model in analogLib to emulate a PMOS for an ideal inverter stage.

When the switch is closed, the impedance is 1T Ohm and when it is open, it's 1m Ohm.

This works in isolation with the following circuit.

You can see in the ViVA plot that the impedance is 1T when the input voltage is 800 mV.

When this switch is included in the inverter circuit with another switch (that's meant to emulate an NMOS), the impedance of the PMOS is fixed to 1m Ohm whereas the "NMOS" is switching as expected.

Does anyone know why it ceases to work in this schematic?

  • Cancel
Parents
  • MatthewLove
    MatthewLove over 6 years ago

    While the images are extremely blurry, you can view them clearly by clicking on them.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to MatthewLove

    Can you please post the input.scs to avoid me having to guess the parameters you're using?

    Thanks,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MatthewLove
    MatthewLove over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Sorry about that.

    I've included the .scs files for both circuits.

    Regards,

    Matthew

    (I'll paste them here in case they haven't uploaded properly; I dragged them into the editor and they "uploaded" but nothing has appeared.)

    single_switch.scs

    // Generated for: spectre
    // Generated on: Oct 18 11:08:51 2018
    // Design library name: scratchpad
    // Design cell name: switch_test_mwe
    // Design view name: schematic
    simulator lang=spectre
    global 0
    parameters Vin_DC=0
    include "$SPECTRE_MODEL_PATH/design_wrapper_rf.lib.scs" section=tt_pre
    include "$SPECTRE_MODEL_PATH/soa_rf.scs"

    // Library name: scratchpad
    // Cell name: switch_test_mwe
    // View name: schematic
    W1 (0 0 net1 0) relay vt1=100.0m vt2=700.0m ropen=1 rclosed=1T
    PORT0 (net1 0) port r=50 dc=Vin_DC type=sine edgetype=linear
    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
    dc dc hysteresis=yes param=Vin_DC start=0 stop=0.8 oppoint=rawfile \
        maxiters=150 maxsteps=10000 annotate=status
    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
    save W1:res
    saveOptions options save=allpub

    Inverter.scs

    // Generated for: spectre
    // Generated on: Oct 18 11:07:09 2018
    // Design library name: scratchpad_class_d_stacked
    // Design cell name: ideal_class_d_mwe
    // Design view name: schematic
    simulator lang=spectre
    global 0
    parameters Vin_DC=0
    include "$SPECTRE_MODEL_PATH/design_wrapper_rf.lib.scs" section=tt_pre
    include "$SPECTRE_MODEL_PATH/soa_rf.scs"

    // Library name: scratchpad_class_d_stacked
    // Cell name: ideal_class_d_mwe
    // View name: schematic
    V0 (net05 0) vsource dc=2.4 type=dc
    W4 (M2_D net05 0 net02) relay vt1=100.0m vt2=700.0m ropen=1 rclosed=1T
    W1 (0 M2_D net02 0) relay vt1=100m vt2=700.0m ropen=1T rclosed=1
    PORT2 (net02 0) port r=50 dc=Vin_DC type=sine edgetype=linear
    PORT1 (M2_D 0) port r=50 type=sine
    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
    dc dc hysteresis=yes param=Vin_DC start=0 stop=0.8 oppoint=rawfile \
        maxiters=150 maxsteps=10000 annotate=status
    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
    save W4:res W1:res
    saveOptions options save=allpub

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 6 years ago in reply to MatthewLove

    Hi Matthew,

    I'm not entirely sure what you want here, but because the top switch (relay) has the inputs reversed, the voltage across the inputs is always negative (so that means you are sweeping it from 0 to -0.8V). If you swap the inputs to the top switch, then it does transition as you sweep Vin_DC from 0 0.8 (since you've switched the on and off resistances, I don't think you also want to invert the control voltage - if you do, you'll need to adjust the thresholds accordingly). This is what I get with W4 as:

    W4 (M2_D net05 net02 0) relay vt1=100.0m vt2=700.0m ropen=1 rclosed=1T

    By the way, I'm not sure why you are using two port components - it seems a bit bizarre having a port when you're driving a high impedance input... why not use a vsource for the Vin_DC input? After all, what is going to happen is that the voltage on the output of the port will be double what you have asked for, because you specify the voltage with the assumption that the load on the port is matched to the 50 ohm impedance, which it isn't here - the high impedance of the relay input means that you'll get double the voltage instead.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • MatthewLove
    MatthewLove over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for the detailed reply.

    I wasn't aware that the switch polarity was a factor but your reply has cleared it up for me.

    >why not use a vsource for the Vin_DC input

    You're right. I misinterpreted the documentation and should have just used a voltage source.

    Thanks for pointing that out.

    Regards,

    Matthew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • MatthewLove
    MatthewLove over 6 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for the detailed reply.

    I wasn't aware that the switch polarity was a factor but your reply has cleared it up for me.

    >why not use a vsource for the Vin_DC input

    You're right. I misinterpreted the documentation and should have just used a voltage source.

    Thanks for pointing that out.

    Regards,

    Matthew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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