• 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. use of variables in bsource expression

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 125
  • Views 3541
  • 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

use of variables in bsource expression

RM202408071340
RM202408071340 over 1 year ago

Hi - I would like to use a bsource to model a nonlinear element and pass a CDF variable to the expression that defines the behaviour of the bsource.

For example, in the following expression, I would like to use the Rm_ref and Vbias_ref values defined in the CDF: I(iprb)*pPar("Rm_ref")*pow(pPar("Vbias_ref"),2)/pow(V(VBIAS),2) but I get the following error:

ERROR (SFE-1997): "input.scs" 106: Cannot run the simulation, because I10.I6 in parameter `bs_par_0': Unknown parameter `Rm_ref' has been specified in expression `pPar(Rm_ref)' Correct the expression and rerun the simulation.
ERROR (SFE-1997): "input.scs" 106: Cannot run the simulation, because I10.I6 in parameter `bs_par_1': Function `pPar' is not defined. Update the netlist to define the function.

Thanks for your help.

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    This is complicated by the fact that the expression on the analogLib source intentionally has ParseAsCEL and ParseAsNumber set to "no" or is marked as "Literal" if you look at it in IC23.1 (in the CDF). This is because the expression would be misinterpreted if interpreted as AEL (aka CEL) - it's a native expression in the simulator.

    You can refer to parameters using just the bare name (e.g. Vbias_ref) without the pPar().  The trick is that you want them to appear in the subckt when netlisted - so they need to be used as pPar() in another field. You can achieve that by setting:

    Expression: I(iprb)*Rm_ref*pow(Vbias_ref,2)/pow(V(VBIAS),2)
    Temp rise from ambient: pPar("Rm_ref")*0+pPar("Vbias_ref")*0

    (in other words, the result will be zero for the temp rise, but they will reference the pPar so that it gets netlisted in the subckt). As a result, the netlist would be:

    // Library name: mylib
    // Cell name: forumbsource
    // View name: schematic
    subckt forumbsource a b
    parameters Rm_ref Vbias_ref
      I0 (a b) bsource v=I(iprb)*Rm_ref*pow(Vbias_ref,2)/pow(V(VBIAS),2) \
        trise=Rm_ref*0+Vbias_ref*0
    ends forumbsource
    // End of subcircuit definition.

    // Library name: mylib
    // Cell name: forumbsourcetb
    // View name: schematic
    I0 (a b) forumbsource Rm_ref=2 Vbias_ref=3

    A made-up example (I don't have the iprb present or VBIAS node), but hopefully you get the picture.

    Regards,

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    This is complicated by the fact that the expression on the analogLib source intentionally has ParseAsCEL and ParseAsNumber set to "no" or is marked as "Literal" if you look at it in IC23.1 (in the CDF). This is because the expression would be misinterpreted if interpreted as AEL (aka CEL) - it's a native expression in the simulator.

    You can refer to parameters using just the bare name (e.g. Vbias_ref) without the pPar().  The trick is that you want them to appear in the subckt when netlisted - so they need to be used as pPar() in another field. You can achieve that by setting:

    Expression: I(iprb)*Rm_ref*pow(Vbias_ref,2)/pow(V(VBIAS),2)
    Temp rise from ambient: pPar("Rm_ref")*0+pPar("Vbias_ref")*0

    (in other words, the result will be zero for the temp rise, but they will reference the pPar so that it gets netlisted in the subckt). As a result, the netlist would be:

    // Library name: mylib
    // Cell name: forumbsource
    // View name: schematic
    subckt forumbsource a b
    parameters Rm_ref Vbias_ref
      I0 (a b) bsource v=I(iprb)*Rm_ref*pow(Vbias_ref,2)/pow(V(VBIAS),2) \
        trise=Rm_ref*0+Vbias_ref*0
    ends forumbsource
    // End of subcircuit definition.

    // Library name: mylib
    // Cell name: forumbsourcetb
    // View name: schematic
    I0 (a b) forumbsource Rm_ref=2 Vbias_ref=3

    A made-up example (I don't have the iprb present or VBIAS node), but hopefully you get the picture.

    Regards,

    Andrew

    • 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