• 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. How to Describe Branch Current with Bsource

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 126
  • Views 12534
  • 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

How to Describe Branch Current with Bsource

Chiaos
Chiaos over 4 years ago

Hi, I'm new spectre user.

I found simulator reference with GOOGLE.

It mentioned that we could use this syntax:

name (node1 node2) bsource behav_param param_list

subckt as below

vsrc (P 1) DC=0

r1 (1 N) resistor r=1

bsrc (1 N) bsource i = {sgn(i("vsrc:1"))*ABS(i("vsrc:1")**2)/2000)}

I got these error message:    

1. ERROR (SFE-874): "xxx.scs" 16: Cannot run the simulation because syntax error `Unexpected block statement "{"' was encountered at line 16, column 20. Correct the syntax error and rerun the simulation.
2. ERROR (SFE-874): "xxx.scs" 16: Cannot run the simulation because syntax error `Unexpected quoted string ""vsrc:1". Expected end of file or end of line' was encountered at line 16, column 27. Correct the syntax error and rerun the simulation.
3. ERROR (SFE-709): "xxx.scs" 16: No master specified for instance `ABS'

4. ERROR (SFE-709): "xxx" 16: No master specified for instance `i'.

Is there something illegal? (Except 1, 3)

  • Cancel
  • Frank Wiedmann
    Frank Wiedmann over 4 years ago

    Are you sure that the curly brackets are legal syntax? You can get some more information by typing spectre -h bsource at the Linux prompt. I didn't see any curly brackets in these examples.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to Frank Wiedmann

    Frank's right. There shouldn't be curly brackets here.

    BTW, there's no need to use google to find the simulator reference. It's in the SPECTRE installation (under the doc directory, or you can run <SPECTREinstDir>/bin/cdnshelp to open it then). If you found via google, it's probably somebody breaking the license agreement as you're not allowed to re-publish our manuals. I occasionally find very old documentation this way.

    Regards,

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Chiaos
    Chiaos over 4 years ago

    Thank you, Frank & Andrew.

    I've removed brackets, but there's still error messages.

    Error found by spectre in `xxx', during circuit read-in.
        ERROR (SFE-2309): "xxx.scs" 16: Function `SGN' is either undefined or it is a dynamic function whose arguments are behavioral expressions. This is not allowed.
        ERROR (SFE-2309): "xxx.scs" 16: Function `ABS' is either undefined or it is a dynamic function whose arguments are behavioral expressions. This is not allowed.

    Is sgn(x) & abs(x) illegal in bsource?

    These function in a protection to avoid current i("vsrc:1") through opposite direction  when connect in opposite pins.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to Chiaos

    That's because Spectre is case sensitive. The functions are sgn and abs, not SGN and ABS. In your original example above you had sgn in lowercase and ABS in uppercase, so presumably you've changed them both to be uppercase? Change them to be lowercase and that should fix it.

    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